/* ============================================================
   ScriptAI — Dark Luxury Theme (High Contrast Edition)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=DM+Sans:wght@400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --gold:         #d4a853;
  --gold-light:   #f0cc85;
  --gold-dark:    #a07830;
  --gold-glow:    rgba(212, 168, 83, 0.35);

  --bg:           #0d0d0d;
  --bg-card:      #1c1c1e;
  --bg-card2:     #242426;
  --bg-input:     #2a2a2c;

  --text:         #f0ece4;
  --text-muted:   #c8bcac;
  --text-dim:     #8a7e72;

  --border:       #333330;
  --border-gold:  rgba(212, 168, 83, 0.30);

  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-gold:  0 0 24px rgba(212, 168, 83, 0.20);
  --transition:   0.22s ease;
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-sans:    'DM Sans', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.25;
}

p { color: var(--text); }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--bg-card); }
::-webkit-scrollbar-thumb  { background: var(--gold-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 83, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(212, 168, 83, 0.18); }
}
@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.animate-fadeUp { animation: fadeUp 0.4s ease both; }

/* ── Layout ────────────────────────────────────────────────── */
.main-content {
  min-height: calc(100vh - 68px);
  padding: 2rem 0 4rem;
}
.page-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.page-container--wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  background: rgba(13, 13, 13, 0.97) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar-brand {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold) !important;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar-brand .brand-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #0d0d0d;
}
.navbar-brand:hover { color: var(--gold-light) !important; }
.navbar-nav .nav-link {
  color: #c8c0b4 !important;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem !important;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--gold) !important;
  background: rgba(212, 168, 83, 0.10);
}
.navbar-toggler {
  border: 1px solid var(--border-gold);
  padding: 4px 8px;
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28212%2C168%2C83%2C0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Badge gold username in nav */
.badge-gold {
  background: rgba(212, 168, 83, 0.18);
  border: 1px solid rgba(212, 168, 83, 0.35);
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Flash Messages ────────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 9999;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.flash-message {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: fadeUp 0.35s ease both;
}
.flash-success { background: #1a3d28; border-color: #2d7a4a; color: #7fd9a0; }
.flash-error   { background: #3d1a1a; border-color: #7a2d2d; color: #f08080; }
.flash-info    { background: #1a2a3d; border-color: #2d4d7a; color: #80b4f0; }

/* ── Card Glass Effect ─────────────────────────────────────── */
.card-glass {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 83, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}
.card-glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,168,83,0.25), transparent);
  pointer-events: none;
}

/* ── Buttons ───────────────────────────────────────────────── */

/* Primary gold */
.btn-primary-gold,
.btn.btn-primary-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0d0d0d;
  font-weight: 700;
  border: none;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.btn-primary-gold:hover,
.btn.btn-primary-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #0d0d0d;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 168, 83, 0.35);
}

/* Secondary / outline */
.btn-outline-gold,
.btn.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline-gold:hover,
.btn.btn-outline-gold:hover {
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold-light);
}

/* Bootstrap overrides for dark theme */

/* Override Bootstrap 5 CSS custom properties so all BS utilities use our palette */
:root {
  --bs-body-color:        #f0ece4;
  --bs-body-bg:           #0d0d0d;
  --bs-secondary-color:   #c8bcac;
  --bs-tertiary-color:    #8a7e72;
  --bs-emphasis-color:    #ffffff;
  --bs-link-color:        #d4a853;
  --bs-link-hover-color:  #f0cc85;
}

/* Force Bootstrap muted/secondary text to be legible on dark bg */
.text-muted,
.text-secondary,
small,
.small,
p.text-muted,
div.text-muted,
span.text-muted {
  color: #c8bcac !important;
}

/* Badge secondary — dark but legible */
.badge.bg-secondary {
  color: #e0d8cc !important;
}

.btn-outline-secondary {
  color: #c8c0b4 !important;
  border-color: #444440 !important;
  background: transparent !important;
}
.btn-outline-secondary:hover {
  color: var(--text) !important;
  background: #2a2a2c !important;
  border-color: #666660 !important;
}
.btn-outline-danger {
  color: #f08080 !important;
  border-color: #7a3030 !important;
}
.btn-outline-danger:hover {
  background: rgba(192, 57, 43, 0.15) !important;
  color: #ffaaaa !important;
}

/* Small icon button */
.btn-xs {
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  background: rgba(212,168,83,0.12);
  border: 1px solid rgba(212,168,83,0.25);
  color: var(--gold);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-xs:hover {
  background: rgba(212,168,83,0.22);
  color: var(--gold-light);
}

/* Generate CTA button */
.btn-generate {
  background: linear-gradient(135deg, #d4a853, #a07830);
  color: #0d0d0d;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all var(--transition);
  animation: pulse-gold 2.5s infinite;
}
.btn-generate:hover {
  background: linear-gradient(135deg, #f0cc85, #d4a853);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 168, 83, 0.4);
}

/* ── Form Controls ─────────────────────────────────────────── */
.form-control,
.form-select {
  background: var(--bg-input) !important;
  border: 1px solid #3a3a38 !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 0.6rem 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--text-dim) !important; }
.form-control:focus,
.form-select:focus {
  background: #2e2e2c !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15) !important;
  color: var(--text) !important;
  outline: none;
}
.form-label {
  color: #d0c8bc;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  display: block;
}
.form-select option { background: #1c1c1e; color: var(--text); }
.input-group .btn { border-color: #3a3a38 !important; }

/* ── Step Indicator ────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 2px solid #3a3a38;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition);
}
.step-item.active .step-circle {
  background: var(--gold);
  border-color: var(--gold);
  color: #0d0d0d;
  box-shadow: 0 0 16px rgba(212, 168, 83, 0.35);
}
.step-item.completed .step-circle {
  background: rgba(212, 168, 83, 0.2);
  border-color: var(--gold);
  color: var(--gold);
}
.step-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.step-item.active .step-label {
  color: var(--gold);
  font-weight: 600;
}
.step-connector {
  flex: 1;
  height: 2px;
  background: #2e2e2c;
  min-width: 40px;
  max-width: 80px;
  margin: 0 4px;
  margin-bottom: 22px;
  transition: background var(--transition);
}
.step-connector.active { background: var(--gold); }

/* ── Chip Selectors (Genre / Tone) ─────────────────────────── */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip-btn {
  background: var(--bg-card2);
  border: 1px solid #3a3a38;
  color: #c0b8ac;
  padding: 0.42rem 0.9rem;
  border-radius: 50px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.chip-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 168, 83, 0.08);
}
.chip-btn.active {
  background: rgba(212, 168, 83, 0.18);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

/* Genre/tone chips (alias) */
.genre-chip, .tone-chip { /* same as .chip-btn */ }
.genre-chip,
.tone-chip {
  background: var(--bg-card2);
  border: 1px solid #3a3a38;
  color: #c0b8ac;
  padding: 0.42rem 0.9rem;
  border-radius: 50px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.genre-chip:hover,
.tone-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 168, 83, 0.08);
}
.genre-chip.active,
.tone-chip.active {
  background: rgba(212, 168, 83, 0.18);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

/* ── Range Slider ──────────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #3a3a38;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(212, 168, 83, 0.4);
  transition: transform var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* ── Voice Tags ────────────────────────────────────────────── */
.voice-tag {
  display: inline-block;
  background: rgba(212, 168, 83, 0.18);
  border: 1px solid rgba(212, 168, 83, 0.35);
  color: var(--gold-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: monospace;
  white-space: nowrap;
}

/* ── Countdown / Rank Badges ───────────────────────────────── */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.rank-gold {
  background: linear-gradient(135deg, #d4a853, #a07830);
  color: #0d0d0d;
  box-shadow: 0 0 18px rgba(212, 168, 83, 0.5);
}
.rank-silver {
  background: rgba(212, 168, 83, 0.25);
  color: var(--gold-light);
  border: 1px solid rgba(212, 168, 83, 0.4);
}
.rank-bronze {
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 83, 0.22);
}
.rank-normal {
  background: rgba(255,255,255,0.06);
  color: #c0b8ac;
  border: 1px solid #3a3a38;
}
.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212, 168, 83, 0.15);
  border: 1px solid rgba(212, 168, 83, 0.3);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* ── Listicle Detection Badge ──────────────────────────────── */
#listicle-badge {
  background: rgba(212, 168, 83, 0.15);
  border: 1px solid rgba(212, 168, 83, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.92rem;
}

/* ── Script Section Cards ──────────────────────────────────── */
.script-section {
  background: var(--bg-card);
  border: 1px solid #333330;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.section-header:hover { background: rgba(255,255,255,0.03); }
.section-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}
.section-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.section-word-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
  padding-right: 0.5rem;
}
.section-toggle-icon {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform var(--transition);
}
.script-section.open .section-toggle-icon { transform: rotate(180deg); }
.section-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid #2a2a28;
}
.script-section.open .section-body { display: block; }

.narration-text {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
  padding-top: 1rem;
}
.visual-notes-text {
  background: rgba(255,255,255,0.04);
  border: 1px solid #2e2e2c;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: #a09888;
  line-height: 1.6;
}
.script-narration {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
}
.visual-notes {
  background: rgba(255,255,255,0.04);
  border: 1px solid #2e2e2c;
  border-left: 3px solid rgba(212,168,83,0.3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.6rem 0.85rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: #a09888;
}

/* ── Stats Bar ─────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card2);
  border: 1px solid #333330;
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.stat-item {
  flex: 1;
  text-align: center;
  min-width: 80px;
}
.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  font-family: var(--font-sans);
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: #333330;
  flex-shrink: 0;
}

/* ── Result Actions Row ────────────────────────────────────── */
.result-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.result-actions .btn {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}
/* Bootstrap .btn-primary override */
.btn.btn-primary,
button.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
  border: none !important;
  color: #0d0d0d !important;
  font-weight: 700 !important;
}
.btn.btn-primary:hover,
button.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold)) !important;
  color: #0d0d0d !important;
}
.btn.btn-secondary,
button.btn-secondary {
  background: var(--bg-card2) !important;
  border: 1px solid #3a3a38 !important;
  color: var(--text) !important;
  font-weight: 500 !important;
}
.btn.btn-secondary:hover,
button.btn-secondary:hover {
  background: #2e2e2c !important;
  border-color: #555550 !important;
  color: var(--text) !important;
}

/* ── Custom Tabs ───────────────────────────────────────────── */
.custom-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-card2);
  border: 1px solid #333330;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.custom-tab {
  flex: 1;
  text-align: center;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  min-width: fit-content;
}
.custom-tab:hover { color: var(--text); }
.custom-tab.active {
  background: rgba(212, 168, 83, 0.18);
  color: var(--gold-light);
}

/* ── Typing Dots (Loading) ─────────────────────────────────── */
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  display: inline-block;
  animation: typingDot 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── Loading Overlay ───────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}
.loading-overlay .loading-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}

/* ── Voice Select Wrapper ──────────────────────────────────── */
.voice-select-wrapper { position: relative; }
.voice-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(212, 168, 83, 0.08);
  border: 1px solid rgba(212, 168, 83, 0.2);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.82rem;
  color: var(--gold);
}
.voice-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ── Summary Card ──────────────────────────────────────────── */
.summary-card {
  background: var(--bg-card2);
  border: 1px solid rgba(212, 168, 83, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #2a2a28;
  font-size: 0.88rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-muted); font-weight: 500; }
.summary-value { color: var(--text); font-weight: 600; }

/* ── Thumbnail cards ───────────────────────────────────────── */
.thumb-card {
  background: var(--bg-card2);
  border: 1px solid #333330;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition);
}
.thumb-card:hover { border-color: var(--gold); }
.thumb-main-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.thumb-sub-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Page title ────────────────────────────────────────────── */
.page-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.page-subtitle {
  font-size: 1rem;
  color: #a09888;
}
.gold-shimmer {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ── Toast container ───────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 340px;
}
.toast {
  border-radius: var(--radius-sm) !important;
  font-size: 0.88rem !important;
}
.toast.bg-success { background: #1a3d28 !important; color: #7fd9a0 !important; border: 1px solid #2d7a4a !important; }
.toast.bg-danger  { background: #3d1a1a !important; color: #f08080 !important; border: 1px solid #7a2d2d !important; }
.toast.bg-secondary { background: var(--bg-card2) !important; color: var(--text) !important; border: 1px solid #3a3a38 !important; }

/* ── Bootstrap badge overrides ─────────────────────────────── */
.badge.bg-secondary {
  background: #2e2e2c !important;
  color: #c8c0b4 !important;
  font-weight: 600;
}
.badge {
  font-family: var(--font-sans);
}

/* ── Viral items ───────────────────────────────────────────── */
.viral-item {
  background: var(--bg-card2);
  border: 1px solid #333330;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
  cursor: default;
}
.viral-item:hover { border-color: rgba(212, 168, 83, 0.3); }

/* ── Short cards ───────────────────────────────────────────── */
.short-card { transition: transform var(--transition); }
.short-card:hover { transform: translateY(-2px); }

/* ── Accordion Bootstrap overrides ────────────────────────── */
.accordion-button {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  font-weight: 600;
}
.accordion-button:not(.collapsed) {
  background: rgba(212, 168, 83, 0.08) !important;
  color: var(--gold-light) !important;
}
.accordion-button::after {
  filter: invert(80%) sepia(20%) saturate(400%) hue-rotate(10deg);
}
.accordion-item {
  background: var(--bg-card) !important;
  border-color: #333330 !important;
}
.accordion-body {
  background: var(--bg-card) !important;
  color: var(--text) !important;
}

/* ── Alert overrides ───────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm) !important;
  font-size: 0.9rem;
}
.alert-danger {
  background: rgba(192, 57, 43, 0.15) !important;
  border-color: rgba(192, 57, 43, 0.4) !important;
  color: #f08080 !important;
}
.alert-success {
  background: rgba(39, 174, 96, 0.15) !important;
  border-color: rgba(39, 174, 96, 0.4) !important;
  color: #6fcf97 !important;
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination .page-link {
  background: var(--bg-card2) !important;
  border-color: #333330 !important;
  color: var(--text-muted) !important;
}
.pagination .page-link:hover {
  background: rgba(212, 168, 83, 0.12) !important;
  color: var(--gold) !important;
}
.pagination .page-item.active .page-link {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #0d0d0d !important;
  font-weight: 700 !important;
}

/* ── HR divider ────────────────────────────────────────────── */
hr, .divider {
  border-color: #2e2e2c !important;
  opacity: 1 !important;
}

/* ── Code ──────────────────────────────────────────────────── */
code {
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ── Section label ─────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.required { color: #f08080; }
.field-error { color: #f08080; font-size: 0.82rem; }

/* ── Pre / description text ────────────────────────────────── */
pre {
  font-family: var(--font-sans) !important;
  color: var(--text) !important;
  font-size: 0.9rem;
  line-height: 1.75;
}

/* ── Dashboard script cards ────────────────────────────────── */
.script-card-wrap .card-glass {
  transition: border-color var(--transition), transform var(--transition);
}
.script-card-wrap .card-glass:hover {
  border-color: rgba(212, 168, 83, 0.35);
  transform: translateY(-2px);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-title { font-size: 1.65rem; }
  .stats-bar { gap: 0.5rem; }
  .stat-divider { display: none; }
  .stat-item { min-width: 70px; }
  .step-connector { min-width: 20px; max-width: 40px; }
  .result-actions { gap: 0.4rem; }
  .result-actions .btn { font-size: 0.78rem; padding: 0.45rem 0.7rem; }
  .card-glass { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .main-content { padding: 1rem 0 3rem; }
  .step-label { display: none; }
  .custom-tabs { gap: 0; }
  .custom-tab { font-size: 0.78rem; padding: 0.4rem 0.5rem; }
}
