/* 
  =========================================
  DIGITAL SANSKRIT SCRIPTURE LIBRARY
  Premium Traditional Indian Theme Stylesheet
  =========================================
*/

/* Core CSS Variables and Design System */
:root {
  /* Fonts */
  --font-sanskrit: 'Noto Serif Devanagari', serif;
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Lora', serif;

  /* Theme Tokens - Light Mode (Ancient Parchment Library) */
  --bg-primary: #fcf8f2;
  --bg-secondary: #f4e8d8;
  --bg-tertiary: #ebdcbf;
  --text-primary: #3d2314;
  --text-secondary: #5c3e21;
  --text-sanskrit: #2a160c;
  --accent-gold: #cfa83c;
  --accent-saffron: #d6501c;
  --accent-maroon: #800000;
  --border-color: #d1b48c;
  --card-shadow: 0 8px 24px rgba(61, 35, 20, 0.08);
  --inset-shadow: inset 0 2px 8px rgba(61, 35, 20, 0.04);
  
  /* Mandala Pattern - Concentric Circles and Petals in Saffron */
  --bg-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg stroke='%23d6501c' stroke-width='0.5' stroke-opacity='0.025' fill='none'%3E%3Ccircle cx='80' cy='80' r='70'/%3E%3Ccircle cx='80' cy='80' r='55'/%3E%3Ccircle cx='80' cy='80' r='40'/%3E%3Ccircle cx='80' cy='80' r='25'/%3E%3Ccircle cx='80' cy='80' r='10'/%3E%3Cpath d='M80 0v160M0 80h160M24 24l112 112M24 136L136 24'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(45 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(90 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(135 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(180 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(225 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(270 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(315 80 80)'/%3E%3C/g%3E%3C/svg%3E");

  /* Layout */
  --transition-speed: 0.3s;
  --border-radius: 6px;
  --container-width: 1200px;
}

/* Dark Mode (Temple Lighting - Warm Candlelight in Sacred Sanctuary) */
html.dark-mode {
  --bg-primary: #120b08;
  --bg-secondary: #1a100b;
  --bg-tertiary: #271911;
  --text-primary: #eed5b7;
  --text-secondary: #cfa276;
  --text-sanskrit: #fff;
  --accent-gold: #e5bd54;
  --accent-saffron: #f37735;
  --accent-maroon: #b93a3a;
  --border-color: #533522;
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(229, 189, 84, 0.04);
  --inset-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
  
  /* Mandala Pattern - Concentric Circles and Petals in Soft Gold */
  --bg-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg stroke='%23e5bd54' stroke-width='0.5' stroke-opacity='0.012' fill='none'%3E%3Ccircle cx='80' cy='80' r='70'/%3E%3Ccircle cx='80' cy='80' r='55'/%3E%3Ccircle cx='80' cy='80' r='40'/%3E%3Ccircle cx='80' cy='80' r='25'/%3E%3Ccircle cx='80' cy='80' r='10'/%3E%3Cpath d='M80 0v160M0 80h160M24 24l112 112M24 136L136 24'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(45 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(90 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(135 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(180 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(225 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(270 80 80)'/%3E%3Cpath d='M80 10 L85 22 L80 35 L75 22 Z' transform='rotate(315 80 80)'/%3E%3C/g%3E%3C/svg%3E");
}

/* Base Document Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  background-image: var(--bg-pattern);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  overflow-x: hidden;
}

/* Custom Scrollbar styled traditionally */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-left: 1px solid var(--border-color);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border: 2px solid var(--bg-primary);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-saffron);
}

/* Typography Rules */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
}

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

.sanskrit-text {
  font-family: var(--font-sanskrit);
  font-size: 1.5rem;
  line-height: 2.2rem;
  font-weight: 400;
  text-align: center;
  color: var(--text-sanskrit);
  letter-spacing: 0.2px;
  margin-bottom: 1rem;
}

/* Layout Utilities */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
}

/* Background Particle Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Traditional Borders */
.temple-top-border {
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Crect width='40' height='4' fill='%23800000'/%3E%3Cpath d='M0 24 L20 4 L40 24 Z' fill='%23d6501c'/%3E%3Cpath d='M5 24 L20 9 L35 24 Z' fill='%23cfa83c'/%3E%3Cpath d='M10 24 L20 14 L30 24 Z' fill='%23800000'/%3E%3Ccircle cx='20' cy='20' r='1.5' fill='%23cfa83c'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 40px 24px;
  border-bottom: 2px solid var(--accent-gold);
  position: relative;
  z-index: 100;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.temple-bottom-border-deco {
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Crect y='20' width='40' height='4' fill='%23800000'/%3E%3Cpath d='M0 0 L20 20 L40 0 Z' fill='%23d6501c'/%3E%3Cpath d='M5 0 L20 15 L35 0 Z' fill='%23cfa83c'/%3E%3Cpath d='M10 0 L20 10 L30 0 Z' fill='%23800000'/%3E%3Ccircle cx='20' cy='4' r='1.5' fill='%23cfa83c'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 40px 24px;
  border-top: 2px solid var(--accent-gold);
  margin-top: 4rem;
  box-shadow: 0 -3px 6px rgba(0,0,0,0.1);
}

html.dark-mode .temple-top-border {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Crect width='40' height='4' fill='%23b93a3a'/%3E%3Cpath d='M0 24 L20 4 L40 24 Z' fill='%23f37735'/%3E%3Cpath d='M5 24 L20 9 L35 24 Z' fill='%23e5bd54'/%3E%3Cpath d='M10 24 L20 14 L30 24 Z' fill='%23b93a3a'/%3E%3Ccircle cx='20' cy='20' r='1.5' fill='%23e5bd54'/%3E%3C/svg%3E");
}

html.dark-mode .temple-bottom-border-deco {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Crect y='20' width='40' height='4' fill='%23b93a3a'/%3E%3Cpath d='M0 0 L20 20 L40 0 Z' fill='%23f37735'/%3E%3Cpath d='M5 0 L20 15 L35 0 Z' fill='%23e5bd54'/%3E%3Cpath d='M10 0 L20 10 L30 0 Z' fill='%23b93a3a'/%3E%3Ccircle cx='20' cy='4' r='1.5' fill='%23e5bd54'/%3E%3C/svg%3E");
}

/* App Header & Sticky Navigation */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent-gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: background-color var(--transition-speed);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
}

/* Logo Design */
.logo-area {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.om-symbol {
  font-family: var(--font-sanskrit);
  font-size: 2.2rem;
  color: var(--accent-saffron);
  text-shadow: 0 0 8px rgba(214, 80, 28, 0.2);
  animation: float-om 4s ease-in-out infinite alternate;
}

@keyframes float-om {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-3px) scale(1.05); text-shadow: 0 0 15px rgba(229, 189, 84, 0.5); }
}

.logo-title {
  font-size: 1.6rem;
  color: var(--accent-maroon);
  font-weight: 700;
}
html.dark-mode .logo-title {
  color: var(--accent-gold);
}

.logo-subtitle {
  font-size: 0.75rem;
  font-family: var(--font-body);
  letter-spacing: 2px;
  color: var(--text-secondary);
  font-weight: bold;
}

/* Main Navigation Items */
.main-nav {
  display: flex;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-saffron);
  border-bottom-color: var(--accent-gold);
}

.nav-link i {
  font-size: 0.9rem;
  transition: transform 0.2s;
}

.nav-link:hover i {
  transform: scale(1.2);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-speed);
}

.btn-theme-toggle:hover {
  background: var(--accent-gold);
  color: #3d2314;
  border-color: var(--accent-gold);
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Ambient Music box widget */
.ambient-music-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.btn-ambient {
  background: var(--bg-secondary);
  border: 2px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-speed);
}

.btn-ambient:hover {
  transform: translateY(-2px);
  background: var(--accent-saffron);
  color: #fff;
  border-color: var(--accent-saffron);
}

.btn-ambient.playing {
  background: var(--accent-gold);
  color: #3d2314;
  border-color: var(--accent-gold);
}

/* Global Loader Container */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.loader-bell-wrapper {
  font-size: 3rem;
  color: var(--accent-gold);
  animation: bell-swing 2.5s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes bell-swing {
  0% { transform: rotate(0); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-10deg); }
  100% { transform: rotate(0); }
}

.loader-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin-top: 1.5rem;
  font-style: italic;
}

/* Page Sub-sections (Fade-in animations) */
.view-section {
  animation: fade-in 0.8s ease forwards;
  opacity: 0;
  padding-top: 2rem;
  z-index: 5;
  position: relative;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* GRAND HERO SECTION */
.hero-section {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 3px solid var(--accent-gold);
  margin-bottom: 3rem;
}

.hero-overlay {
  background: linear-gradient(to right, rgba(26, 15, 10, 0.95) 40%, rgba(26, 15, 10, 0.4) 100%);
  padding: 5rem 3rem;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero-tagline {
  font-family: var(--font-sanskrit);
  font-size: 1.4rem;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 3.5rem;
  color: #fff;
  line-height: 4rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: #eed5b7;
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.8rem;
  font-style: italic;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
}

/* Button UI Components */
.btn-primary {
  background: var(--accent-saffron);
  color: #fff;
  border: 1px solid var(--accent-saffron);
  padding: 0.8rem 2rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(214, 80, 28, 0.3);
  transition: all var(--transition-speed);
}

.btn-primary:hover {
  background: var(--accent-gold);
  color: #3d2314;
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid var(--accent-gold);
  padding: 0.8rem 2rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-secondary:hover {
  background: rgba(229, 189, 84, 0.1);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

/* FEATURED & RECENT LAYOUT */
.section-headline {
  font-size: 2.2rem;
  color: var(--accent-maroon);
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}
html.dark-mode .section-headline {
  color: var(--accent-gold);
}

/* Traditional Decorative Divider Line */
.deco-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0 2.5rem;
}

.divider-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold) 50%, transparent);
  flex-grow: 1;
}

.divider-symbol {
  font-size: 1.5rem;
  color: var(--accent-saffron);
}

.divider-symbol-diya {
  position: relative;
  width: 24px;
  height: 14px;
  background: radial-gradient(ellipse at center, #8e5a30 0%, #4a280e 100%);
  border-radius: 0 0 12px 12px;
  border-top: 1.5px solid #b87c4c;
  display: inline-block;
  margin-top: 10px;
}

.divider-symbol-diya::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%) rotate(-10deg);
  width: 2px;
  height: 6px;
  background: #111;
  border-radius: 1px;
}

.divider-symbol-diya::after {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 16px;
  background: radial-gradient(ellipse at bottom, #ffffff 0%, #ffd700 40%, #ff4500 80%, transparent 100%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 6px #ff4500, 0 0 12px #ffd700;
  animation: diya-flicker 0.15s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

/* Grid Layouts */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-bottom: 4rem;
}

/* PREMIUM SCRIPTURE CARD */
.scripture-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s, border-color 0.4s;
  position: relative;
}

.scripture-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-saffron);
}

.card-image-wrapper {
  height: 220px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--accent-gold);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s;
}

.scripture-card:hover .card-image {
  transform: scale(1.08);
}

.card-category-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--accent-maroon);
  color: #fff;
  padding: 0.2rem 0.8rem;
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--accent-gold);
}

.card-content {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.6rem;
  color: var(--accent-maroon);
  margin-bottom: 0.8rem;
}
html.dark-mode .card-title {
  color: var(--accent-gold);
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 1.2rem;
}

.meta-chapters {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.card-btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-saffron);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-btn i {
  transition: transform 0.2s;
}

.scripture-card:hover .card-btn i {
  transform: translateX(5px);
}

/* RECENTLY VIEWED & BOOKMARKS PANEL */
.home-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.side-panel {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.5rem;
  color: var(--accent-maroon);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
}
html.dark-mode .panel-header {
  color: var(--accent-gold);
}

.panel-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: background-color 0.2s;
}

.panel-item:hover {
  background: var(--bg-tertiary);
}

.panel-item-left {
  display: flex;
  flex-direction: column;
}

.panel-item-title {
  font-family: var(--font-heading);
  font-weight: bold;
  color: var(--text-primary);
}

.panel-item-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* SCRIPTURE DETAIL PAGE */
.scripture-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
}

.scripture-name {
  font-size: 3rem;
  color: var(--accent-maroon);
}
html.dark-mode .scripture-name {
  color: var(--accent-gold);
}

.scripture-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8rem;
  font-style: italic;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

/* CHAPTER CARD */
.chapter-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-speed);
}

.chapter-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-saffron);
}

.chapter-number {
  font-family: var(--font-heading);
  color: var(--accent-gold);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.chapter-name {
  font-size: 1.6rem;
  color: var(--accent-maroon);
  margin-bottom: 0.8rem;
}
html.dark-mode .chapter-name {
  color: var(--accent-gold);
}

.chapter-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5rem;
  margin-bottom: 1.5rem;
}

.chapter-action-btn {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--font-heading);
  font-weight: bold;
  color: var(--accent-saffron);
}

/* ADHYAYA / READER PAGE */
.reader-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  margin-bottom: 4rem;
}

/* Sidebar Chapter/Verse Navigation */
.reader-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent-maroon);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}
html.dark-mode .sidebar-title {
  color: var(--accent-gold);
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav-item a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.sidebar-nav-item a:hover {
  background: var(--bg-tertiary);
  color: var(--accent-saffron);
}

.sidebar-nav-item.active a {
  background: var(--accent-saffron);
  color: #fff;
}

/* Shloka List Display */
.shlokas-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* SHLOKA CARD */
.shloka-card {
  background: var(--bg-secondary);
  /* Centered Lotus watermark in saffron/gold */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'%3E%3Cpath d='M50 25 C47 45 47 65 50 75 C53 65 53 45 50 25 Z' fill='%23d6501c' fill-opacity='0.02'/%3E%3Cpath d='M50 35 C38 45 32 60 38 72 C44 72 48 65 50 55 Z' fill='%23d6501c' fill-opacity='0.015'/%3E%3Cpath d='M50 45 C28 50 20 68 32 75 C38 70 45 68 50 62 Z' fill='%23d6501c' fill-opacity='0.01'/%3E%3Cpath d='M50 35 C62 45 68 60 62 72 C56 72 52 65 50 55 Z' fill='%23d6501c' fill-opacity='0.015'/%3E%3Cpath d='M50 45 C72 50 80 68 68 75 C62 70 55 68 50 62 Z' fill='%23d6501c' fill-opacity='0.01'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 200px 200px;
  border: 3px double var(--border-color);
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
}

.shloka-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-saffron);
  box-shadow: 0 12px 30px rgba(61, 35, 20, 0.12);
}

html.dark-mode .shloka-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 25px rgba(229, 189, 84, 0.06);
}

/* Inner frame line for manuscript look */
.shloka-card::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid var(--accent-saffron);
  opacity: 0.18;
  pointer-events: none;
  border-radius: 4px;
  z-index: 1;
}

/* Watermark Om in the background */
.shloka-card::after {
  content: 'ॐ';
  position: absolute;
  bottom: 12px;
  right: 18px;
  font-family: var(--font-sanskrit);
  font-size: 2.2rem;
  color: var(--accent-gold);
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

html.dark-mode .shloka-card {
  /* Center lotus watermark in warm gold for dark mode */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'%3E%3Cpath d='M50 25 C47 45 47 65 50 75 C53 65 53 45 50 25 Z' fill='%23e5bd54' fill-opacity='0.015'/%3E%3Cpath d='M50 35 C38 45 32 60 38 72 C44 72 48 65 50 55 Z' fill='%23e5bd54' fill-opacity='0.01'/%3E%3Cpath d='M50 45 C28 50 20 68 32 75 C38 70 45 68 50 62 Z' fill='%23e5bd54' fill-opacity='0.008'/%3E%3Cpath d='M50 35 C62 45 68 60 62 72 C56 72 52 65 50 55 Z' fill='%23e5bd54' fill-opacity='0.01'/%3E%3Cpath d='M50 45 C72 50 80 68 68 75 C62 70 55 68 50 62 Z' fill='%23e5bd54' fill-opacity='0.008'/%3E%3C/svg%3E");
}

.shloka-number-badge {
  position: absolute;
  top: 15px;
  right: 25px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.shloka-sanskrit {
  margin: 1.5rem 0;
  border-left: 3px solid var(--accent-saffron);
  padding-left: 1.5rem;
}

.shloka-translit-label, .shloka-transl-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold);
  margin-bottom: 0.3rem;
  font-weight: bold;
}

.shloka-transliteration {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.shloka-translation {
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1.8rem;
  margin-bottom: 2rem;
}

/* Sandhi Drawer/Tab */
.sandhi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.sandhi-title {
  font-family: var(--font-heading);
  font-weight: bold;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.sandhi-body {
  display: none;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 4px 4px;
  margin-top: -1rem;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.sandhi-body.open {
  display: block;
}

.sandhi-item {
  border-bottom: 1px dashed var(--border-color);
  padding: 0.6rem 0;
}

.sandhi-item:last-child {
  border-bottom: none;
}

.sandhi-term {
  font-family: var(--font-sanskrit);
  font-weight: bold;
  color: var(--accent-maroon);
}
html.dark-mode .sandhi-term {
  color: var(--accent-gold);
}

.sandhi-breakdown {
  font-style: italic;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  color: var(--text-secondary);
}

.sandhi-meaning {
  font-size: 0.95rem;
  margin-top: 0.2rem;
  color: var(--text-primary);
}

/* Shloka Card Controls (Player, Bookmarks, Share) */
.shloka-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

/* Inline Audio Player */
.shloka-audio-player {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
}

.btn-play-shloka {
  background: var(--accent-saffron);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 8px rgba(214, 80, 28, 0.2);
  transition: all 0.2s;
}

.btn-play-shloka:hover {
  background: var(--accent-gold);
  color: #3d2314;
  transform: scale(1.05);
}

.btn-play-shloka.playing {
  background: var(--accent-gold);
  color: #3d2314;
}

.audio-progress-bar {
  flex-grow: 1;
  max-width: 250px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.audio-progress {
  height: 100%;
  width: 0%;
  background: var(--accent-saffron);
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* Bookmarks and Shares buttons */
.shloka-buttons {
  display: flex;
  gap: 1rem;
}

.btn-action {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.btn-action:hover {
  background: var(--bg-tertiary);
  color: var(--accent-saffron);
  border-color: var(--accent-saffron);
}

.btn-action.bookmarked {
  background: var(--accent-maroon);
  color: #fff;
  border-color: var(--accent-maroon);
}

/* SEARCH VIEW */
.search-container {
  max-width: 700px;
  margin: 0 auto 3rem;
}

.search-box {
  display: flex;
  border: 2px solid var(--accent-gold);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.search-input {
  flex-grow: 1;
  background: var(--bg-secondary);
  border: none;
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.search-input:focus {
  outline: none;
}

.btn-search {
  background: var(--accent-saffron);
  color: #fff;
  border: none;
  padding: 0 1.8rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.2s;
}

.btn-search:hover {
  background: var(--accent-gold);
  color: #3d2314;
}

.search-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.filter-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.4rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-badge.active, .filter-badge:hover {
  background: var(--accent-gold);
  color: #3d2314;
  border-color: var(--accent-gold);
}

.search-results-info {
  text-align: center;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.search-results-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 4rem;
}

/* ABOUT VIEW */
.about-box {
  max-width: 800px;
  margin: 0 auto 4rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 3rem;
  box-shadow: var(--card-shadow);
}

.about-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--accent-maroon);
  margin-bottom: 1.5rem;
}
html.dark-mode .about-title {
  color: var(--accent-gold);
}

.about-content p {
  font-size: 1.05rem;
  line-height: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.deity-artwork-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}

.deity-card {
  text-align: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 6px;
  transition: all 0.3s;
}

.deity-card:hover {
  border-color: var(--accent-saffron);
  transform: translateY(-4px);
}

.deity-icon {
  font-size: 2.5rem;
  color: var(--accent-saffron);
  margin-bottom: 0.8rem;
}

.deity-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent-maroon);
  margin-bottom: 0.4rem;
}
html.dark-mode .deity-name {
  color: var(--accent-gold);
}

.deity-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* FOOTER SECTION styling */
.app-footer {
  background: var(--bg-secondary);
  border-top: 2px solid var(--accent-gold);
  padding: 4rem 0 2rem;
  color: var(--text-primary);
  position: relative;
  z-index: 10;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.brand-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-om {
  font-family: var(--font-sanskrit);
  font-size: 2.5rem;
  color: var(--accent-saffron);
  line-height: 1;
}

.brand-col h3 {
  font-size: 1.5rem;
  color: var(--accent-maroon);
}
html.dark-mode .brand-col h3 {
  color: var(--accent-gold);
}

.brand-col p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.links-col h4, .contact-col h4 {
  font-size: 1.2rem;
  color: var(--accent-maroon);
  margin-bottom: 1.2rem;
}
html.dark-mode .links-col h4, html.dark-mode .contact-col h4 {
  color: var(--accent-gold);
}

.links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.links-col a {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.links-col a:hover {
  color: var(--accent-saffron);
}

/* Flickering Diya in Footer */
.diya-decor {
  width: 60px;
  height: 35px;
  background: radial-gradient(ellipse at center, #8e5a30 0%, #4a280e 100%);
  border-radius: 0 0 30px 30px;
  margin: 1.5rem 0 0 10px;
  position: relative;
  border-top: 3px solid #b87c4c;
}

.diya-wick {
  width: 4px;
  height: 12px;
  background: #111;
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-10deg);
  border-radius: 2px;
}

.diya-flame-flicker {
  width: 14px;
  height: 28px;
  background: radial-gradient(ellipse at bottom, #ffffff 0%, #ffd700 40%, #ff4500 80%, transparent 100%);
  position: absolute;
  top: -30px;
  left: 52%;
  transform: translateX(-50%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 10px #ff4500, 0 0 20px #ffd700;
  animation: diya-flicker 0.15s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

@keyframes diya-flicker {
  0% { transform: translateX(-50%) scaleX(0.95) scaleY(0.95) rotate(-1deg); opacity: 0.9; }
  100% { transform: translateX(-50%) scaleX(1.05) scaleY(1.05) rotate(1deg); opacity: 1; }
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.footer-decorative-line {
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-gold) 50%, transparent);
  margin-top: 0.5rem;
}

/* Toast Messages styling */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-gold);
  border-left: 4px solid var(--accent-saffron);
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slide-toast 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.8rem;
    line-height: 3.2rem;
  }
  .home-split-row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  .brand-col {
    grid-column: span 2;
  }
  .reader-container {
    grid-template-columns: 1fr;
  }
  .reader-sidebar {
    position: relative;
    top: 0;
    margin-bottom: 1.5rem;
    width: 100%;
  }
  .sidebar-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0.6rem 0;
  }
  
  /* Mobile Menu Toggles */
  .mobile-nav-toggle {
    display: block;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--accent-gold);
    padding: 1.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  
  .main-nav.open {
    display: block;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-overlay {
    padding: 3rem 1.5rem;
    min-height: auto;
  }
  .hero-title {
    font-size: 2.2rem;
    line-height: 2.6rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }
  .hero-actions button {
    width: 100%;
  }
  
  .chapter-grid {
    grid-template-columns: 1fr;
  }
  .shloka-card {
    padding: 1.5rem;
  }
  .shloka-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }
  .shloka-audio-player {
    width: 100%;
  }
  .audio-progress-bar {
    max-width: none;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .brand-col {
    grid-column: span 1;
  }
  
  .about-box {
    padding: 1.5rem;
  }
}

/* ==========================================================================
   10. INTERACTIVE SANDHI DIFF CHAMBER STYLING
   ========================================================================== */

.diff-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .diff-card-grid {
    grid-template-columns: 1fr;
  }
}

.diff-pane {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  position: relative;
  transition: background-color var(--transition-speed);
}

html.dark-mode .diff-pane {
  background: rgba(0, 0, 0, 0.2);
}

.diff-pane-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(229, 189, 84, 0.15);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Interactive highlight styles */
.sandhi-orig-highlight {
  background-color: rgba(216, 80, 28, 0.08);
  border-bottom: 2px dashed var(--accent-saffron);
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sandhi-orig-highlight:hover, .sandhi-orig-highlight.active {
  background-color: rgba(216, 80, 28, 0.22);
  box-shadow: 0 0 5px rgba(216, 80, 28, 0.3);
}

.sandhi-split-highlight {
  background-color: rgba(46, 125, 50, 0.08);
  border-bottom: 2px solid #2e7d32;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #2e7d32;
}

html.dark-mode .sandhi-split-highlight {
  background-color: rgba(129, 199, 132, 0.12);
  border-bottom-color: #81c784;
  color: #a5d6a7;
}

.sandhi-split-highlight:hover, .sandhi-split-highlight.active {
  background-color: rgba(46, 125, 50, 0.22);
  box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
}

html.dark-mode .sandhi-split-highlight:hover, html.dark-mode .sandhi-split-highlight.active {
  background-color: rgba(129, 199, 132, 0.25);
  box-shadow: 0 0 5px rgba(129, 199, 132, 0.3);
}

/* Rule analysis drawer in card */
.diff-analysis-drawer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-top: -12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--inset-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  z-index: 2;
}

.analysis-rule-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.8rem 1.2rem;
  transition: all var(--transition-speed) ease;
}

.analysis-rule-item:hover, .analysis-rule-item.highlighted {
  border-color: var(--accent-saffron);
  box-shadow: 0 3px 8px rgba(214, 80, 28, 0.12);
}

.analysis-rule-item.highlighted {
  background: rgba(214, 80, 28, 0.03);
}

html.dark-mode .analysis-rule-item.highlighted {
  background: rgba(214, 80, 28, 0.06);
}

.analysis-rule-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(226, 88, 34, 0.15);
  padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
}

.analysis-rule-term {
  font-family: var(--font-sanskrit);
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--accent-maroon);
}

html.dark-mode .analysis-rule-term {
  color: var(--accent-gold);
}

.analysis-rule-arrow {
  color: var(--text-secondary);
  font-weight: bold;
  margin: 0 0.5rem;
}

.analysis-rule-breakdown {
  font-family: var(--font-sanskrit);
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--accent-saffron);
}

.analysis-rule-meaning {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.4;
}
