:root {
  --primary-color: #4a6bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #f5f7fa;
  color: var(--dark-color);
}

.header {
  background: linear-gradient(135deg, var(--primary-color), #6a11cb);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  flex: 1 1 300px;
  max-width: 400px;
  min-width: 250px;
  padding: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-content {
  flex: 3;
  min-width: 0;
  padding: 1rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.upload-area {
  background-color: white;
  border: 2px dashed var(--primary-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.upload-area.dragover {
  background-color: #e6f0ff;
  border-color: var(--info-color);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.upload-button:hover {
  background-color: #3a5bef;
  transform: translateY(-2px);
}

.preview-area {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
}

#previewCanvas {
  max-width: 100%;
  border-radius: var(--border-radius);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input[type="number"],
select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: all 0.3s ease;
}

button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-info {
  background-color: var(--info-color);
  color: white;
}

.ad-container {
  margin: 2rem 0;
  text-align: center;
  min-height: 90px;
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--box-shadow);
}

.ad-container ins {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.lazy-ad {
  min-height: 250px;
  transition: all 0.3s ease-in-out;
}

.size-list {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
}

.size-list-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.size-list-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.size-item {
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.footer {
  background-color: var(--dark-color);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
  margin-top: 3rem;
}

@media (max-width: 768px) {
  .page-wrapper {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex: none;
    max-width: 100%;
    order: 3;
    padding: 1rem;
  }

  .main-content {
    order: 2;
  }

  .left-sidebar {
    order: 1;
  }

  .right-sidebar {
    order: 3;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .size-list-controls {
    flex-direction: column;
  }

  .action-buttons {
    flex-direction: column;
  }

  button {
    width: 100%;
    justify-content: center;
  }
}
