/* ============================
   CSS Variables & Theme
   ============================ */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f17;
  --bg-card: #15151f;
  --bg-card-hover: #1a1a27;
  --border-color: #27272a;
  --border-active: #3f3f46;
  
  --accent-primary: #00d4ff;
  --accent-secondary: #7c3aed;
  --accent-tertiary: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --accent-gradient-hover: linear-gradient(135deg, #00e5ff 0%, #8b5cf6 100%);
  
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);
  --shadow-glow-purple: 0 0 30px rgba(124, 58, 237, 0.3);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* ============================
   Reset & Base
   ============================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ============================
   App Container
   ============================ */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================
   Header
   ============================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(15, 15, 23, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoPulse 3s ease-in-out infinite;
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pro-badge {
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: unset;
  -webkit-text-fill-color: white;
  background-clip: unset;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.header-btn svg {
  width: 20px;
  height: 20px;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse 2s infinite;
}

.api-status.connected .status-dot {
  background: var(--success);
}

.api-status.error .status-dot {
  background: var(--error);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* API Credits Display */
.api-credits {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.75rem;
  margin-left: 0.5rem;
  border-left: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: help;
}

.api-credits svg {
  opacity: 0.7;
}

.credits-value {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-primary);
}

.api-credits.low .credits-value {
  color: #f59e0b;
}

.api-credits.critical .credits-value {
  color: #ef4444;
  animation: blink 1s infinite;
}

.api-admin-link {
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: var(--transition-fast);
}

.api-admin-link:hover {
  color: var(--accent-primary);
}

.api-key-pill {
  margin-left: 0.5rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================
   Main Content
   ============================ */
.main-content {
  flex: 1;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  max-height: calc(100vh - 73px);
}

/* ============================
   Control Panel
   ============================ */
.control-panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 50;
}

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.5rem 1.5rem;
  padding-bottom: 80px; /* Space for fixed footer */
}

/* Panel Tabs */
.panel-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
  margin-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  -webkit-overflow-scrolling: touch;
}

.panel-tabs::-webkit-scrollbar {
  height: 4px;
}

.panel-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.panel-tabs::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.panel-tabs::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.panel-tab {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

/* Textile tabs - more compact and scrollable */
#textileTabs {
  flex-wrap: nowrap;
  gap: 0.2rem;
}

#textileTabs::-webkit-scrollbar {
  height: 3px;
}

#textileTabs .panel-tab {
  padding: 0.35rem 0.55rem;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
}

.panel-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-card);
}

.panel-tab.active {
  color: var(--accent-primary);
  background: rgba(0, 212, 255, 0.1);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.control-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Control Inputs & Selects */
.control-input,
.control-select,
.control-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition);
}

.control-input:focus,
.control-select:focus,
.control-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.control-input::placeholder,
.control-textarea::placeholder {
  color: var(--text-muted);
}

.control-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.control-select option,
.control-select optgroup {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem;
}

.control-select optgroup {
  font-weight: 600;
  color: var(--text-secondary);
}

.control-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Enhance Button */
.enhance-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-tertiary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.enhance-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-tertiary);
}

.enhance-btn svg {
  width: 14px;
  height: 14px;
}

/* Mode Buttons */
.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn svg {
  width: 18px;
  height: 18px;
}

.mode-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-primary);
}

.mode-btn.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Upload Area */
.upload-section {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.upload-area {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: var(--transition);
  overflow: hidden;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent-primary);
  background: rgba(0, 212, 255, 0.05);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
  text-align: center;
}

.upload-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.upload-placeholder p {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.upload-placeholder span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Paste Hint Styling */
.paste-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 212, 255, 0.1);
  border: 1px dashed rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.8;
  transition: var(--transition-fast);
}

.paste-hint kbd {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 4px;
  font-family: 'Outfit', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.upload-area:hover .paste-hint {
  opacity: 1;
  background: rgba(0, 212, 255, 0.15);
}

.upload-preview {
  display: none;
  position: relative;
}

.upload-preview.active {
  display: block;
}

.upload-preview img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.remove-btn:hover {
  background: var(--error);
}

.remove-btn svg {
  width: 16px;
  height: 16px;
}

/* Prompt Input */
.prompt-input {
  width: 100%;
  padding: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  resize: vertical;
  min-height: 100px;
  transition: var(--transition);
}

.prompt-input::placeholder {
  color: var(--text-muted);
}

.prompt-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.system-input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 70px;
  transition: var(--transition);
}

.system-input::placeholder {
  color: var(--text-muted);
}

.system-input:focus {
  outline: none;
  border-color: var(--accent-secondary);
}

/* Token Info */
.token-info {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

#tokenCount {
  color: var(--accent-primary);
  font-weight: 500;
}

.token-limit {
  color: var(--text-muted);
}

/* Collapsible */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.collapsible-header:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.collapsible-header svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.collapsible.open .collapsible-header svg {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  padding: 1rem;
  background: rgba(21, 21, 31, 0.5);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-top: -1px;
}

.collapsible.open .collapsible-content {
  display: block;
  animation: slideDown 0.2s ease-out;
}

/* Quick Styles */
.quick-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.quick-style-btn {
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.quick-style-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

/* Aspect Ratio Grid */
.aspect-ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.aspect-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.aspect-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-secondary);
}

.aspect-btn.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.aspect-preview {
  background: var(--border-color);
  border-radius: 2px;
}

.aspect-preview.square { width: 24px; height: 24px; }
.aspect-preview.wide { width: 32px; height: 18px; }
.aspect-preview.portrait { width: 14px; height: 24px; }
.aspect-preview.standard { width: 28px; height: 21px; }
.aspect-preview.portrait-standard { width: 18px; height: 24px; }
.aspect-preview.photo { width: 30px; height: 20px; }
.aspect-preview.photo-portrait { width: 16px; height: 24px; }
.aspect-preview.cinematic { width: 36px; height: 15px; }

.aspect-btn.active .aspect-preview {
  background: var(--accent-primary);
}

/* Model Buttons */
.model-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.model-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.model-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.model-btn.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-primary);
}

.model-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.model-name {
  font-weight: 600;
  color: var(--text-primary);
}

.model-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.model-btn.active .model-name {
  color: var(--accent-primary);
}

.check-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-primary);
  opacity: 0;
  transition: var(--transition);
}

.model-btn.active .check-icon {
  opacity: 1;
}

/* Thinking Toggle */
.thinking-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.thinking-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.thinking-btn svg {
  width: 18px;
  height: 18px;
}

.thinking-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.thinking-btn.active {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

/* Advanced Parameters */
.param-group {
  margin-bottom: 1rem;
}

.param-group:last-child {
  margin-bottom: 0;
}

.param-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.param-header label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.param-value {
  font-size: 0.875rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.param-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.param-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: var(--shadow-glow);
}

.param-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Count Buttons */
.count-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.count-btn {
  padding: 0.875rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.count-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-primary);
}

.count-btn.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Generate Button */
.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
}

.generate-btn svg {
  width: 20px;
  height: 20px;
}

.generate-btn:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Edit Tab */
.edit-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.edit-placeholder svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.edit-placeholder p {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.edit-placeholder span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.edit-panel {
  padding-top: 1rem;
}

.edit-preview {
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.edit-preview img {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  background: var(--bg-card);
}

.edit-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.edit-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

.edit-action-btn.secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.edit-action-btn.secondary:hover {
  background: var(--bg-card-hover);
  box-shadow: none;
}

.edit-action-btn svg {
  width: 18px;
  height: 18px;
}

/* Templates Tab */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.template-card {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.template-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.template-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.template-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.template-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================
   Results Panel
   ============================ */
.results-panel {
  background: var(--bg-primary);
  padding: 1.5rem;
  overflow-y: auto;
  position: relative;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
}

.clear-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.clear-btn svg {
  width: 16px;
  height: 16px;
}

.clear-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Result Card */
.result-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.result-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.result-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.result-card:hover .result-card-overlay {
  opacity: 1;
}

.result-card-actions {
  display: flex;
  gap: 0.5rem;
}

.card-action-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.card-action-btn:hover {
  background: var(--accent-primary);
}

.card-action-btn svg {
  width: 18px;
  height: 18px;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  text-align: center;
  max-width: 300px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 1rem;
}

.loading-progress {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  transition: width 0.3s ease;
  animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================
   Modal
   ============================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content img {
  max-width: 100%;
  max-height: calc(90vh - 80px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--error);
  border-color: var(--error);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.prompt-assist-content {
  width: min(720px, 92vw);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.prompt-assist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.prompt-assist-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.prompt-assist-body {
  padding: 1rem 1.25rem;
  max-height: 60vh;
  overflow: auto;
}

.prompt-assist-chat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prompt-assist-msg {
  display: flex;
}

.prompt-assist-msg.user {
  justify-content: flex-end;
}

.prompt-assist-bubble {
  max-width: 85%;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: pre-wrap;
}

.prompt-assist-msg.user .prompt-assist-bubble {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.3);
}

.prompt-assist-suggested {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255,255,255,0.12);
}

.prompt-assist-suggested-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.prompt-assist-suggested-text {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: none;
}

.prompt-assist-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 15, 23, 0.5);
}

.prompt-assist-input {
  flex: 1;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.prompt-assist-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.modal-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.modal-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.modal-btn.download-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.card-action-btn.download-btn:hover {
  background: #48bb78;
}

.card-action-btn.edit-btn {
  background: rgba(102, 126, 234, 0.9);
}

.card-action-btn.edit-btn:hover {
  background: #667eea;
}

.modal-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================
   History Panel
   ============================ */
.history-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}

.history-panel.active {
  right: 0;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.history-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.history-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.history-close:hover {
  background: var(--bg-card);
  color: var(--error);
}

.history-close svg {
  width: 20px;
  height: 20px;
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.history-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
}

.history-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.history-item:hover {
  border-color: var(--accent-primary);
}

.history-item-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-prompt {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.history-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.history-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.history-clear-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

.history-clear-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================
   Toast Notifications
   ============================ */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--error);
}

.toast.info {
  border-color: var(--accent-primary);
}

.toast-icon {
  width: 20px;
  height: 20px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.info .toast-icon { color: var(--accent-primary); }

.toast-message {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* ============================
   Responsive Design
   ============================ */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    max-height: none;
  }
  
  .control-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    max-height: none;
  }
  
  .panel-scroll {
    max-height: none;
  }
  
  .results-panel {
    min-height: 60vh;
  }
  
  .history-panel {
    width: 100%;
    right: -100%;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
  
  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .panel-scroll {
    padding: 0 1rem 1rem;
  }
  
  .mode-buttons {
    grid-template-columns: 1fr;
  }
  
  .aspect-ratio-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    max-width: 95vw;
  }
  
  .modal-actions {
    flex-wrap: wrap;
  }
  
  .templates-grid {
    grid-template-columns: 1fr;
  }
  
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* ============================
   Scrollbar Styling
   ============================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

/* ============================
   Main Mode Tabs
   ============================ */
.main-mode-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  overflow-x: visible;
}

.main-mode-tab {
  flex: 1 1 calc(33.333% - 0.25rem);
  min-width: 90px;
  max-width: calc(33.333% - 0.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.main-mode-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.main-mode-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.main-mode-tab.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

/* ============================
   Content Generation UI
   ============================ */
.content-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.content-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.content-type-icon {
  font-size: 1.25rem;
}

.content-type-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.content-type-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

/* Content Input */
.content-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: var(--transition);
}

.content-input::placeholder {
  color: var(--text-muted);
}

.content-input:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

/* Content Select */
.content-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 18px;
  padding-right: 2.5rem;
}

.content-select:focus {
  outline: none;
  border-color: var(--accent-secondary);
}

.content-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Tone Buttons */
.tone-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.tone-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tone-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.tone-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

/* Length Buttons */
.length-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.length-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.65rem 0.35rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.length-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.length-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-secondary);
}

.length-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.length-btn.active .length-label {
  color: var(--accent-secondary);
}

.length-words {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Format Buttons */
.format-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.format-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.format-btn svg {
  width: 18px;
  height: 18px;
}

.format-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.format-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

/* Advanced Options */
.advanced-option {
  margin-bottom: 0.75rem;
}

.advanced-option:last-child {
  margin-bottom: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-secondary);
  cursor: pointer;
}

.checkbox-label:hover {
  color: var(--text-primary);
}

/* Content Generate Button */
.content-generate-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.content-generate-btn:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%);
  box-shadow: var(--shadow-glow-purple);
}

/* Content Templates Grid */
.content-templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.content-template-card {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.content-template-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
}

.template-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.template-badge.seo {
  background: var(--success);
}

.template-badge.product {
  background: var(--accent-tertiary);
}

.template-badge.social {
  background: #ec4899;
}

.template-badge.email {
  background: #3b82f6;
}

.template-badge.meta {
  background: #6366f1;
}

.content-template-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  margin-top: 0.25rem;
}

.content-template-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Content Results */
.content-results {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.content-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.content-empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.content-empty-state p {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.content-empty-state span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.content-output {
  display: none;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.content-output.active {
  display: flex;
}

.content-meta {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.content-meta-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.content-meta-item:last-child {
  margin-bottom: 0;
}

.content-meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-secondary);
  min-width: 100px;
}

.content-meta-value {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.content-body {
  flex: 1;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-y: auto;
}

.content-body h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.content-body h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.content-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.5rem;
}

.content-body p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.content-body ul, .content-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.content-body li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.content-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.content-body em {
  color: var(--accent-secondary);
}

.content-body blockquote {
  margin: 1rem 0;
  padding: 1rem 1.5rem;
  background: rgba(124, 58, 237, 0.1);
  border-left: 4px solid var(--accent-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.content-body code {
  background: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  color: var(--accent-primary);
}

.content-body pre {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1rem 0;
}

.content-body pre code {
  background: none;
  padding: 0;
}

/* Copy Button */
.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent-secondary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: #8b5cf6;
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

/* Responsive for Content */
@media (max-width: 640px) {
  .content-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tone-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .length-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .format-buttons {
    grid-template-columns: 1fr;
  }
  
  .content-templates-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================
   TEXTILE MODULE STYLES
   ============================ */

/* Textile accent color */
:root {
  --textile-accent: #f59e0b;
  --textile-accent-light: #fbbf24;
  --textile-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Garment Type Grid */
.garment-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.garment-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.garment-type-btn:hover {
  background: var(--bg-card);
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.garment-type-btn.active {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

.garment-icon {
  font-size: 1.5rem;
}

/* Textile Actions Grid */
.textile-actions-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 0.5rem;
}

/* Multi-Operation Checkboxes */
.multi-operations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.operation-checkbox {
  cursor: pointer;
}

.operation-checkbox input[type="checkbox"] {
  display: none;
}

.operation-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: var(--transition);
  min-height: 70px;
}

.operation-checkbox:hover .operation-box {
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.operation-checkbox input[type="checkbox"]:checked + .operation-box {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.15);
  color: var(--textile-accent);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.operation-box svg {
  width: 22px;
  height: 22px;
}

.operation-box span {
  font-size: 0.7rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.multi-ops-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ============================
   SERIES TAB STYLES
   ============================ */
.series-count-selector {
  display: flex;
  gap: 0.5rem;
}

.series-count-btn {
  flex: 1;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.series-count-btn:hover {
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.series-count-btn.active {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.15);
  color: var(--textile-accent);
}

.series-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Palette Options */
.palette-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.palette-option {
  cursor: pointer;
}

.palette-option input[type="radio"] {
  display: none;
}

.palette-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-align: center;
}

.palette-option:hover .palette-box {
  border-color: var(--textile-accent);
}

.palette-option input[type="radio"]:checked + .palette-box {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.1);
}

.palette-preview {
  width: 100%;
  height: 24px;
  display: flex;
  gap: 2px;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.palette-preview.auto {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6);
  font-size: 1rem;
}

.palette-preview div {
  flex: 1;
}

.palette-box span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.palette-box small {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Color Change Mode */
.color-mode-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.color-mode-option {
  cursor: pointer;
}

.color-mode-option input[type="radio"] {
  display: none;
}

.color-mode-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-align: center;
}

.color-mode-option:hover .color-mode-box {
  border-color: var(--textile-accent);
}

.color-mode-option input[type="radio"]:checked + .color-mode-box {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.color-mode-preview {
  width: 100%;
  height: 40px;
  display: flex;
  gap: 4px;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.color-mode-preview .main-color {
  flex: 2;
  border-radius: var(--radius-sm);
}

.color-mode-preview .accent-color {
  flex: 1;
  border-radius: var(--radius-sm);
}

.color-mode-preview .accent-color.fixed {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #888;
}

.color-mode-box span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.color-mode-box small {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Series Colors Grid */
.series-colors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.series-color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.series-color-item:hover {
  border-color: var(--textile-accent);
}

.series-color-item input[type="checkbox"] {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.series-color-item:has(input:checked) {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.1);
}

.series-color-item .color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color);
  border: 2px solid rgba(255,255,255,0.2);
  margin-bottom: 0.35rem;
}

.series-color-item[data-color="beyaz"] .color-swatch {
  border: 2px solid var(--border-color);
}

.series-color-item span {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.series-color-item:has(input:checked) span {
  color: var(--textile-accent);
  font-weight: 500;
}

.selected-count {
  font-size: 0.75rem;
  color: var(--textile-accent);
  text-align: center;
  margin-top: 0.5rem;
}

/* Series Result Colors */
.series-item {
  border: 2px solid var(--series-color, var(--border-color)) !important;
}

.series-color-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
}

.original-item {
  border: 2px solid var(--accent-primary) !important;
}

.original-item .angle-item-footer span {
  color: var(--accent-primary);
}

/* ======================= */
/* FIT / PATTERN TAB       */
/* ======================= */

.fit-info-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(249, 115, 22, 0.15));
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.fit-icon {
  font-size: 2rem;
}

.fit-info-text h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.fit-info-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.fit-upload {
  border-color: #ec4899;
}

.fit-upload .upload-placeholder svg {
  stroke: #ec4899;
}

/* Current State Grid */
.current-state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.state-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.state-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.state-options {
  display: flex;
  gap: 0.35rem;
}

.state-option {
  flex: 1;
  cursor: pointer;
}

.state-option input[type="radio"] {
  display: none;
}

.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.25rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  font-size: 0.65rem;
}

.state-option:hover .state-box {
  border-color: #ec4899;
}

.state-option input[type="radio"]:checked + .state-box {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
}

/* Transform Arrow */
.transform-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0;
  color: #ec4899;
}

.transform-arrow svg {
  width: 24px;
  height: 24px;
  animation: bounceDown 1.5s ease-in-out infinite;
}

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

.transform-arrow span {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Target State Grid */
.target-state-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.target-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.target-section-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Target Gender Options */
.target-gender-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.gender-option {
  cursor: pointer;
}

.gender-option input[type="radio"] {
  display: none;
}

.target-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.gender-option:hover .target-box {
  border-color: #ec4899;
}

.gender-option input[type="radio"]:checked + .target-box {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
}

.gender-icon {
  font-size: 1.5rem;
}

.gender-info {
  display: flex;
  flex-direction: column;
}

.gender-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.gender-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Target Fit Options */
.target-fit-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.fit-option {
  cursor: pointer;
}

.fit-option input[type="radio"] {
  display: none;
}

.target-fit-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.4rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.fit-option:hover .target-fit-box {
  border-color: #ec4899;
}

.fit-option input[type="radio"]:checked + .target-fit-box {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
}

/* Fit Visual Shapes */
.fit-visual {
  width: 30px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fit-shape {
  background: linear-gradient(180deg, #ec4899, #f97316);
  border-radius: 2px 2px 4px 4px;
  transition: var(--transition);
}

.fit-visual.oversize .fit-shape {
  width: 28px;
  height: 32px;
  border-radius: 4px;
}

.fit-visual.relaxed .fit-shape {
  width: 24px;
  height: 34px;
  border-radius: 3px;
}

.fit-visual.regular .fit-shape {
  width: 20px;
  height: 36px;
  border-radius: 2px;
}

.fit-visual.slim .fit-shape {
  width: 16px;
  height: 38px;
  border-radius: 2px;
}

.fit-visual.skinny .fit-shape {
  width: 12px;
  height: 40px;
  border-radius: 2px;
}

.fit-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.fit-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
}

.fit-desc {
  font-size: 0.55rem;
  color: var(--text-muted);
}

/* Additional Options */
.fit-additional-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.fit-extra-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.fit-extra-option:hover {
  border-color: #ec4899;
}

.fit-extra-option:has(input:checked) {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.05);
}

.fit-extra-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.fit-extra-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.fit-extra-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Fit Generate Button */
.fit-generate-btn {
  background: linear-gradient(135deg, #ec4899, #f97316) !important;
}

.fit-generate-btn:hover {
  background: linear-gradient(135deg, #db2777, #ea580c) !important;
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.4) !important;
}

/* Fit Examples */
.fit-examples {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(236, 72, 153, 0.05);
  border: 1px dashed rgba(236, 72, 153, 0.3);
  border-radius: var(--radius-md);
}

.fit-examples h5 {
  font-size: 0.8rem;
  color: #ec4899;
  margin-bottom: 0.5rem;
}

.example-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.example-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.example-item .arrow {
  color: #ec4899;
}

.example-item .to {
  color: var(--text-primary);
  font-weight: 500;
}

/* Fit Result Styles */
.fit-result-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.fit-result-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.fit-result-item.result {
  border-color: #ec4899;
}

.fit-result-label {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.fit-result-label.converted {
  background: linear-gradient(135deg, #ec4899, #f97316);
}

.fit-download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 8px 12px;
  background: #ec4899;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.fit-download-btn:hover {
  background: #db2777;
  transform: scale(1.05);
}

/* ======================= */
/* GHOST MANNEQUIN TAB     */
/* ======================= */

.ghost-info-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.ghost-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

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

.ghost-info-text h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.ghost-info-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ghost-upload {
  border-color: #8b5cf6;
}

.ghost-upload .upload-placeholder svg {
  stroke: #8b5cf6;
}

/* Ghost Garment Types */
.ghost-garment-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.ghost-type-option {
  cursor: pointer;
}

.ghost-type-option input[type="radio"] {
  display: none;
}

.ghost-type-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.4rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.ghost-type-option:hover .ghost-type-box {
  border-color: #8b5cf6;
}

.ghost-type-option input[type="radio"]:checked + .ghost-type-box {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
}

.type-emoji {
  font-size: 1.25rem;
}

.ghost-type-box span:last-child {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.ghost-type-option input[type="radio"]:checked + .ghost-type-box span:last-child {
  color: #8b5cf6;
  font-weight: 500;
}

/* Ghost Background Options */
.ghost-bg-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.ghost-bg-option {
  cursor: pointer;
}

.ghost-bg-option input[type="radio"] {
  display: none;
}

.ghost-bg-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-size: 0.7rem;
  font-weight: 500;
}

.ghost-bg-option:hover .ghost-bg-box {
  border-color: #8b5cf6;
}

.ghost-bg-option input[type="radio"]:checked + .ghost-bg-box {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.ghost-bg-box.white {
  background: #ffffff;
  color: #333;
}

.ghost-bg-box.lightgray {
  background: #e5e7eb;
  color: #333;
}

.ghost-bg-box.transparent {
  background: 
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  color: #666;
}

.ghost-bg-box.gradient {
  background: linear-gradient(180deg, #f0f0f0, #d0d0d0);
  color: #333;
}

/* Ghost Options */
.ghost-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.ghost-option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.ghost-option-item:hover {
  border-color: #8b5cf6;
}

.ghost-option-item:has(input:checked) {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.05);
}

.ghost-option-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ghost-option-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.ghost-option-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Ghost Quality Options */
.ghost-quality-options {
  display: flex;
  gap: 0.5rem;
}

.ghost-quality-btn {
  flex: 1;
  padding: 0.6rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.ghost-quality-btn:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.ghost-quality-btn.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

/* Ghost Generate Button */
.ghost-generate-btn {
  background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
}

.ghost-generate-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4) !important;
}

/* Ghost Tips */
.ghost-tips {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(139, 92, 246, 0.05);
  border: 1px dashed rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
}

.ghost-tips h5 {
  font-size: 0.8rem;
  color: #8b5cf6;
  margin-bottom: 0.5rem;
}

.ghost-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ghost-tips li {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.ghost-tips li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #8b5cf6;
}

/* Ghost Result Styles */
.ghost-result-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ghost-result-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.ghost-result-item.result {
  border-color: #8b5cf6;
}

.ghost-result-item img {
  width: 100%;
  height: auto;
  display: block;
}

.ghost-result-label {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.ghost-result-label.ghost {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.ghost-download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 8px 12px;
  background: #8b5cf6;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.ghost-download-btn:hover {
  background: #7c3aed;
  transform: scale(1.05);
}

.ghost-download-btn svg {
  width: 14px;
  height: 14px;
}

/* ======================= */
/* UPSCALE / QUALITY TAB   */
/* ======================= */

.upscale-upload {
  border-color: var(--textile-accent);
}

.upscale-upload .upload-placeholder svg {
  stroke: var(--textile-accent);
}

/* Upscale Generate Button */
.upscale-generate-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
}

.upscale-generate-btn:hover {
  background: linear-gradient(135deg, #d97706, #ea580c) !important;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4) !important;
}

.image-info {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: #fff;
}

/* Resolution Grid */
.resolution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.resolution-option {
  cursor: pointer;
}

.resolution-option input[type="radio"] {
  display: none;
}

.resolution-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-align: center;
  gap: 0.35rem;
}

.resolution-option:hover .resolution-box {
  border-color: var(--textile-accent);
}

.resolution-option input[type="radio"]:checked + .resolution-box {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.resolution-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 50%;
  margin-bottom: 0.25rem;
}

.resolution-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--textile-accent);
}

.resolution-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.resolution-size {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.resolution-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 9999px;
  margin-top: 0.25rem;
}

.resolution-badge.fast {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.resolution-badge.medium {
  background: rgba(245, 158, 11, 0.2);
  color: var(--textile-accent);
}

.resolution-badge.quality {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
}

/* Scale Buttons */
.scale-buttons {
  display: flex;
  gap: 0.5rem;
}

.scale-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.scale-btn:hover {
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

.scale-btn.active {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.15);
  color: var(--textile-accent);
}

.scale-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Enhancement Options */
.enhancement-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.enhancement-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.enhancement-item:hover {
  border-color: var(--textile-accent);
}

.enhancement-item:has(input:checked) {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.05);
}

.enhancement-item input[type="checkbox"] {
  margin-top: 2px;
}

.enhancement-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.enhancement-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.enhancement-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Image Type Grid */
.image-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.image-type-option {
  cursor: pointer;
}

.image-type-option input[type="radio"] {
  display: none;
}

.image-type-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.image-type-option:hover .image-type-box {
  border-color: var(--textile-accent);
}

.image-type-option input[type="radio"]:checked + .image-type-box {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.1);
}

.type-icon {
  font-size: 1.25rem;
}

.image-type-box span:last-child {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.image-type-option input[type="radio"]:checked + .image-type-box span:last-child {
  color: var(--textile-accent);
  font-weight: 500;
}

/* Upscale Results */
.upscale-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.upscale-result-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.upscale-result-item img {
  width: 100%;
  height: auto;
  display: block;
}

.upscale-result-label {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.upscale-result-label.enhanced {
  background: var(--textile-accent);
  color: #000;
}

.upscale-download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 8px 12px;
  background: var(--textile-accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.upscale-download-btn:hover {
  transform: scale(1.05);
}

.upscale-download-btn svg {
  width: 14px;
  height: 14px;
}

/* Resolution Badges */
.upscale-resolution-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.upscale-resolution-badge.original {
  background: rgba(100, 100, 100, 0.8);
  color: #ccc;
}

.upscale-resolution-badge.new {
  background: rgba(34, 197, 94, 0.9);
  color: #000;
}

.enhanced-result {
  border: 2px solid var(--textile-accent) !important;
}

.enhanced-result .upscale-result-label.enhanced {
  background: var(--textile-accent);
}

/* Spinner animation for button */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
  width: 18px;
  height: 18px;
}

/* Preserve Options */
.preserve-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Series Generate Button */
.series-generate-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.series-generate-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

/* ============================
   TEMPLATES TAB STYLES
   ============================ */
.templates-intro {
  text-align: center;
  padding: 1rem 0;
}

.templates-intro h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.templates-intro p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Template Categories */
.template-categories {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.template-category-btn {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.template-category-btn:hover {
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.template-category-btn.active {
  background: var(--textile-accent);
  border-color: var(--textile-accent);
  color: white;
}

/* Templates Grid */
.textile-templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.textile-template-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.textile-template-card:hover {
  border-color: var(--textile-accent);
  transform: translateY(-2px);
}

.textile-template-card.active {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.textile-template-card.hidden {
  display: none;
}

.textile-template-card .template-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.textile-template-card h4 {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.textile-template-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.template-tags span {
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Template Actions */
.template-actions {
  margin-top: 1rem;
  text-align: center;
}

.template-selection-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.template-apply-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.template-apply-btn:disabled {
  background: var(--bg-secondary) !important;
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Legacy textile action btn */
.textile-action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.textile-action-btn:hover {
  background: var(--bg-card);
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.textile-action-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

.textile-action-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Color Change Section */
.color-change-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.color-change-row label {
  flex-shrink: 0;
  width: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.color-input {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.color-text-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
}

.color-text-input:focus {
  outline: none;
  border-color: var(--textile-accent);
}

/* Color Picker from Image */
.color-picker-from-image {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.picker-header span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.picker-mode-toggle {
  display: flex;
  gap: 0.25rem;
}

.picker-mode-btn {
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.picker-mode-btn:hover {
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.picker-mode-btn.active {
  background: var(--textile-accent);
  border-color: var(--textile-accent);
  color: white;
}

.picker-canvas-container {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
  max-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
}

.picker-canvas-container canvas {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.picker-crosshair {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(0,0,0,0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
}

.picked-color-preview {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: none;
}

.picker-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* Color Pairs Container */
.color-pairs-container {
  margin-bottom: 1rem;
}

.color-pairs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.color-pairs-header span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.add-color-pair-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--textile-accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: var(--transition-fast);
}

.add-color-pair-btn:hover {
  background: var(--textile-accent-light);
  transform: scale(1.1);
}

.add-color-pair-btn svg {
  width: 14px;
  height: 14px;
}

.color-pairs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-pair-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
}

.color-pair-item:hover {
  border-color: var(--textile-accent);
}

.color-pair-item.active {
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.color-pair-colors {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.color-pair-source,
.color-pair-target {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
}

.color-pair-source .color-input,
.color-pair-target .color-input {
  width: 32px;
  height: 32px;
}

.color-pair-source .color-text-input,
.color-pair-target .color-text-input {
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
}

.color-pair-arrow {
  color: var(--textile-accent);
  font-size: 1rem;
  font-weight: bold;
  flex-shrink: 0;
}

.remove-pair-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--error);
  border-radius: 50%;
  color: var(--error);
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.remove-pair-btn:hover {
  background: var(--error);
  color: white;
}

.remove-pair-btn svg {
  width: 12px;
  height: 12px;
}

/* Tone Preservation */
.tone-preservation-section {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.tone-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-left: 1.75rem;
  line-height: 1.4;
}

.preset-colors {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.preset-colors span {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 100%;
  margin-bottom: 0.25rem;
}

.preset-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-color-btn:hover {
  transform: scale(1.15);
  border-color: var(--textile-accent);
}

/* Model Change Section */
.model-change-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.model-detail-group {
  margin-bottom: 0.75rem;
}

.model-detail-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.textile-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
}

.textile-select:focus {
  outline: none;
  border-color: var(--textile-accent);
}

/* Term Hints */
.textile-term-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  align-items: center;
}

.hint-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.term-hint-btn {
  padding: 0.25rem 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  color: var(--textile-accent);
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.term-hint-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--textile-accent);
}

/* Logo Operations */
.logo-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.logo-op-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.logo-op-btn:hover {
  background: var(--bg-card);
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.logo-op-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

.logo-op-btn svg {
  width: 24px;
  height: 24px;
}

/* Placement Grid */
.placement-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.placement-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}

.placement-btn:hover {
  background: var(--bg-card);
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.placement-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

.placement-preview {
  width: 32px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
}

.placement-preview::after {
  content: '';
  position: absolute;
  background: var(--textile-accent);
  border-radius: 2px;
}

.placement-preview.chest-left::after {
  width: 8px;
  height: 8px;
  top: 8px;
  left: 4px;
}

.placement-preview.chest-right::after {
  width: 8px;
  height: 8px;
  top: 8px;
  right: 4px;
}

.placement-preview.chest-center::after {
  width: 14px;
  height: 10px;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.placement-preview.back-center::after {
  width: 18px;
  height: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.placement-preview.back-top::after {
  width: 12px;
  height: 6px;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.placement-preview.sleeve::after {
  width: 6px;
  height: 10px;
  top: 12px;
  left: 2px;
}

.placement-preview.pocket::after {
  width: 10px;
  height: 8px;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}

/* Size Buttons */
.size-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.size-btn {
  padding: 0.625rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.size-btn:hover {
  background: var(--bg-card);
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.size-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

/* View Buttons */
.view-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.view-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.view-btn:hover {
  background: var(--bg-card);
  border-color: var(--textile-accent);
  color: var(--text-primary);
}

.view-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

.view-btn svg {
  width: 28px;
  height: 28px;
}

/* Angle & Consistency Options */
.angle-options,
.consistency-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* Textile Generate Buttons */
.textile-generate-btn,
.logo-apply-btn,
.angles-generate-btn {
  background: var(--textile-gradient);
}

.textile-generate-btn:hover,
.logo-apply-btn:hover,
.angles-generate-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: var(--shadow-md), 0 0 30px rgba(245, 158, 11, 0.3);
}

/* Textile Results */
.textile-results {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.textile-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.textile-empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
  opacity: 0.3;
  stroke: var(--textile-accent);
}

.textile-empty-state p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.textile-output {
  padding: 1.5rem;
}

/* Comparison View */
.textile-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.comparison-item {
  text-align: center;
}

.comparison-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.comparison-item img {
  max-width: 280px;
  max-height: 350px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  object-fit: contain;
  background: var(--bg-secondary);
}

.comparison-arrow {
  color: var(--textile-accent);
}

.comparison-arrow svg {
  width: 32px;
  height: 32px;
}

/* Angles Grid */
.textile-angles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.angle-item {
  text-align: center;
  position: relative;
}

.angle-item img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.angle-item:hover img {
  border-color: var(--textile-accent);
}

.angle-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0 0.25rem;
}

.angle-item-footer span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.angle-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--textile-accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

.angle-download-btn:hover {
  background: var(--textile-accent-light);
  transform: scale(1.1);
}

.angle-download-btn svg {
  width: 16px;
  height: 16px;
}

/* Download All Button */
.download-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: var(--textile-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.download-all-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: var(--shadow-md);
}

.download-all-btn svg {
  width: 18px;
  height: 18px;
}

/* Comparison Download Buttons */
.comparison-item {
  text-align: center;
  position: relative;
}

.comparison-download-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--textile-accent);
  border-radius: 50%;
  color: var(--textile-accent);
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
}

.comparison-item:hover .comparison-download-btn {
  opacity: 1;
}

.comparison-download-btn:hover {
  background: var(--textile-accent);
  color: white;
}

.comparison-download-btn svg {
  width: 18px;
  height: 18px;
}

/* Textile Action Buttons (Edit + Download) */
.textile-action-buttons {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: var(--transition);
}

.comparison-item:hover .textile-action-buttons,
.angle-item:hover .textile-action-buttons,
.angle-item:hover .angle-action-buttons,
.upscale-result-item:hover .textile-action-buttons,
.ghost-result-item:hover .textile-action-buttons,
.fit-result-item:hover .textile-action-buttons {
  opacity: 1;
}

.textile-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--textile-accent);
  border-radius: var(--radius-sm);
  color: var(--textile-accent);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.textile-action-btn:hover {
  background: var(--textile-accent);
  color: #000;
}

.textile-action-btn svg {
  width: 14px;
  height: 14px;
}

.textile-action-btn.edit {
  border-color: #00d4ff;
  color: #00d4ff;
}

.textile-action-btn.edit:hover {
  background: #00d4ff;
  color: #000;
}

.textile-action-btn.download {
  border-color: var(--textile-accent);
  color: var(--textile-accent);
}

.textile-action-btn.transparent {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(0, 0, 0, 0.8);
  background-image: 
    linear-gradient(45deg, rgba(34, 197, 94, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(34, 197, 94, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(34, 197, 94, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(34, 197, 94, 0.1) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.textile-action-btn.transparent:hover {
  background: #22c55e;
  color: #000;
  background-image: none;
}

/* Angle Action Buttons */
.angle-action-buttons {
  display: flex;
  gap: 4px;
}

.angle-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--textile-accent);
  border-radius: var(--radius-sm);
  color: var(--textile-accent);
  cursor: pointer;
  transition: var(--transition);
}

.angle-action-btn:hover {
  background: var(--textile-accent);
  color: #000;
}

.angle-action-btn svg {
  width: 14px;
  height: 14px;
}

.angle-action-btn.edit {
  border-color: #00d4ff;
  color: #00d4ff;
}

.angle-action-btn.edit:hover {
  background: #00d4ff;
  color: #000;
}

.angle-action-btn.transparent {
  border-color: #22c55e;
  color: #22c55e;
}

.angle-action-btn.transparent:hover {
  background: #22c55e;
  color: #000;
}

/* Upscale/Ghost/Fit Action Buttons */
.upscale-buttons,
.ghost-buttons,
.fit-buttons {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.upscale-result-item.enhanced-result,
.ghost-result-item.result,
.fit-result-item.result {
  position: relative;
}

/* Logo Upload Area */
.logo-upload {
  border-style: dashed;
  border-color: var(--textile-accent);
  background: rgba(245, 158, 11, 0.05);
}

/* Textile Upload */
.textile-upload {
  min-height: 150px;
}

/* Responsive for Textile */
@media (max-width: 768px) {
  .garment-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .placement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .textile-comparison {
    flex-direction: column;
  }
  
  .comparison-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 480px) {
  .size-buttons,
  .view-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .angle-options,
  .consistency-options {
    grid-template-columns: 1fr;
  }
}

/* ============================
   LOGO MODULE
   ============================ */

/* Logo accent color */
:root {
  --logo-accent: #8b5cf6;
  --logo-accent-hover: #7c3aed;
}

/* Logo Generate Button */
.logo-generate-btn {
  background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
}

.logo-generate-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4) !important;
}

/* Logo Style Grid */
.logo-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.logo-style-option input[type="radio"] {
  display: none;
}

.logo-style-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.logo-style-option input:checked + .logo-style-box {
  border-color: var(--logo-accent);
  background: rgba(139, 92, 246, 0.1);
}

.logo-style-box:hover {
  border-color: var(--border-active);
}

.style-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.style-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.style-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Design Style Grid */
.design-style-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.design-style-btn {
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}

.design-style-btn:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.design-style-btn.active {
  border-color: var(--logo-accent);
  background: rgba(139, 92, 246, 0.15);
  color: var(--logo-accent);
}

/* Color Scheme Options */
.color-scheme-options {
  display: flex;
  gap: 0.5rem;
}

.color-scheme-option input[type="radio"] {
  display: none;
}

.color-scheme-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
}

.color-scheme-option input:checked + .color-scheme-box {
  border-color: var(--logo-accent);
  background: rgba(139, 92, 246, 0.1);
}

.scheme-preview {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.color-scheme-box span:last-child {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Custom Colors */
.custom-colors {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex;
  gap: 1rem;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.color-picker-row label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.color-picker-row input[type="color"] {
  width: 36px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Icon Style Buttons */
.icon-style-buttons,
.font-weight-buttons,
.letter-case-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.icon-style-btn,
.font-style-btn,
.font-weight-btn,
.letter-case-btn {
  padding: 0.4rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.65rem;
  cursor: pointer;
  transition: var(--transition);
}

.icon-style-btn:hover,
.font-style-btn:hover,
.font-weight-btn:hover,
.letter-case-btn:hover {
  border-color: var(--border-active);
}

.icon-style-btn.active,
.font-style-btn.active,
.font-weight-btn.active,
.letter-case-btn.active {
  border-color: var(--logo-accent);
  background: rgba(139, 92, 246, 0.15);
  color: var(--logo-accent);
}

/* Font Style Grid */
.font-style-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Sub Labels */
.sub-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-hint {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.optional-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Icon Keywords */
.icon-keywords {
  margin-bottom: 0.75rem;
}

/* Collapsible Sections */
.collapsible .collapsible-content {
  display: none;
  padding-top: 0.75rem;
}

.collapsible.open .collapsible-content {
  display: block;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.75rem;
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  user-select: none;
}

.collapsible-header:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.collapsible-header .control-label {
  margin: 0;
  pointer-events: none;
  cursor: pointer;
}

.collapse-icon {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  transition: var(--transition);
  pointer-events: none;
  flex-shrink: 0;
}

.collapsible.open .collapse-icon {
  transform: rotate(180deg);
}

/* Advanced Options */
.advanced-option {
  margin-bottom: 0.5rem;
}

.aspect-ratio-option {
  margin-top: 0.75rem;
}

/* Templates Intro */
.templates-intro,
.variations-intro {
  text-align: center;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(139, 92, 246, 0.05);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(139, 92, 246, 0.3);
}

.templates-intro h4,
.variations-intro h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.templates-intro p,
.variations-intro p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Template Categories */
.template-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.template-category-btn {
  padding: 0.35rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.65rem;
  cursor: pointer;
  transition: var(--transition);
}

.template-category-btn:hover {
  border-color: var(--border-active);
}

.template-category-btn.active {
  border-color: var(--logo-accent);
  background: rgba(139, 92, 246, 0.15);
  color: var(--logo-accent);
}

/* Logo Templates Grid */
.logo-templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.logo-template-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.logo-template-card:hover {
  border-color: var(--logo-accent);
  transform: translateY(-2px);
}

.template-preview {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-icon {
  font-size: 2rem;
}

/* Template Gradients */
.tech-gradient { background: linear-gradient(135deg, #00d4ff, #7c3aed); }
.ai-gradient { background: linear-gradient(135deg, #8b5cf6, #06b6d4); }
.saas-gradient { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.business-gradient { background: linear-gradient(135deg, #1e3a5f, #3b82f6); }
.finance-gradient { background: linear-gradient(135deg, #0f172a, #1e40af); }
.law-gradient { background: linear-gradient(135deg, #1f2937, #4b5563); }
.food-gradient { background: linear-gradient(135deg, #f97316, #ef4444); }
.cafe-gradient { background: linear-gradient(135deg, #92400e, #78350f); }
.organic-gradient { background: linear-gradient(135deg, #22c55e, #16a34a); }
.health-gradient { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.wellness-gradient { background: linear-gradient(135deg, #a855f7, #ec4899); }
.fitness-gradient { background: linear-gradient(135deg, #ef4444, #f97316); }
.luxury-gradient { background: linear-gradient(135deg, #1c1917, #78716c); }
.street-gradient { background: linear-gradient(135deg, #dc2626, #000000); }
.jewelry-gradient { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.creative-gradient { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.photo-gradient { background: linear-gradient(135deg, #374151, #111827); }
.music-gradient { background: linear-gradient(135deg, #7c3aed, #db2777); }

.template-info {
  padding: 0.5rem;
  text-align: center;
}

.template-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.template-desc {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Variation Types Grid */
.variation-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.variation-type-option input[type="checkbox"] {
  display: none;
}

.variation-type-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.variation-type-option input:checked + .variation-type-box {
  border-color: var(--logo-accent);
  background: rgba(139, 92, 246, 0.1);
}

.variation-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.variation-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.variation-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Color Variation Options */
.color-variation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Logo Variation Upload */
.logo-variation-upload {
  border-color: var(--logo-accent);
}

.logo-variation-upload .upload-placeholder svg {
  stroke: var(--logo-accent);
}

/* Logo Results Panel */
.logo-results-panel {
  display: none;
}

.logo-results-panel.active {
  display: block;
}

/* Responsive for Logo Module */
@media (max-width: 768px) {
  .logo-style-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .logo-templates-grid {
    grid-template-columns: 1fr;
  }
  
  .variation-types-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================
   Footer
   ============================ */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 380px;
  right: 0;
  background: rgba(15, 15, 23, 0.98);
  border-top: 1px solid var(--border-color);
  padding: 0.6rem 2rem;
  backdrop-filter: blur(20px);
  z-index: 100;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer-content a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-content a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.footer-separator {
  color: var(--border-color);
}

/* Add bottom padding to main content to prevent footer overlap */
.main-content {
  padding-bottom: 60px !important;
}

/* ============================
   Voice Chat Assistant
   ============================ */

/* Floating Button */
.voice-chat-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #00d4ff 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-chat-toggle:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.6);
}

.voice-chat-toggle.active {
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
}

.voice-chat-toggle svg {
  width: 28px;
  height: 28px;
}

/* Voice Chat Panel */
.voice-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 2rem;
  width: 400px;
  max-height: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 998;
}

.voice-chat-panel.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.voice-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(0, 212, 255, 0.1));
}

.voice-chat-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.voice-chat-title svg {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
}

.voice-chat-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.voice-chat-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.voice-chat-close svg {
  width: 20px;
  height: 20px;
}

/* Mode Selector */
.voice-chat-mode {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.voice-chat-mode label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.voice-chat-mode select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.voice-chat-mode select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Messages Container */
.voice-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  min-height: 300px;
  max-height: 400px;
}

.voice-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
}

.voice-chat-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.voice-chat-empty p {
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.voice-chat-empty span {
  font-size: 0.8125rem;
}

/* Message Bubbles */
.voice-message {
  margin-bottom: 1rem;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.voice-message.user {
  text-align: right;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.voice-message.user .message-header {
  justify-content: flex-end;
}

.message-icon {
  font-size: 1rem;
}

.message-type {
  font-size: 0.875rem;
}

.message-content {
  display: inline-block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  max-width: 85%;
  word-wrap: break-word;
  font-size: 0.875rem;
  line-height: 1.5;
}

.voice-message.user .message-content {
  background: linear-gradient(135deg, #7c3aed 0%, #00d4ff 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.voice-message.assistant .message-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.play-audio-btn,
.copy-prompt-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.play-audio-btn:hover,
.copy-prompt-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.play-audio-btn svg,
.copy-prompt-btn svg {
  width: 14px;
  height: 14px;
}

/* Indicators */
.voice-chat-indicators {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  min-height: 50px;
}

.voice-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.voice-indicator.recording {
  color: #ef4444;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Input Area */
.voice-chat-input {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.voice-chat-input textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  resize: none;
  transition: var(--transition);
  margin-bottom: 0.75rem;
}

.voice-chat-input textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.voice-chat-actions {
  display: flex;
  gap: 0.5rem;
}

.voice-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.voice-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.voice-btn svg {
  width: 18px;
  height: 18px;
}

.mic-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #00d4ff 100%);
  color: white;
  border: none;
}

.mic-btn:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #00e5ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.mic-btn.recording {
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
  animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6);
  }
}

.send-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
}

.send-btn:hover {
  background: #8b5cf6;
  transform: translateY(-2px);
}

.clear-btn {
  flex: 0 0 auto;
  padding: 0.75rem;
}

.clear-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
  .voice-chat-panel {
    right: 1rem;
    left: 1rem;
    width: auto;
    bottom: 90px;
  }

  .voice-chat-toggle {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
  }

  .voice-chat-toggle svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 768px) {
  .app-footer {
    left: 0;
    padding: 0.5rem 1rem;
  }
  
  .footer-content {
    font-size: 0.65rem;
    gap: 0.35rem;
  }
  
  .main-content {
    padding-bottom: 50px !important;
  }
}

/* ============================
   Replicate Styles
   ============================ */

/* Categories */
.replicate-categories {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.replicate-category-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.replicate-category-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-primary);
}

.replicate-category-btn.active {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.category-icon {
  font-size: 1.125rem;
}

/* Models Grid */
.replicate-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.replicate-model-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.replicate-model-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.model-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.model-name {
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.model-description {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.model-select-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.model-select-btn:hover {
  background: var(--accent-gradient-hover);
  transform: scale(1.02);
}

.model-select-btn svg {
  width: 14px;
  height: 14px;
}

/* Input Form */
.replicate-input-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
}

.replicate-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.model-guide {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(0, 212, 255, 0.05));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.model-guide h4 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.guide-usage {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.guide-section {
  margin-bottom: 1rem;
}

.guide-section strong {
  color: var(--text-primary);
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.5rem;
}

.guide-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-section li {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.375rem;
  border-radius: var(--radius-sm);
}

.guide-can-do li {
  background: rgba(34, 197, 94, 0.1);
  border-left: 3px solid #22c55e;
}

.guide-watch-out li {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
}

.guide-dont-do li {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

.guide-examples li {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--accent-primary);
}

.guide-examples code {
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
}

.guide-meta {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.guide-meta span {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.form-model-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.form-model-icon {
  font-size: 2rem;
}

.form-model-info h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-model-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.change-model-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: var(--transition);
}

.change-model-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.change-model-btn svg {
  width: 16px;
  height: 16px;
}

.replicate-form-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.replicate-form-inputs .text-input,
.replicate-form-inputs .textarea-input,
.replicate-form-inputs .number-input,
.replicate-form-inputs .select-input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

.replicate-form-inputs .textarea-input {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.replicate-form-inputs .text-input:focus,
.replicate-form-inputs .textarea-input:focus,
.replicate-form-inputs .number-input:focus,
.replicate-form-inputs .select-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.replicate-form-inputs .text-input::placeholder,
.replicate-form-inputs .textarea-input::placeholder {
  color: var(--text-muted);
}

.replicate-form-inputs .select-input {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.replicate-form-inputs .number-input {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}

.replicate-form-inputs .number-input::-webkit-outer-spin-button,
.replicate-form-inputs .number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.replicate-form-inputs .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.replicate-form-inputs .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.replicate-upload {
  min-height: 150px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.replicate-upload:hover {
  border-color: var(--accent-primary);
  background: rgba(124, 58, 237, 0.05);
}

.replicate-upload.drag-over {
  border-color: var(--accent-primary);
  background: rgba(124, 58, 237, 0.1);
}

.replicate-generate-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #00d4ff 100%);
  margin-top: 1.5rem;
}

.replicate-generate-btn:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #00e5ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}

/* Progress */
.replicate-progress {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.progress-status {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Results */
.replicate-results {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.replicate-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 3rem;
  text-align: center;
}

.replicate-empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.replicate-empty-state p {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.replicate-empty-state span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.replicate-output {
  display: none;
  padding: 2rem;
}

#replicateOutputContent {
  max-width: 1000px;
  margin: 0 auto;
}

/* Output types */
.output-image-item {
  margin-bottom: 1.5rem;
}

.output-image-item img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
}

.output-image-item video,
.replicate-output video {
  width: 100%;
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
}

.output-image-item audio,
.replicate-output audio {
  width: 100%;
  margin-bottom: 1rem;
}

.output-text {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.output-text pre {
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.download-output-btn,
.copy-output-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.download-output-btn:hover,
.copy-output-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.no-models {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ============================
   AI Logo Designer Styles
   ============================ */
.ai-designer-intro {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 20px;
  color: white;
}

.ai-designer-intro h4 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
}

.ai-designer-intro p {
  margin: 0;
  font-size: 14px;
  opacity: 0.95;
}

.ai-logo-conversation {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.conversation-welcome {
  text-align: center;
  padding: 40px 20px;
}

.welcome-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.conversation-welcome h3 {
  color: var(--text-primary);
  font-size: 22px;
  margin: 0 0 12px 0;
}

.conversation-welcome p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 24px 0;
}

.start-design-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.start-design-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.start-design-btn svg {
  width: 20px;
  height: 20px;
}

.ai-message, .user-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message {
  flex-direction: row;
}

.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.message-content {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  max-width: 80%;
  border: 1px solid var(--border-color);
}

.user-message .message-content {
  background: linear-gradient(135deg, #f59e0b15 0%, #d9770615 100%);
  border-color: #f59e0b30;
}

.visual-samples-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.loading-samples {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.visual-sample-card {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.visual-sample-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 212, 255, 0.2);
}

.visual-sample-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.sample-label {
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-transform: capitalize;
}

.select-sample-btn {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-sample-btn:hover {
  background: linear-gradient(135deg, #7c8ef0 0%, #8b5cb8 100%);
}

.ai-logo-input-area {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.input-container {
  display: flex;
  gap: 12px;
}

.input-container textarea {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-primary);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.input-container textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.send-response-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.send-response-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.send-response-btn svg {
  width: 18px;
  height: 18px;
}

.ai-logo-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 150px;
  padding: 14px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.approve-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.approve-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(34, 197, 94, 0.3);
}

.revise-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.revise-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
}

.restart-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.restart-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.visual-text-option {
  grid-column: 1/-1;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  margin-top: 8px;
}

.visual-text-option p {
  margin: 0;
  font-style: italic;
}

/* Answers Summary Styles */
.answers-summary {
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  border: 2px solid var(--accent-primary);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-header {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.summary-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.summary-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 100px;
}

.summary-value {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

.edit-answer-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.edit-answer-btn svg {
  width: 16px;
  height: 16px;
}

.edit-answer-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

/* Static Sample Cards */
.static-samples {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.static-sample-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 16px;
  text-align: center;
}

.static-sample-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 212, 255, 0.2);
}

/* Logo Type Cards */
.logo-type-card .static-sample-icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: var(--accent-primary);
}

/* Design Style Cards */
.design-style-card .static-sample-color {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* Typography Cards */
.typography-card .static-sample-typo {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Color Palette Cards */
.color-palette-card .color-palette-display {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  height: 60px;
}

.color-palette-card .color-swatch {
  flex: 1;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

/* Static Sample Text */
.static-sample-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.static-sample-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
  min-height: 32px;
}
