:root {
  --bg-gradient: linear-gradient(135deg, #1c2e4a 0%, #283e51 50%, #4b79a1 100%);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --card-bg: rgba(30, 40, 55, 0.7);
  --card-bg-secondary: rgba(255, 255, 255, 0.1);
  --card-glass: rgba(20, 30, 45, 0.6);
  --primary-color: #00f2ea;
  --primary-dark: #00b8b0;
  --accent-color: #ff0050;
  --accent-light: #ff4d80;
  --success-color: #00ff9d;
  --warning-color: #ffd700;
  --error-color: #ff3838;
  --text-color: #ffffff;
  --text-muted: #b0b0d0;
  --text-light: rgba(255, 255, 255, 0.95);
  --border-color: rgba(255, 255, 255, 0.2);
  --input-bg: rgba(0, 0, 0, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.2);
  --font-body: 'Segoe UI', Roboto, Arial, sans-serif;
  --font-heading: 'Fondamento', cursive;
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
  font-family: 'Fondamento';
  src: url('/Fondamento-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-color);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.08)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
  z-index: 1;
}

.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.floating-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.orb {
  position: absolute;
  border-radius: 50%;
  backdrop-filter: blur(10px);
  animation: float 20s ease-in-out infinite;
}

.orb:nth-child(1) {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle at 30% 30%, rgba(0, 242, 234, 0.3), rgba(0, 242, 234, 0.05));
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.orb:nth-child(2) {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 0, 80, 0.3), rgba(255, 0, 80, 0.05));
  top: 60%;
  right: 10%;
  animation-delay: -7s;
}

.orb:nth-child(3) {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at 30% 30%, rgba(100, 100, 255, 0.3), rgba(100, 100, 255, 0.05));
  bottom: 20%;
  left: 20%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, -30px) rotate(90deg); }
  50% { transform: translate(-20px, -60px) rotate(180deg); }
  75% { transform: translate(-30px, 30px) rotate(270deg); }
}

header {
  padding: 15px 30px;
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

h1 {
  font-family: var(--font-heading);
  color: var(--text-color);
  display: flex;
  align-items: center;
  /* Increase gap to accommodate buttons */
  gap: 15px;
  font-size: 2.2em;
  margin: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-icon {
  width: 35px;
  height: 35px;
  fill: url(#iconGradient);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.header-actions {
  display: flex;
  gap: 10px;
  margin-left: auto; /* Push buttons to the right */
}

.main-content {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr 320px;
  gap: 15px;
  padding: 15px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  height: auto;
  min-height: 0;
}

.control-panel {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 25px;
  overflow-y: auto;
  height: 100%;
  max-height: none;
  box-shadow: var(--shadow-glass);
  position: relative;
}

.control-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: var(--border-radius-lg);
  pointer-events: none;
}

.sidebar-panel {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  overflow-y: auto;
  height: 100%;
  max-height: none;
  box-shadow: var(--shadow-glass);
}

.panel-section {
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
}

.panel-section:last-child {
  margin-bottom: 0;
}

h2 {
  font-family: var(--font-heading);
  color: var(--text-color);
  margin: 0 0 20px 0;
  font-size: 1.8em;
}

.preview-panel {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-glass);
  position: relative;
  height: 100%;
}

.preview-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border-radius: var(--border-radius-lg);
  pointer-events: none;
}

.preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.image-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
}

.image-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.image-action-btn {
  padding: 10px 20px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: var(--text-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
}

.image-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.image-action-btn.primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border-color: transparent;
}

.progress-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
  height: 8px;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(72, 187, 120, 0.1);
  border: 1px solid rgba(72, 187, 120, 0.3);
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  font-size: 14px;
  color: var(--success-color);
}

.status-indicator.warning {
  background: rgba(237, 137, 54, 0.1);
  border-color: rgba(237, 137, 54, 0.3);
  color: var(--warning-color);
}

.status-indicator.error {
  background: rgba(245, 101, 101, 0.1);
  border-color: rgba(245, 101, 101, 0.3);
  color: var(--error-color);
}

form {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  max-width: none;
}

textarea,
input[type="text"],
input[type="number"],
select {
  padding: 14px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  background: var(--input-bg);
  backdrop-filter: blur(10px);
  width: 100%;
  margin-bottom: 20px;
  transition: var(--transition-smooth);
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: var(--text-color);
}

textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 242, 234, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

option {
  background: #1a1a2e;
  color: #fff;
}

.enhance-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 15px;
}

.suggestion-tag {
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--primary-color);
}

.suggestion-tag:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

#result {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

#result img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.image-variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
}

.variant-image {
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 2px solid transparent;
  overflow: hidden;
}

.variant-image:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.variant-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#descriptionResult {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.5;
}

.download-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  z-index: 100;
}

.download-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.header-action-button, .help-button {
  height: 35px;
  width: auto;
  border-radius: 8px; /* Use smaller radius for buttons */
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 0 15px; /* Add padding for text */
  display: flex;
  align-items: center;
  gap: 6px; /* Space between icon and text */
  transition: all 0.3s ease;
  font-weight: 600;
  white-space: nowrap;
}

.help-button {
  background: var(--card-glass); /* Slightly different style for contrast */
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0 15px;
}

.header-action-button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.help-button:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.prompt-library-modal {
  max-width: 600px;
}

.library-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.saved-prompts-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 10px;
}

.saved-prompt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  transition: var(--transition-smooth);
}

.saved-prompt-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 242, 234, 0.2);
}

.prompt-details {
  flex: 1;
  margin-right: 15px;
  overflow: hidden;
}

.prompt-title {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.prompt-actions button {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 8px;
  transition: all 0.2s;
}

.prompt-actions .load-btn {
  background: var(--success-color);
  color: #1c2e4a;
}

.prompt-actions .load-btn:hover {
  filter: brightness(0.9);
}

.prompt-actions .delete-btn {
  background: var(--error-color);
  color: white;
}

.prompt-actions .delete-btn:hover {
  filter: brightness(0.9);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: block;
  opacity: 1;
}

.modal-content {
  background: var(--card-bg);
  margin: 5% auto;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-hover);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.art-style-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  width: 100%;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.art-style-button:hover {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--text-muted);
}

.art-style-modal {
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
}

.art-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.art-style-category h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.2em;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 5px;
}

.style-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.style-option {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.style-option:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.style-option.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 25px;
}

.quick-action-btn {
  padding: 12px 16px;
  border: none;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.batch-controls {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 25px;
}

.batch-controls h3 {
  margin: 0 0 15px 0;
  font-size: 1.1em;
  color: var(--primary-color);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: end;
}

.custom-size-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.image-history {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border);
  transform: translateX(5px);
}

.history-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.history-details {
  flex: 1;
  font-size: 13px;
}

.history-prompt {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.favorite-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition-smooth);
  align-self: flex-start;
}

.favorite-btn:hover,
.favorite-btn.favorited {
  color: var(--warning-color);
  transform: scale(1.2);
}

.file-upload-area {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  background: var(--input-bg);
}

.file-upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

.file-upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.file-upload-text {
  color: var(--text-muted);
  font-size: 14px;
}

.enhanced-prompt-display {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.enhanced-prompt-display h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: var(--text-color);
}

.enhanced-prompt-display p {
  margin: 8px 0;
  word-wrap: break-word;
}

.generate-btn,
button[type="submit"] {
  width: 100%;
  padding: 16px 24px;
  border: none;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition-smooth);
  margin-top: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.generate-btn::before,
button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.generate-btn:hover::before,
button[type="submit"]:hover::before {
  left: 100%;
}

.generate-btn:hover,
button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.generate-btn:disabled,
button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.batch-generate-btn {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
}

/* Enhanced result display */
#result img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.image-variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
}

.variant-image {
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 2px solid transparent;
  overflow: hidden;
}

.variant-image:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.variant-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Enhanced mobile responsiveness */
@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 350px 1fr 280px;
  }
}

@media (max-width: 1024px) {
  body {
    height: auto;
    overflow: auto;
  }
  
  .container {
    height: auto;
    display: block;
  }
  
  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 15px;
    height: auto;
    overflow: visible;
  }
  
  .control-panel,
  .sidebar-panel,
  .preview-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 15px;
  }
  
  .control-panel,
  .preview-panel,
  .sidebar-panel {
    padding: 25px;
  }
  
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  header {
    padding: 15px 20px;
  }
}

/* Custom Scrollbar for Desktop */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Loading animations */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Enhanced tooltips */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

/* Enhanced drag and drop */
.drop-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--border-radius);
  padding: 40px 20px;
  text-align: center;
  transition: var(--transition-smooth);
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.drop-zone.drag-over {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
  transform: scale(1.02);
}

.drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.5s;
}

.drop-zone.drag-over::before {
  left: 100%;
}

/* Micro-interactions */
.micro-bounce {
  animation: microBounce 0.6s ease-out;
}

@keyframes microBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.scale-in {
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Premium effects */
.glow-effect {
  position: relative;
}

.glow-effect::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--accent-light));
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
  filter: blur(10px);
}

.glow-effect:hover::before {
  opacity: 0.7;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  margin: 0;
}

.clear-section-btn {
  background: rgba(245, 101, 101, 0.1);
  border: 1px solid rgba(245, 101, 101, 0.3);
  color: var(--error-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  padding: 0;
}

.clear-section-btn:hover {
  background: var(--error-color);
  color: white;
  transform: scale(1.1);
}

.clear-all-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--error-color), #c53030);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.clear-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 101, 101, 0.4);
}

.user-guide {
  max-width: 900px;
  max-height: 85vh;
  font-size: 14px;
  line-height: 1.6;
}

.guide-toc {
  background: rgba(102, 126, 234, 0.1);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
}

.guide-toc ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.guide-toc li {
  padding: 5px 0;
}

.guide-toc a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.guide-toc a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.guide-section {
  margin-bottom: 40px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
}

.guide-section h3 {
  color: var(--primary-color);
  margin: 0 0 20px 0;
  font-size: 1.4em;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.guide-section h4 {
  color: var(--text-color);
  margin: 20px 0 12px 0;
  font-size: 1.1em;
}

.guide-section ul,
.guide-section ol {
  margin: 10px 0;
  padding-left: 25px;
}

.guide-section li {
  margin: 8px 0;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.shortcut-item strong {
  color: var(--primary-color);
  font-family: monospace;
  font-size: 13px;
}

.troubleshoot-item,
.faq-item {
  padding: 15px;
  margin: 15px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.troubleshoot-item strong,
.faq-item strong {
  color: var(--primary-color);
}

/* Enhanced scrollbar for the user guide */
.user-guide::-webkit-scrollbar {
  width: 8px;
}

.user-guide::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.user-guide::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.user-guide::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}