/* MyAwesomeNovelz AI — Base Reset, Body, Utility Classes & Scrollbar */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-darker);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--theme-transition);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES — Phase 2 Design System
   Replace inline styles with reusable, themeable classes
   ═══════════════════════════════════════════════════════════════ */

/* Layout Utilities — Enhanced Breathing Room & Spacing & Zoom-Safe Wrap */
.grid-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; min-width: 0; }
.grid-3col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; min-width: 0; }
.grid-4col { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; min-width: 0; }
.grid-auto-fill { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; min-width: 0; }
.grid-split-360 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; min-width: 0; }
.flex-center { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-width: 0; max-width: 100%; }
.flex-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.gap-xs { gap: 6px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }
.w-full { width: 100%; min-width: 0; }

/* Typography Utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-hero { font-size: var(--text-hero); }
.text-caption { font-size: var(--text-xs); color: var(--text-muted); }
.text-label { font-size: var(--text-sm); color: var(--text-muted); margin-top: 4px; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-light); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.heading-bold { font-family: var(--font-heading); font-weight: 800; }
.heading-section { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-lg); }
.heading-card { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-base); }
.font-heading { font-family: var(--font-heading); }
.font-code { font-family: var(--font-code); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* Card Utilities */
.highlight-card {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 16px;
}
.highlight-card--cyan {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.3);
}
.highlight-card--pink {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.3);
}
.highlight-card--danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--theme-transition);
}

/* Pill & Badge Utilities */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.pill:hover, .pill.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--border-accent);
  color: var(--primary-light);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot--success { background: var(--color-success); }
.status-dot--danger { background: var(--color-danger); }
.status-dot--warning { background: var(--color-warning); }

/* Vendor Color Utilities */
.text-nvidia { color: var(--color-nvidia); }
.text-google { color: var(--color-google); }
.text-yandex { color: var(--color-yandex); }
.text-sber { color: var(--color-sber); }
.text-telegram { color: var(--color-telegram); }
.border-nvidia { border-color: var(--color-nvidia); }
.border-google { border-color: var(--color-google); }
.border-yandex { border-color: var(--color-yandex); }
.bg-nvidia-soft { background: rgba(118, 185, 0, 0.1); }
.bg-google-soft { background: rgba(66, 133, 244, 0.1); }
.bg-yandex-soft { background: rgba(255, 204, 0, 0.1); }

/* Progress Modal Overlay */
.progress-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 10, 16, 0.94);
  backdrop-filter: blur(12px);
}
.progress-modal-box {
  text-align: center;
  max-width: 480px;
  width: 90%;
}
.progress-modal-icon {
  font-size: var(--text-hero);
  margin-bottom: 16px;
  display: block;
}
.progress-modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text-main);
}
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--color-google), var(--accent-pink), var(--primary));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-step-text {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--primary-light);
}
.progress-step-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 8px;
}

/* Spacing Utilities */
.mt-sm { margin-top: 4px; }
.mt-md { margin-top: 8px; }
.mt-lg { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 14px; }
.mb-lg { margin-bottom: 20px; }
.p-sm { padding: 8px; }
.p-md { padding: 12px; }
.p-lg { padding: 16px; }


::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 12, 20, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* SVG Icon System */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon svg {
  color: currentColor;
  transition: color 0.2s ease;
}
.sidebar-icon svg {
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.sidebar-item:hover .sidebar-icon svg,
.sidebar-item.active .sidebar-icon svg {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   SEMANTIC COMPONENT CLASSES — Phase 2 Anti-Slop System
   Resolves inline style clutter with clean, themeable CSS classes
   ═══════════════════════════════════════════════════════════════ */

/* 1. Stat Card (.stat-card) */
.stat-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  padding: 10px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.stat-card-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-light);
}
.stat-card-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 2. Setting Row (.setting-row) */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  gap: 16px;
  margin-bottom: 10px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.setting-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-accent);
}
.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.setting-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}
.setting-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* 3. Media Preview Card (.media-preview-card) */
.media-preview-card {
  background: #040508;
  padding: 16px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md, 12px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.media-viewport-container {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

/* 4. Code Output Card (.code-output-card) */
.code-output-card {
  background: rgba(4, 5, 8, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  font-family: var(--font-code, monospace);
  font-size: 0.82rem;
  color: var(--accent-emerald);
  position: relative;
  max-height: 240px;
  overflow-y: auto;
}

/* 5. Preset Chip (.preset-chip) */
.preset-chip {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.preset-chip:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.07);
}
.preset-chip.active {
  border-color: var(--domain-current, var(--primary-light));
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-light);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

