/* ==========================================================================
   THE SACRED VEDAS (चतुर्वेद दर्शनम्) — SPIRITUAL DESIGN SYSTEM & STYLES
   Aesthetics: Divya Surya (Light) & Vedic Shyam (Dark) Themes with Sacred Geometry
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Rozha+One&family=Yatra+One&display=swap');

:root, [data-theme="light"] {
  /* Divya Surya (Light Saffron Gold Theme) */
  --bg-primary: #fffdf7;
  --bg-secondary: #fef8ec;
  --bg-card: rgba(255, 255, 255, 0.95);
  --card-bg: rgba(255, 255, 255, 0.95);
  --bg-card-border: rgba(217, 119, 6, 0.22);
  --border-color: rgba(217, 119, 6, 0.22);
  --bg-card-hover: rgba(254, 243, 199, 0.6);
  --text-primary: #291b07;
  --text-secondary: #604218;
  --text-muted: #8c6a38;
  --sanskrit-color: #78350f;
  --saffron-primary: #ea580c;
  --saffron-bright: #f97316;
  --saffron-light: #ffedd5;
  --gold-primary: #d97706;
  --gold-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #b45309 100%);
  --gold-glow: rgba(245, 158, 11, 0.35);
  --teal-accent: #0284c7;
  --purple-accent: #7c3aed;
  --green-accent: #059669;
  --sacred-red: #dc2626;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 2px 6px rgba(180, 83, 9, 0.05);
  --shadow-md: 0 4px 16px rgba(180, 83, 9, 0.08);
  --shadow-lg: 0 10px 28px rgba(180, 83, 9, 0.14);
  --font-sanskrit: 'Rozha One', 'Yatra One', 'Tiro Devanagari Sanskrit', serif;
  --font-heading: 'Cinzel', 'Outfit', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --header-height: 48px;
}

[data-theme="dark"] {
  /* Vedic Shyam (Midnight Cosmic Indigo Theme) */
  --bg-primary: #060714;
  --bg-secondary: #0c0e24;
  --bg-card: rgba(18, 21, 48, 0.92);
  --card-bg: rgba(18, 21, 48, 0.92);
  --bg-card-border: rgba(245, 158, 11, 0.22);
  --border-color: rgba(245, 158, 11, 0.22);
  --bg-card-hover: rgba(30, 35, 78, 0.95);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --sanskrit-color: #fbbf24;
  --saffron-primary: #f97316;
  --saffron-bright: #fb923c;
  --saffron-light: rgba(249, 115, 22, 0.18);
  --gold-primary: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #d97706 100%);
  --gold-glow: rgba(245, 158, 11, 0.45);
  --teal-accent: #38bdf8;
  --purple-accent: #a78bfa;
  --green-accent: #34d399;
  --sacred-red: #ef4444;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.7);
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(env(safe-area-inset-bottom) + 72px);
}

/* Ambient Spiritual Aura */
.spiritual-aura-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aura-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.15;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

[data-theme="dark"] .aura-orb {
  opacity: 0.22;
}

.orb-gold {
  width: 320px;
  height: 320px;
  background: #f59e0b;
  top: -60px;
  left: 10%;
}

.orb-saffron {
  width: 360px;
  height: 360px;
  background: #ea580c;
  bottom: 10%;
  right: -80px;
  animation-delay: -5s;
}

.orb-indigo {
  width: 380px;
  height: 380px;
  background: #4338ca;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, 20px) scale(1.08); }
  100% { transform: translate(-20px, -15px) scale(0.95); }
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Sacred Header */
.sacred-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-top: 4px;
  margin-bottom: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.om-symbol-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sanskrit);
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 2px 8px var(--gold-glow);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-select {
  appearance: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 5px 24px 5px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  max-width: 130px;
}

.lang-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.lang-icon {
  position: absolute;
  right: 6px;
  pointer-events: none;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.ctrl-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.ctrl-btn:active {
  transform: translateY(0);
}

.om-recital-btn {
  font-family: var(--font-sanskrit);
  font-size: 17px;
  font-weight: bold;
  color: var(--gold-primary);
}

.om-recital-btn.playing {
  background: var(--gold-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 14px var(--gold-glow);
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 8px var(--gold-glow); }
  100% { transform: scale(1.06); box-shadow: 0 0 18px var(--gold-glow); }
}

.mobile-menu-btn {
  display: none;
}

/* Mobile Nav Dropdown */
.mobile-nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 150;
}

.mobile-nav-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: var(--saffron-light);
  color: var(--saffron-primary);
}

/* Desktop Tab Bar */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.tab-btn.active {
  background: var(--gold-gradient);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--gold-glow);
}

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   TAB 1: 4 VEDAS OVERVIEW GRID
   ========================================== */
.vedas-hero-banner {
  text-align: center;
  padding: 16px 12px 20px;
}

.section-hero-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.section-hero-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.5;
}

.vedas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.veda-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.veda-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--veda-color, var(--gold-primary));
}

.veda-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--veda-color, var(--gold-primary));
}

.veda-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.veda-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.veda-title-area h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.veda-name-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.veda-slogan {
  font-size: 12px;
  color: var(--saffron-primary);
  font-weight: 600;
}

.veda-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
}

.stat-pill i {
  width: 12px;
  height: 12px;
}

.veda-desc-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.veda-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  font-size: 11.5px;
}

.veda-meta-item strong {
  display: block;
  color: var(--text-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.veda-layers-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.layer-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1.4;
}

.layer-badge {
  font-weight: 700;
  color: var(--gold-primary);
  background: var(--saffron-light);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  flex-shrink: 0;
}

.veda-card-actions {
  margin-top: auto;
  padding-top: 8px;
}

.veda-explore-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--veda-color, var(--gold-primary));
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.veda-explore-btn:hover {
  background: var(--veda-color, var(--gold-primary));
  color: #fff;
  box-shadow: 0 4px 12px var(--gold-glow);
}

/* ==========================================
   TAB 2: MANTRA READER SANCTUM
   ========================================== */
.mantra-sanctum {
  max-width: 820px;
  margin: 0 auto;
}

.veda-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.veda-filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--gold-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--gold-glow);
}

.holy-mantra-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.card-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  color: var(--gold-primary);
}

[data-theme="dark"] .card-watermark {
  opacity: 0.055;
}

.mantra-card-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 12px;
}

.veda-picker-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.veda-picker-banner:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.banner-left i {
  width: 16px;
  height: 16px;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.banner-title-stack {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}

.banner-main-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--saffron-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-sub-title {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.counter-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: var(--gold-gradient);
  color: #fff;
}

.mantra-meta-chips {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.meta-tags-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.meta-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
}

.meta-chip.chip-accent {
  background: var(--saffron-light);
  color: var(--saffron-primary);
  border-color: rgba(234, 88, 12, 0.3);
}

.meta-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-icon-btn:hover {
  color: var(--saffron-primary);
  border-color: var(--saffron-primary);
  background: var(--bg-card-hover);
}

.action-icon-btn.bookmarked {
  background: var(--saffron-primary);
  color: #fff;
  border-color: transparent;
}

/* Sanskrit Verse */
.sanskrit-verse-block {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px 12px 14px;
}

.sanskrit-text {
  font-family: var(--font-sanskrit);
  font-size: 22px;
  line-height: 1.8;
  color: var(--sanskrit-color);
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: pre-line;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.transliteration-box {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  font-style: italic;
  white-space: pre-line;
  padding: 0 12px 16px;
}

/* Translation */
.translation-box {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.translation-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.translation-label i {
  width: 14px;
  height: 14px;
}

.translation-body {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Mantra Controls (Prev / Recite / Next) */
.mantra-controls-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.nav-arrow-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-arrow-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
}

.chant-audio-btn {
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gold-gradient);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--gold-glow);
  transition: all 0.2s;
}

.chant-audio-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--gold-glow);
}

.chant-audio-btn.playing {
  background: var(--sacred-red);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

/* Accordions */
.accordion-box {
  position: relative;
  z-index: 1;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.accordion-trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.accordion-trigger-left i {
  color: var(--gold-primary);
  width: 16px;
  height: 16px;
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.accordion-box.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-panel {
  display: none;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--bg-card-border);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.accordion-box.open .accordion-panel {
  display: block;
}

.padapatha-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.padapatha-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.5;
}

.pada-word {
  font-weight: 700;
  color: var(--saffron-primary);
  font-family: var(--font-sanskrit);
  font-size: 14px;
}

.pada-meaning {
  color: var(--text-primary);
}

/* Animations for Next/Prev card transitions */
.slide-left {
  transform: translateX(-40px);
  opacity: 0;
}

.slide-right {
  transform: translateX(40px);
  opacity: 0;
}

.slide-in-right {
  animation: slideInRight 0.22s ease-out forwards;
}

.slide-in-left {
  animation: slideInLeft 0.22s ease-out forwards;
}

@keyframes slideInRight {
  from { transform: translateX(35px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-35px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================
   TAB 3: THE 4 MAHAVAKYAS GRID
   ========================================== */
.mahavakyas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mahavakya-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
}

.mahavakya-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-primary);
}

.mv-top-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mv-veda-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--saffron-light);
  color: var(--saffron-primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.mv-type-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.mv-sanskrit {
  font-family: var(--font-sanskrit);
  font-size: 26px;
  color: var(--sanskrit-color);
  line-height: 1.3;
  margin-top: 4px;
}

.mv-translit {
  font-family: var(--font-heading);
  font-size: 15px;
  font-style: italic;
  color: var(--gold-primary);
}

.mv-meaning-box {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.mv-meaning-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.mv-meaning-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.mv-citation-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.mv-wisdom-box {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  border-top: 1px solid var(--bg-card-border);
  padding-top: 8px;
}

.mv-wisdom-box strong {
  display: block;
  font-size: 11px;
  color: var(--gold-primary);
  margin-bottom: 2px;
}

/* ==========================================
   TAB 4: BOOKMARKS / SAVED
   ========================================== */
.bookmarks-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.bookmark-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.bookmark-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-sm);
}

.bookmark-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bookmark-citation-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--saffron-primary);
  background: var(--saffron-light);
  padding: 2px 7px;
  border-radius: 4px;
}

.delete-bookmark-btn {
  background: transparent;
  border: none;
  color: var(--sacred-red);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.delete-bookmark-btn:hover {
  background: rgba(220, 38, 38, 0.1);
}

.bookmark-title {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.bookmark-sanskrit {
  font-family: var(--font-sanskrit);
  font-size: 15px;
  color: var(--sanskrit-color);
  line-height: 1.4;
  margin-bottom: 2px;
}

.bookmark-translit {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.empty-state-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--bg-card-border);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
}

.empty-state-box i {
  width: 44px;
  height: 44px;
  color: var(--gold-primary);
  margin-bottom: 12px;
}

.empty-state-box h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-box p {
  font-size: 13.5px;
  max-width: 400px;
  margin: 0 auto;
}

/* ==========================================
   QUICK MATRIX MODAL (1-Click Jump)
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.matrix-modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 82vh;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .matrix-modal-card {
  transform: scale(1);
}

.matrix-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bg-card-border);
  background: var(--bg-secondary);
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-primary);
}

.modal-title-box h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.matrix-modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.modal-tabs::-webkit-scrollbar {
  display: none;
}

.modal-tab {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-tab.active {
  background: var(--gold-gradient);
  color: #fff;
  border-color: transparent;
}

.modal-mantras-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 52vh;
  overflow-y: auto;
}

.modal-mantra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-mantra-item:hover, .modal-mantra-item.selected {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
  transform: translateX(2px);
}

.item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-citation {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--saffron-primary);
}

.item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.item-sanskrit {
  font-family: var(--font-sanskrit);
  font-size: 12px;
  color: var(--text-muted);
}

.item-veda-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
}

/* ==========================================
   VEDIC CORPUS STATISTICS & BANNER STYLES
   ========================================== */
.vedic-corpus-banner {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.vedic-corpus-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
}

.corpus-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.om-tag {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sanskrit);
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 2px 8px var(--gold-glow);
  flex-shrink: 0;
}

.corpus-header-text {
  display: flex;
  flex-direction: column;
}

.corpus-banner-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.corpus-banner-title strong {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 18px;
}

.corpus-banner-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.corpus-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.corpus-stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

.corpus-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
}

.corpus-stat-card .c-v-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.corpus-stat-card .c-v-count {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--saffron-primary);
}

.corpus-stat-card .c-v-detail {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.corpus-stat-card.stat-rig { border-left: 3px solid #ea580c; }
.corpus-stat-card.stat-yajur { border-left: 3px solid #7c3aed; }
.corpus-stat-card.stat-sama { border-left: 3px solid #0284c7; }
.corpus-stat-card.stat-atharva { border-left: 3px solid #059669; }

/* Compact Corpus Bar for Reader Sanctum */
.reader-corpus-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  font-size: 12px;
}

.rc-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 600;
}

.rc-om {
  color: var(--gold-primary);
  font-family: var(--font-sanskrit);
  font-size: 14px;
  font-weight: bold;
}

.rc-left strong {
  color: var(--saffron-primary);
  font-weight: 800;
}

.rc-breakdown {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.rc-item.rig { color: #ea580c; font-weight: 700; }
.rc-item.yajur { color: #7c3aed; font-weight: 700; }
.rc-item.sama { color: #0284c7; font-weight: 700; }
.rc-item.atharva { color: #059669; font-weight: 700; }
.rc-sep { opacity: 0.4; }

/* Hidden redundant mobile bottom nav */
.mobile-bottom-nav {
  display: none !important;
}

/* ==========================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================== */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  body {
    padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
  }

  .corpus-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .holy-mantra-card {
    padding: 16px 14px;
  }

  .sanskrit-text {
    font-size: 18px;
    line-height: 1.65;
  }

  .vedas-grid, .mahavakyas-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 0 10px;
  }

  .sacred-header {
    padding: 6px 8px;
    margin-bottom: 8px;
    gap: 4px;
  }

  .header-brand {
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
  }

  .om-symbol-icon {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .brand-text h1 {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    display: none;
  }

  .header-controls {
    gap: 4px;
    flex-shrink: 0;
  }

  .lang-select-wrapper {
    position: relative;
  }

  .lang-select {
    max-width: 46px;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
  }

  .lang-icon {
    display: none;
  }

  .ctrl-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
  }

  .om-recital-btn {
    font-size: 14px;
  }

  .mobile-menu-btn svg {
    width: 16px;
    height: 16px;
  }

  .vedic-corpus-banner {
    padding: 12px;
    margin-bottom: 14px;
  }

  .corpus-banner-title {
    font-size: 13.5px;
  }

  .corpus-banner-title strong {
    font-size: 15px;
  }

  .corpus-banner-subtitle {
    font-size: 11px;
  }

  .corpus-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .corpus-stat-card {
    padding: 8px 10px;
  }

  .corpus-stat-card .c-v-name {
    font-size: 11px;
  }

  .corpus-stat-card .c-v-count {
    font-size: 12px;
  }

  .corpus-stat-card .c-v-detail {
    font-size: 9.5px;
  }

  .reader-corpus-bar {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
  }

  .rc-breakdown {
    font-size: 10px;
    gap: 4px;
  }

  .veda-filter-pills {
    gap: 5px;
    padding-bottom: 6px;
    margin-bottom: 10px;
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }

  .filter-pill {
    font-size: 11px;
    padding: 4px 9px;
  }

  .holy-mantra-card {
    padding: 12px 10px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
  }

  .mantra-card-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    gap: 8px;
  }

  .banner-main-title {
    font-size: 12px;
  }

  .banner-sub-title {
    font-size: 10px;
  }

  .counter-pill {
    font-size: 10px;
    padding: 2px 6px;
  }

  .meta-tags-left {
    gap: 3px;
  }

  .meta-chip {
    font-size: 9.5px;
    padding: 1px 4px;
  }

  .action-icon-btn {
    width: 28px;
    height: 28px;
  }

  .sanskrit-verse-block {
    padding: 10px 4px 8px;
  }

  .sanskrit-text {
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.1px;
  }

  .transliteration-box {
    font-size: 11.5px;
    line-height: 1.45;
    padding: 0 4px 10px;
  }

  .translation-box {
    padding: 10px 10px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
  }

  .translation-label {
    font-size: 10.5px;
    margin-bottom: 4px;
  }

  .translation-body {
    font-size: 12.5px;
    line-height: 1.5;
  }

  .mantra-controls-row {
    gap: 5px;
    margin-bottom: 10px;
  }

  .nav-arrow-btn {
    padding: 7px 8px;
    font-size: 11.5px;
    gap: 3px;
  }

  .chant-audio-btn {
    padding: 8px 10px;
    font-size: 11.5px;
    gap: 4px;
  }

  .accordion-trigger {
    padding: 8px 10px;
    font-size: 11.5px;
  }

  .accordion-panel {
    padding: 8px 10px 10px;
    font-size: 12px;
  }

  .pada-word {
    font-size: 12.5px;
  }

  .padapatha-row {
    font-size: 12px;
  }
}
