/* =====================================================================
   Quranic Video Maker — Islamic Theme + Modern Android Material
   ===================================================================== */

/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  /* Islamic Gold Palette */
  --gold-100: #fef9e7;
  --gold-200: #fde68a;
  --gold-300: #f6c94e;
  --gold-400: #c9a84c;
  --gold-500: #a07830;
  --gold-600: #7c5a0a;

  /* Deep Night Sky */
  --bg-900: #060a18;
  --bg-800: #0a0f24;
  --bg-700: #0f1530;
  --bg-600: #141c3a;
  --bg-500: #1c2650;
  --bg-400: #252f5c;

  /* Surface cards */
  --surface-1: rgba(20, 28, 58, 0.95);
  --surface-2: rgba(26, 36, 72, 0.90);
  --surface-3: rgba(37, 47, 92, 0.85);

  /* Text */
  --text-primary: #f0ead6;
  --text-secondary: #b8a870;
  --text-muted: #7a7090;

  /* Accent Islamic Green */
  --green-400: #34c97a;
  --green-500: #22a862;
  --green-600: #177545;

  /* Status */
  --success: #34c97a;
  --error: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-gold: 0 0 20px rgba(201, 168, 76, 0.25);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 8px 40px rgba(0, 0, 0, 0.7);

  /* Transitions */
  --trans-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-med: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg-900);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Islamic geometric background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 0% 50%, rgba(52,201,122,0.04) 0%, transparent 50%),
    radial-gradient(ellipse 50% 80% at 100% 50%, rgba(100,130,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

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

/* ── Typography ─────────────────────────────────────────────────────── */
.font-cinzel { font-family: 'Cinzel', serif; }
.font-playfair { font-family: 'Playfair Display', serif; }

/* ── App Shell ──────────────────────────────────────────────────────── */
#root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Top App Bar ─────────────────────────────────────────────────────── */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 10, 24, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  padding: env(safe-area-inset-top, 0) 16px 0;
}

.app-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--bg-600), var(--bg-500));
  border: 2px solid rgba(201,168,76,0.6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(201,168,76,0.2);
}

.app-logo-icon img, .app-logo-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.app-title-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-300);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.app-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Connection badge ─────────────────────────────────────── */
.conn-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--trans-fast);
}
.conn-badge.online {
  background: rgba(52, 201, 122, 0.12);
  border-color: rgba(52, 201, 122, 0.3);
  color: var(--success);
}
.conn-badge.offline {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--error);
}
.conn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.conn-badge.online .conn-dot { animation: pulse-dot 2s ease infinite; }
.conn-label { font-size: 11px; }

/* On mobile: show only the dot, hide the label text */
@media (max-width: 480px) {
  .conn-badge {
    padding: 4px 6px;
    background: transparent !important;
    border-color: transparent !important;
  }
  .conn-dot {
    width: 10px; height: 10px;
  }
  .conn-label { display: none; }
  .app-title { font-size: 14px; }
  .app-subtitle { font-size: 10px; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* ── Icon Button ───────────────────────────────────────────────────── */
.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: var(--trans-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.icon-btn:hover { background: var(--surface-3); color: var(--gold-300); border-color: rgba(201,168,76,0.4); }
.icon-btn:active { transform: scale(0.93); }

/* ── Step Progress Bar ──────────────────────────────────────────────── */
.step-bar-wrap {
  background: var(--bg-800);
  border-bottom: 1px solid rgba(201,168,76,0.08);
  padding: 12px 16px;
  position: sticky;
  top: 60px;
  z-index: 90;
  backdrop-filter: blur(10px);
}

.step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.step-bar::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--bg-500);
  transform: translateY(-50%);
  z-index: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
  z-index: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-600);
  border: 2px solid var(--bg-400);
  color: var(--text-muted);
  transition: var(--trans-med);
  position: relative;
}

.step-item.active .step-circle {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  border-color: var(--gold-300);
  color: var(--bg-900);
  box-shadow: 0 0 16px rgba(201,168,76,0.4);
}

.step-item.done .step-circle {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  border-color: var(--green-400);
  color: white;
}

.step-item.done .step-circle::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
}

.step-item.done .step-circle span { opacity: 0; }

.step-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--gold-300); }
.step-item.done .step-label { color: var(--green-400); }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--bg-400);
  transition: var(--trans-med);
  margin-bottom: 18px;
  z-index: 0;
}
.step-connector.done { background: var(--green-500); }
.step-connector.active { background: linear-gradient(90deg, var(--green-500), var(--gold-400)); }

/* ── Main Content ───────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 16px 100px;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--trans-med);
  position: relative;
  overflow: hidden;
}

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

.card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  box-shadow: var(--shadow-gold);
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  width: 24px; height: 24px;
  background: rgba(201,168,76,0.12);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--gold-400);
  flex-shrink: 0;
}

.card-title-icon {
  width: 24px; height: 24px;
  background: rgba(201,168,76,0.12);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--gold-400);
  flex-shrink: 0;
  margin-right: 0;
}

/* ── Section Label ──────────────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(201,168,76,0.1);
}

/* ── Form Elements ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-700);
  border: 1.5px solid rgba(201,168,76,0.15);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--trans-fast);
  outline: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(201,168,76,0.5);
  background: var(--bg-600);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a84c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

/* ── Sliders ────────────────────────────────────────────────────────── */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-wrap span {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-300);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-500);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(201,168,76,0.4);
  transition: var(--trans-fast);
  border: 2px solid rgba(255,255,255,0.2);
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(201,168,76,0.15);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--trans-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  white-space: nowrap;
  letter-spacing: 0.02em;
  outline: none;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--bg-900);
  box-shadow: 0 4px 15px rgba(201,168,76,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  box-shadow: 0 6px 20px rgba(201,168,76,0.45);
  transform: translateY(-1px);
}

.btn-gold-outline {
  background: transparent;
  border: 1.5px solid rgba(201,168,76,0.5);
  color: var(--gold-300);
}
.btn-gold-outline:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold-300);
}

.btn-green {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  box-shadow: 0 4px 15px rgba(52,201,122,0.3);
}
.btn-green:hover {
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  box-shadow: 0 6px 20px rgba(52,201,122,0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.btn-danger {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--error);
}
.btn-danger:hover {
  background: rgba(248,113,113,0.2);
  border-color: var(--error);
}

.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-xs { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* Spinning icon for loading buttons */
.btn .fa-spinner { animation: spin 1s linear infinite; }

/* ── Toggle Switch ──────────────────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

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

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
  margin-left: 12px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: var(--bg-500);
  cursor: pointer;
  transition: var(--trans-med);
  border: 1.5px solid transparent;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--trans-med);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(201,168,76,0.2);
  border-color: var(--gold-400);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
  background: var(--gold-400);
  box-shadow: 0 0 8px rgba(201,168,76,0.5);
}

/* ── Audio Effect Cards ─────────────────────────────────────────────── */
.effect-card {
  background: var(--bg-700);
  border: 1.5px solid rgba(201,168,76,0.1);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: var(--trans-med);
}

.effect-card.active {
  background: rgba(201,168,76,0.07);
  border-color: rgba(201,168,76,0.35);
  box-shadow: 0 0 12px rgba(201,168,76,0.1);
}

.effect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.effect-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.effect-name .badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-new { background: rgba(52,201,122,0.2); color: var(--success); }
.badge-pro { background: rgba(201,168,76,0.2); color: var(--gold-300); }

.effect-body {
  margin-top: 12px;
  display: none;
}
.effect-card.active .effect-body { display: block; }

.effect-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.preset-btn {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-600);
  border: 1.5px solid rgba(201,168,76,0.1);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--trans-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.preset-btn:hover, .preset-btn.selected {
  background: rgba(201,168,76,0.15);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.preset-btn .preset-icon {
  display: block;
  font-size: 16px;
  margin-bottom: 3px;
}

/* ── Verse Rows ─────────────────────────────────────────────────────── */
.verse-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-700);
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--trans-fast);
}

.verse-row:hover {
  border-color: rgba(201,168,76,0.2);
  background: var(--bg-600);
}

.verse-num {
  min-width: 28px; height: 28px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-300);
  font-family: 'Cinzel', serif;
  flex-shrink: 0;
}

.verse-content { flex: 1; min-width: 0; }

.verse-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 4px;
}

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

.verse-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-ready { color: var(--success); }
.status-ready .status-dot { background: var(--success); animation: pulse-dot 2s ease infinite; }
.status-pending { color: var(--text-muted); }
.status-pending .status-dot { background: var(--text-muted); }
.status-error { color: var(--error); }
.status-error .status-dot { background: var(--error); }
.status-loading { color: var(--warning); }
.status-loading .status-dot { background: var(--warning); animation: spin 1s linear infinite; border-radius: 0; }

/* ── BG Video Grid ──────────────────────────────────────────────────── */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 480px) {
  .bg-grid { grid-template-columns: repeat(2, 1fr); }
}

.bg-thumb {
  position: relative;
  aspect-ratio: 9/16;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--trans-fast);
  background: var(--bg-700);
}

.bg-thumb:hover, .bg-thumb.selected {
  border-color: var(--gold-400);
  box-shadow: 0 0 12px rgba(201,168,76,0.3);
}

.bg-thumb img, .bg-thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
}

.bg-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
  opacity: 0;
  transition: var(--trans-fast);
}

.bg-thumb:hover .bg-thumb-overlay { opacity: 1; }

.bg-thumb.selected .bg-thumb-overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(201,168,76,0.5) 0%, transparent 60%);
}

.bg-thumb-info {
  font-size: 10px;
  color: white;
  font-weight: 600;
}

.bg-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  background: var(--gold-400);
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--bg-900);
  font-weight: 900;
}

.bg-thumb.selected .bg-check { display: flex; }

/* ── Verse BG Row (Step 2) ──────────────────────────────────────────── */
.verse-bg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-700);
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.verse-bg-thumb {
  width: 52px; height: 92px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-600);
  flex-shrink: 0;
  border: 1.5px solid rgba(201,168,76,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  position: relative;
}

.verse-bg-thumb img { width: 100%; height: 100%; object-fit: cover; }

.verse-bg-info { flex: 1; min-width: 0; }

.verse-bg-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 4px;
}

.verse-bg-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.verse-bg-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* ── Preview Canvas ─────────────────────────────────────────────────── */
.preview-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.preview-canvas {
  width: 160px;
  aspect-ratio: 9/16;
  border-radius: var(--radius-md);
  border: 2px solid rgba(201,168,76,0.3);
  image-rendering: pixelated;
  box-shadow: var(--shadow-gold);
}

/* ── Generate Button ─────────────────────────────────────────────────── */
.generate-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #7c5a0a, var(--gold-400), var(--gold-300));
  background-size: 200% 200%;
  border-radius: var(--radius-xl);
  font-size: 15px;
  font-weight: 800;
  font-family: 'Cinzel', serif;
  color: var(--bg-900);
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: var(--trans-med);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(201,168,76,0.35);
  animation: shimmer-bg 4s ease infinite;
  text-transform: uppercase;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(201,168,76,0.5);
}

.generate-btn:active { transform: scale(0.97); }

@keyframes shimmer-bg {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── Progress Bar ───────────────────────────────────────────────────── */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-500);
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400), var(--gold-300));
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 20px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: progress-shine 1.5s ease infinite;
}

@keyframes progress-shine {
  0% { opacity: 0; transform: translateX(-100%); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%); }
}

/* ── Video Result Card ──────────────────────────────────────────────── */
.video-result {
  background: var(--bg-700);
  border: 2px solid rgba(52,201,122,0.3);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.video-result video {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9/16;
  border-radius: var(--radius-md);
  background: var(--bg-900);
  border: 2px solid rgba(52,201,122,0.3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

@media (max-width: 480px) {
  .video-result video {
    max-width: 100%;
  }
}

/* ── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.modal {
  background: var(--bg-800);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 600px) {
  .modal {
    border-radius: var(--radius-xl);
    max-height: 80vh;
  }
}

.modal-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 12px auto 0;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  position: sticky;
  top: 0;
  background: var(--bg-800);
  z-index: 1;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-300);
  letter-spacing: 0.05em;
}

.modal-body {
  padding: 16px 20px 20px;
}

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(calc(100vw - 32px), 380px);
}

.toast {
  background: var(--bg-600);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUpFade 0.25s ease;
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  width: 100%;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

/* ── Bottom Navigation ──────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 80;
  background: rgba(6,10,24,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(201,168,76,0.12);
  padding: 8px 16px env(safe-area-inset-bottom, 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-btn-wrap {
  flex: 1;
}

/* ── Islamic Ornament Divider ───────────────────────────────────────── */
.ornament-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: rgba(201,168,76,0.3);
  font-size: 14px;
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.25), transparent);
}

/* ── Search Tags ────────────────────────────────────────────────────── */
.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tag {
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-600);
  border: 1px solid rgba(201,168,76,0.15);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--trans-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tag:hover, .tag.active {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

/* ── Highlight Chip ─────────────────────────────────────────────────── */
.highlight-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold-300);
}

/* ── Loading Skeleton ───────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-600) 25%, var(--bg-500) 50%, var(--bg-600) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Gold separator ─────────────────────────────────────────────────── */
.gold-sep {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(201,168,76,0.4) 20%, rgba(201,168,76,0.4) 80%, transparent 100%);
  margin: 14px 0;
}

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

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

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

@keyframes fadeInUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

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

.animate-in { animation: fadeInUp 0.3s ease; }
.animate-fade { animation: fadeIn 0.3s ease; }

/* ── Hint/Helper text ───────────────────────────────────────────────── */
.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.hint a { color: var(--gold-400); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

/* ── Alert / Info box ───────────────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-info {
  background: rgba(96,165,250,0.08);
  border: 1px solid rgba(96,165,250,0.2);
  color: #93c5fd;
}

.alert-success {
  background: rgba(52,201,122,0.08);
  border: 1px solid rgba(52,201,122,0.2);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  color: #fde68a;
}

.alert-error {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  color: #fca5a5;
}

/* ── Color Swatch ───────────────────────────────────────────────────── */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 36px; height: 36px;
  border: 2px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--bg-800);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 2px;
  margin-bottom: 14px;
}

.tab-item {
  flex: 1;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--trans-fast);
  -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
  background: rgba(201,168,76,0.12);
  color: var(--gold-300);
  border: 1px solid rgba(201,168,76,0.25);
}

/* ── My Videos list ─────────────────────────────────────────────────── */
.video-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-700);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--trans-fast);
}

.video-card:hover {
  border-color: rgba(201,168,76,0.25);
  background: var(--bg-600);
}

.video-card-thumb {
  width: 48px; height: 84px;
  border-radius: 6px;
  background: var(--bg-900);
  overflow: hidden;
  flex-shrink: 0;
}
.video-card-thumb video { width: 100%; height: 100%; object-fit: cover; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content { padding: 14px 12px 90px; }
  .card { padding: 16px; }
  .btn-lg { font-size: 14px; padding: 13px 22px; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .main-content { padding: 12px 10px 88px; }
  .card { padding: 14px; border-radius: var(--radius-md); }
  .effect-preset-grid { grid-template-columns: repeat(2, 1fr); }
  .app-subtitle { display: none; }
}

@media (prefers-color-scheme: dark) {
  /* Already dark — no changes needed */
}

/* ── Utility ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-1 { gap: 4px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.opacity-50 { opacity: 0.5; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Style Option Buttons ───────────────────────────────────────────── */
.style-option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.style-option {
  padding: 8px 6px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--bg-600);
  border: 1.5px solid rgba(201,168,76,0.1);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans-fast);
  -webkit-tap-highlight-color: transparent;
}

.style-option:hover, .style-option.selected {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.style-option .opt-icon {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

/* ── Font Preview ───────────────────────────────────────────────────── */
.font-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.font-option {
  padding: 12px 10px;
  background: var(--bg-700);
  border: 1.5px solid rgba(201,168,76,0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--trans-fast);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.font-option:hover, .font-option.selected {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold-400);
}

.font-option-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.font-option-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Pexels attribution ─────────────────────────────────────────────── */
.attribution {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px;
}
.attribution a { color: var(--gold-500); text-decoration: none; }

/* ── Step intro header ──────────────────────────────────────────────── */
.step-intro {
  text-align: center;
  margin-bottom: 20px;
}

.step-intro-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,168,76,0.05));
  border: 1.5px solid rgba(201,168,76,0.25);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 12px;
}

.step-intro-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 4px;
}

.step-intro-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   v6.0 New Styles — Advanced Audio Engine + Style Layout + EQ + More
   ═══════════════════════════════════════════════════════════════════ */

/* ── Label value indicator ──────────────────────────────────────────── */
.label-val {
  color: var(--gold-300);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.slider-label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 36px;
}
.slider-label:last-of-type { text-align: right; }

/* ── Effect Section ─────────────────────────────────────────────────── */
.effect-section {
  padding: 10px 0;
}

/* ── EQ Grid ─────────────────────────────────────────────────────────── */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 0;
}

.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.eq-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Vertical range slider */
.eq-slider {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 4px !important;
  height: 100px;
  writing-mode: vertical-lr;
  direction: rtl;
  cursor: pointer;
  background: var(--bg-500);
  border-radius: 2px;
  outline: none;
}

.eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  cursor: pointer;
}

/* Firefox vertical workaround */
@-moz-document url-prefix() {
  .eq-slider { width: 4px; height: 80px; }
}

/* ── Toggle Grid ────────────────────────────────────────────────────── */
.toggle-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Verse Actions (play + status) ─────────────────────────────────── */
.verse-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Style Layout (side-by-side on desktop, stacked on mobile) ──────── */
.style-layout {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 16px;
  align-items: start;
}

.style-controls {
  min-width: 0;
}

.style-preview-panel {
  position: sticky;
  top: 132px;
  z-index: 10;
}

.preview-sticky {
  background: var(--surface-1);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
}

.preview-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
}

.preview-canvas {
  border-radius: var(--radius-md);
  border: 2px solid rgba(201,168,76,0.3);
  box-shadow: var(--shadow-gold);
  display: block;
  max-width: 100%;
}

/* Mobile: stack controls, then preview full-width */
@media (max-width: 640px) {
  .style-layout {
    grid-template-columns: 1fr;
  }
  .style-preview-panel {
    position: static;
    order: -1;
  }
  .preview-canvas-wrap {
    min-height: auto;
  }
  .preview-sticky {
    padding: 10px;
  }
}

/* ── Color Picker Row ───────────────────────────────────────────────── */
.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.color-pick-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-hex {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-family: monospace;
}

/* ── Summary Grid ───────────────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.summary-item {
  padding: 8px 10px;
  background: var(--bg-700);
  border-radius: 10px;
  border: 1px solid rgba(201,168,76,0.08);
}

.summary-key {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.summary-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Flex helpers ───────────────────────────────────────────────────── */
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.p-4 { padding: 16px; }
.mt-1 { margin-top: 4px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }

/* ── BG used badge ──────────────────────────────────────────────────── */
.bg-used-badge {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(248,113,113,0.25);
  color: var(--error);
  font-size: 9px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bg-thumb.used {
  opacity: 0.65;
}

.bg-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

/* ── BG check overlay ───────────────────────────────────────────────── */
.bg-check-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--success);
  font-size: 16px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Audio preview player ───────────────────────────────────────────── */
#audio-preview-player audio {
  border-radius: var(--radius-md);
  outline: none;
}

/* ── Improved preset btn ────────────────────────────────────────────── */
.effect-preset-grid .preset-btn {
  flex-direction: column;
  gap: 2px;
}

.effect-preset-grid .preset-btn span {
  font-size: 18px;
  display: block;
  margin-bottom: 3px;
}

/* ── Responsive fixes ───────────────────────────────────────────────── */
@media (max-width: 380px) {
  .summary-grid { grid-template-columns: 1fr; }
  .color-grid   { grid-template-columns: 1fr; }
  .eq-grid      { gap: 6px; }
}

/* ── Improved BG row cursor ─────────────────────────────────────────── */
.verse-bg-thumb { cursor: pointer; }

/* =====================================================================
   QVM v7.0 — Light/Dark Theme + Islamic Elements + New Components
   ===================================================================== */

/* ── Light Theme Variables ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-900: #f5f0e8;
  --bg-800: #ece5d6;
  --bg-700: #e2d9c4;
  --bg-600: #d8ccb0;
  --bg-500: #c8bc9a;
  --bg-400: #b8a880;

  --surface-1: rgba(255, 251, 242, 0.97);
  --surface-2: rgba(248, 243, 230, 0.95);
  --surface-3: rgba(240, 233, 215, 0.92);

  --text-primary: #1a1205;
  --text-secondary: #5c4a1e;
  --text-muted: #8c7a50;

  --gold-100: #fef9e7;
  --gold-200: #f6c94e;
  --gold-300: #c9881a;
  --gold-400: #a06510;
  --gold-500: #7c4a0a;

  --success: #1a7a40;
  --error: #c0392b;
  --warning: #d4870a;
  --info: #1a5fa0;

  --shadow-gold: 0 0 20px rgba(160, 101, 16, 0.2);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* ── Light theme body and backgrounds ─────────────────────────────── */
[data-theme="light"] body {
  background: var(--bg-900);
  color: var(--text-primary);
}

[data-theme="light"] body::before {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(160,101,16,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 0% 50%, rgba(34,168,98,0.03) 0%, transparent 50%),
    radial-gradient(ellipse 50% 80% at 100% 50%, rgba(100,130,255,0.03) 0%, transparent 50%);
}

[data-theme="light"] .app-bar {
  background: rgba(240, 233, 210, 0.95);
  border-bottom-color: rgba(160, 101, 16, 0.2);
}

[data-theme="light"] .step-bar-wrap {
  background: var(--bg-800);
  border-bottom-color: rgba(160, 101, 16, 0.1);
}

[data-theme="light"] .card {
  background: var(--surface-1);
  border-color: rgba(160, 101, 16, 0.2);
}

[data-theme="light"] .card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), var(--shadow-gold);
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: rgba(255, 251, 240, 0.95);
  border-color: rgba(160, 101, 16, 0.25);
  color: var(--text-primary);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] select::placeholder {
  color: var(--text-muted);
}

[data-theme="light"] .bottom-nav {
  background: rgba(240, 233, 210, 0.97);
  border-top-color: rgba(160, 101, 16, 0.15);
}

[data-theme="light"] .modal { background: var(--surface-1); }
[data-theme="light"] .modal-overlay { background: rgba(26, 18, 5, 0.6); }
[data-theme="light"] .modal-header { border-bottom-color: rgba(160,101,16,0.15); }

[data-theme="light"] .verse-row { background: rgba(248,243,230,0.7); border-color: rgba(160,101,16,0.1); }
[data-theme="light"] .verse-row:hover { background: rgba(255,251,240,0.9); }
[data-theme="light"] .verse-num { background: rgba(160,101,16,0.12); color: var(--gold-400); }

[data-theme="light"] .step-circle { background: var(--bg-600); border-color: var(--bg-400); color: var(--text-secondary); }
[data-theme="light"] .app-subtitle { color: var(--text-muted); }
[data-theme="light"] .icon-btn { background: var(--surface-2); border-color: rgba(160,101,16,0.2); color: var(--text-secondary); }
[data-theme="light"] .icon-btn:hover { background: var(--surface-3); color: var(--gold-400); }

[data-theme="light"] .islamic-top-bar { background: linear-gradient(135deg, #c9881a, #a06510, #7c4a0a); }
[data-theme="light"] .bismillah-bar { background: rgba(240,233,210,0.8); border-color: rgba(160,101,16,0.2); }
[data-theme="light"] .bismillah-text { color: var(--gold-400); text-shadow: 0 1px 4px rgba(160,101,16,0.2); }

[data-theme="light"] .toast { background: var(--surface-1); border-color: rgba(160,101,16,0.2); color: var(--text-primary); box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
[data-theme="light"] .toast.success { border-left-color: var(--success); }
[data-theme="light"] .toast.error { border-left-color: var(--error); }
[data-theme="light"] .toast.warning { border-left-color: var(--warning); }
[data-theme="light"] .toast.info { border-left-color: var(--info); }

[data-theme="light"] .effect-section { border-color: rgba(160,101,16,0.1); }
[data-theme="light"] .gold-sep { background: rgba(160,101,16,0.2); }
[data-theme="light"] .toggle-track { background: var(--bg-500); }
[data-theme="light"] input[type=range]::-webkit-slider-track { background: var(--bg-500); }

[data-theme="light"] .font-option { background: var(--bg-700); border-color: rgba(160,101,16,0.15); }
[data-theme="light"] .font-option:hover { background: var(--bg-600); border-color: rgba(160,101,16,0.3); }
[data-theme="light"] .font-option.selected { background: rgba(160,101,16,0.1); border-color: var(--gold-400); }
[data-theme="light"] .font-option-name { color: var(--text-primary); }
[data-theme="light"] .font-option-label { color: var(--text-muted); }

[data-theme="light"] .video-header-preview { background: rgba(20, 14, 0, 0.65); }
[data-theme="light"] .creator-credit { background: rgba(160,101,16,0.06); border-color: rgba(160,101,16,0.15); }
[data-theme="light"] .summary-item { background: var(--bg-700); border-color: rgba(160,101,16,0.1); }
[data-theme="light"] .summary-key { color: var(--text-muted); }
[data-theme="light"] .summary-val { color: var(--text-primary); }

[data-theme="light"] .hint { color: var(--text-muted); }
[data-theme="light"] .section-label { color: var(--text-secondary); }
[data-theme="light"] .label-val { color: var(--gold-400); }
[data-theme="light"] .step-label { color: var(--text-muted); }
[data-theme="light"] .step-item.active .step-label { color: var(--gold-400); }
[data-theme="light"] .step-item.done .step-label { color: var(--success); }

/* ── Theme Transition Overlay (day/night animation) ─────────────────── */
.theme-anim-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.theme-anim-overlay.dark {
  background: radial-gradient(ellipse at 20% 20%, rgba(6, 10, 30, 0.9) 0%, transparent 70%);
}
.theme-anim-overlay.light {
  background: radial-gradient(ellipse at 80% 10%, rgba(255, 230, 120, 0.8) 0%, transparent 70%);
}

/* ── Islamic Top Bar ─────────────────────────────────────────────────── */
.islamic-top-bar {
  background: linear-gradient(135deg, #0f1530, #1c2650, #0a1020);
  height: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.islamic-top-pattern {
  font-size: 10px;
  color: rgba(201, 168, 76, 0.65);
  letter-spacing: 0.3em;
  white-space: nowrap;
  animation: scrollPattern 20s linear infinite;
  font-family: 'Cinzel', serif;
}
@keyframes scrollPattern {
  0%   { transform: translateX(30%); }
  100% { transform: translateX(-30%); }
}

/* ── Bismillah Bar ──────────────────────────────────────────────────── */
.bismillah-bar {
  text-align: center;
  padding: 8px 16px 6px;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  background: rgba(15, 21, 48, 0.5);
}
[data-theme="light"] .bismillah-bar {
  background: rgba(240, 233, 210, 0.6);
}
.bismillah-text {
  font-size: 22px;
  color: var(--gold-300);
  font-family: 'Scheherazade New', 'Traditional Arabic', serif;
  text-shadow: 0 0 12px rgba(201, 168, 76, 0.4);
  letter-spacing: 0.02em;
}

/* ── Mobile Subtitle FIX ─────────────────────────────────────────────── */
.app-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  display: block !important;  /* Force visible on all screen sizes */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

@media (max-width: 380px) {
  .app-subtitle { font-size: 9px; max-width: 120px; }
  .app-title { font-size: 11px; }
}

/* ── Islamic Ornament Divider ───────────────────────────────────────── */
.islamic-ornament {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px;
  margin: 0 0 4px 0;
  opacity: 0.6;
}
.islamic-ornament span {
  color: var(--gold-400);
  font-size: 14px;
  flex-shrink: 0;
}
.ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  display: block !important;
}

/* ── Video Header Preview (Transparent Islamic Design — matches video output) ── */
.video-header-preview {
  background: rgba(10, 16, 40, 0.72);  /* dark but semi-transparent, shows bg */
  border: 1px solid rgba(232,200,96,0.28);
  border-radius: 10px;
  padding: 16px 22px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
}
.video-header-preview::before {
  /* thin gold separator line below title — centred 58% width */
  content: '';
  position: absolute;
  bottom: 0; left: 21%; right: 21%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(232,200,96,0.85), transparent);
}
.video-header-preview::after {
  content: none;  /* remove top bar — transparent design has no top bar */
}
.video-header-preview.large {
  padding: 20px 26px 24px;
}
/* Line 1: "The Qur'an" — Berkshire Swash bold Islamic script, bright gold with glow */
.vhp-line1 {
  font-family: 'Berkshire Swash', cursive, serif;
  font-size: 28px;
  font-weight: 400;
  color: #e8c860;   /* bright gold matching ASS gold_bright #E8C860 */
  letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(232,200,96,0.70), 0 2px 10px rgba(0,0,0,0.95), 0 0 35px rgba(232,200,96,0.35);
  line-height: 1.2;
}
.video-header-preview.large .vhp-line1 { font-size: 36px; }
/* Line 2: "Surah [Name]" — Great Vibes flowing script, pure white */
.vhp-line2 {
  font-family: 'Great Vibes', cursive, serif;
  font-size: 18px;
  color: #ffffff;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-top: 3px;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0,0,0,0.90), 0 0 12px rgba(255,255,255,0.15);
}
.video-header-preview.large .vhp-line2 { font-size: 23px; }
/* Line 3: ( Verses X - Y ) — small clean serif, white */
.vhp-line3 {
  font-family: 'Liberation Serif', 'Georgia', serif;
  font-size: 11px;
  color: rgba(255,255,255,0.88);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-top: 4px;
  line-height: 1.3;
}
.video-header-preview.large .vhp-line3 { font-size: 13px; }

/* ── Reverb Section (Step 3) ────────────────────────────────────────── */
.reverb-section {
  margin-top: 4px;
}
.badge-browser {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #60a5fa;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 6px;
}

/* ── Audio Preview Section ───────────────────────────────────────────── */
.audio-preview-section {
  margin-top: 4px;
}

/* ── ETA Display ─────────────────────────────────────────────────────── */
.eta-display {
  text-align: center;
  font-size: 12px;
  color: var(--gold-300);
  margin-top: 8px;
  font-weight: 600;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.02em;
  animation: pulse-eta 2s ease-in-out infinite;
}
@keyframes pulse-eta {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── App Creator Credit ──────────────────────────────────────────────── */
.creator-credit {
  margin: 20px 16px 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(201,168,76,0.2);
  background: rgba(201,168,76,0.04);
  text-align: center;
}
.creator-credit-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.creator-credit-inner strong {
  color: var(--gold-300);
}
.creator-islamic-badge {
  color: var(--gold-400);
  font-size: 14px;
  opacity: 0.8;
}

/* ── PWA Install Modal ───────────────────────────────────────────────── */
.install-modal { max-width: 340px; margin: auto; }
.install-prompt-body {
  padding: 24px 20px;
  text-align: center;
}
.install-icon-wrap {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}
.install-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 8px;
}
.install-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.islamic-ornament-sm {
  font-size: 12px;
  color: var(--gold-400);
  letter-spacing: 0.15em;
  margin-top: 8px;
  font-family: 'Cinzel', serif;
}

/* ── Light theme dark overlay for .app-bar on sticky scroll ─────────── */
[data-theme="light"] .step-bar-wrap {
  background: rgba(236, 229, 214, 0.97);
}

/* ── Islamic background geometric pattern (dark) ────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpolygon points='40,2 52,28 80,28 58,46 66,74 40,57 14,74 22,46 0,28 28,28' fill='none' stroke='%23C9A84C' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}
[data-theme="light"] body::after {
  opacity: 0.05;
}

/* ── Font Preview Grid (wider for 14 fonts) ──────────────────────────── */
.font-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
@media (min-width: 480px) {
  .font-preview-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 700px) {
  .font-preview-grid { grid-template-columns: repeat(4, 1fr); }
}

.font-option {
  padding: 10px 8px;
  background: var(--bg-700);
  border: 1.5px solid rgba(201,168,76,0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--trans-fast);
  text-align: center;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.font-option:hover {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.3);
}
.font-option.selected {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold-400);
  box-shadow: 0 0 0 1px var(--gold-400);
}
.font-option-name {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
}
.font-option-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ── Dark Overlay slider hint ────────────────────────────────────────── */
.slider-label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ── Ensure toast visibility in light mode ───────────────────────────── */
[data-theme="light"] .toast {
  background: var(--surface-1);
  border: 1px solid rgba(160,101,16,0.2);
  border-left: 3px solid;
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ── Progress bar improved ───────────────────────────────────────────── */
[data-theme="light"] .progress-bar-wrap {
  background: var(--bg-600);
}
[data-theme="light"] .progress-bar-fill {
  background: linear-gradient(90deg, #a06510, #c9881a, #f6c94e);
}

/* ── Alert boxes light mode ──────────────────────────────────────────── */
[data-theme="light"] .alert-info {
  background: rgba(26,95,160,0.08);
  border-color: rgba(26,95,160,0.2);
  color: #1a5fa0;
}
[data-theme="light"] .alert-warning {
  background: rgba(212,135,10,0.08);
  border-color: rgba(212,135,10,0.2);
  color: #d4870a;
}
[data-theme="light"] .alert-success {
  background: rgba(26,122,64,0.08);
  border-color: rgba(26,122,64,0.2);
  color: #1a7a40;
}

/* ── Verse row light theme ───────────────────────────────────────────── */
[data-theme="light"] .verse-bg-row {
  background: rgba(248,243,230,0.7);
  border-color: rgba(160,101,16,0.1);
}

/* ── Conn badge light mode ───────────────────────────────────────────── */
[data-theme="light"] .conn-badge.online {
  background: rgba(26,122,64,0.1);
  border-color: rgba(26,122,64,0.25);
  color: var(--success);
}
[data-theme="light"] .conn-badge.offline {
  background: rgba(192,57,43,0.1);
  border-color: rgba(192,57,43,0.25);
  color: var(--error);
}

/* ── Tag and highlight chips light ───────────────────────────────────── */
[data-theme="light"] .tag {
  background: rgba(160,101,16,0.1);
  border-color: rgba(160,101,16,0.2);
  color: var(--gold-400);
}
[data-theme="light"] .highlight-chip {
  background: rgba(160,101,16,0.1);
  color: var(--gold-400);
}

/* ── bg-grid light ───────────────────────────────────────────────────── */
[data-theme="light"] .bg-loading { color: var(--text-muted); }

/* ── Step intro light ────────────────────────────────────────────────── */
[data-theme="light"] .step-intro-title { color: var(--text-primary); }
[data-theme="light"] .step-intro-desc { color: var(--text-secondary); }
[data-theme="light"] .step-intro-icon {
  background: rgba(160,101,16,0.08);
  border-color: rgba(160,101,16,0.2);
}
[data-theme="light"] .card-title { color: var(--gold-400); }
[data-theme="light"] .card-title-icon {
  background: rgba(160,101,16,0.1);
  color: var(--gold-400);
}

/* ── Generate button light ───────────────────────────────────────────── */
[data-theme="light"] .generate-btn {
  background: linear-gradient(135deg, #a06510, #c9881a, #a06510);
  box-shadow: 0 8px 32px rgba(160,101,16,0.35);
}
[data-theme="light"] .generate-btn:hover {
  box-shadow: 0 12px 40px rgba(160,101,16,0.5);
}

/* ── Toggle switch light ─────────────────────────────────────────────── */
[data-theme="light"] .toggle-info .toggle-label { color: var(--text-primary); }
[data-theme="light"] .toggle-info .toggle-desc { color: var(--text-muted); }


/* ════════════════════════════════════════════════════════════════════
   v9.0 UI Improvements — Enhanced Cards, Progress, Icons, Mobile
   ════════════════════════════════════════════════════════════════════ */

/* ── App icon in header ─────────────────────────────────────────────── */
.app-logo-icon img {
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* ── Generation progress card ──────────────────────────────────────── */
#gen-progress-card {
  background: linear-gradient(135deg, var(--bg-700), var(--bg-600));
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
}
#gen-msg {
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 20px;
}
.progress-bar-wrap {
  height: 8px;
  background: var(--bg-500);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 6px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c5a0a, var(--gold-400), #fde68a);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  min-width: 2px;
  box-shadow: 0 0 8px rgba(201,168,76,0.4);
}

/* ── Card improvements ─────────────────────────────────────────────── */
.card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.card-title {
  font-size: 12px;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

/* ── Step intro improvements ───────────────────────────────────────── */
.step-intro {
  padding: 8px 0 4px;
}
.step-intro-icon {
  width: 60px; height: 60px;
  font-size: 26px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(201,168,76,0.15);
}
.step-intro-title {
  font-size: 17px;
}
.step-intro-desc {
  font-size: 12px;
  max-width: 280px;
  margin: 0 auto;
}

/* ── Verse status dots ─────────────────────────────────────────────── */
.verse-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.verse-status-dot.ready { background: var(--green-500); box-shadow: 0 0 5px rgba(52,201,122,0.5); }
.verse-status-dot.pending { background: var(--bg-400); }
.verse-status-dot.loading { background: var(--gold-400); animation: pulse-gold 1s ease infinite; }
@keyframes pulse-gold {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Generate button pulse when active ─────────────────────────────── */
.generate-btn:not(:disabled) {
  animation: shimmer-bg 4s ease infinite, subtle-pulse 3s ease infinite;
}
.generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  animation: none;
}
@keyframes subtle-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(201,168,76,0.35); }
  50% { box-shadow: 0 8px 32px rgba(201,168,76,0.55); }
}

/* ── Ayat hint (verse count indicator) ────────────────────────────── */
#ayat-hint {
  font-size: 11px;
  color: var(--gold-400);
  font-weight: 600;
  background: rgba(201,168,76,0.06);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(201,168,76,0.12);
  display: inline-block;
}

/* ── Video result improvements ─────────────────────────────────────── */
.video-result {
  background: linear-gradient(135deg, var(--bg-700), var(--bg-600));
  border-color: rgba(52,201,122,0.4);
  box-shadow: 0 4px 24px rgba(52,201,122,0.12);
}

/* ── Hint text improved ─────────────────────────────────────────────── */
.hint {
  font-size: 11.5px;
}

/* ── Form inputs improved ───────────────────────────────────────────── */
input[type="number"] {
  text-align: center;
  font-weight: 600;
}
input[type="number"]:focus {
  border-color: rgba(201,168,76,0.5);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.1);
}

/* ── Select improved ─────────────────────────────────────────────────── */
select:focus {
  border-color: rgba(201,168,76,0.5);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.1);
}

/* ── Toast improvements ─────────────────────────────────────────────── */
.toast {
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

/* ── Summary card improvements ─────────────────────────────────────── */
.summary-item {
  background: var(--bg-700);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(201,168,76,0.08);
}
.summary-key {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.summary-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Mobile enhancements ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 16px 14px; }
  .card-title { font-size: 11px; }
  .generate-btn { font-size: 14px; padding: 14px 18px; }
  #gen-progress-card { padding: 16px 14px; }
  .step-intro-icon { width: 52px; height: 52px; font-size: 22px; }
  .step-intro-title { font-size: 15px; }
}

/* ── Loading spinner overlay ─────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(6,9,26,0.85);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  backdrop-filter: blur(4px);
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(201,168,76,0.2);
  border-top-color: var(--gold-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Verse list item ─────────────────────────────────────────────────── */
.verse-audio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-700);
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid rgba(201,168,76,0.06);
  transition: border-color 0.2s;
}
.verse-audio-item.ready {
  border-color: rgba(52,201,122,0.2);
  background: rgba(52,201,122,0.04);
}
.verse-audio-item .verse-num {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-400);
  min-width: 24px;
}
.verse-audio-item .verse-text-preview {
  flex: 1;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Light theme improvements ─────────────────────────────────────── */
[data-theme="light"] .card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
[data-theme="light"] #gen-progress-card {
  background: linear-gradient(135deg, rgba(240,233,210,0.5), rgba(255,250,235,0.7));
}
[data-theme="light"] .video-result {
  background: linear-gradient(135deg, rgba(240,255,248,0.8), rgba(255,255,255,0.9));
}
[data-theme="light"] .verse-audio-item {
  background: rgba(240,233,210,0.3);
  border-color: rgba(160,101,16,0.1);
}
[data-theme="light"] .verse-audio-item.ready {
  background: rgba(52,201,122,0.06);
  border-color: rgba(52,201,122,0.2);
}
[data-theme="light"] #ayat-hint {
  background: rgba(160,101,16,0.06);
  border-color: rgba(160,101,16,0.15);
  color: var(--gold-400);
}
