:root {
  /* Color Palette - Dark Theme with Gold/Orange Accents */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a26;

  --text-primary: #f5f5f7;
  --text-secondary: #b4b4b8;
  --text-tertiary: #8a8a8f;

  --accent-primary: #ff9d3d;
  --accent-secondary: #ffb366;
  --accent-gradient: linear-gradient(135deg, #ff9d3d 0%, #ffb366 50%, #ffd699 100%);

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.08);

  --sanskrit-text: #ffd699;
  --sanskrit-glow: rgba(255, 214, 153, 0.3);

  /* Typography */
  --font-sanskrit: 'Noto Sans Devanagari', sans-serif;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', serif;

  --fs-xl: clamp(2.5rem, 5vw, 4rem);
  --fs-lg: clamp(1.5rem, 2.5vw, 2rem);
  --fs-md: clamp(1.25rem, 2vw, 1.5rem);
  --fs-base: clamp(1rem, 1.5vw, 1.125rem);
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;

  /* Verse-specific sizes */
  --fs-verse-sanskrit: clamp(1.35rem, 2vw, 1.65rem);
  --fs-verse-text: clamp(1rem, 1.2vw, 1.125rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--sanskrit-glow);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Animated Background Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(255, 157, 61, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 179, 102, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--fs-xl);
}

h2 {
  font-size: var(--fs-lg);
}

h3 {
  font-size: var(--fs-md);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

/* Sanskrit Text */
.sanskrit {
  font-family: var(--font-sanskrit);
  color: var(--sanskrit-text);
  font-size: var(--fs-lg);
  line-height: 1.8;
  text-align: center;
  margin: var(--space-lg) 0;
}

/* Book Card Component (Library Style) */
.glass-card {
  background: linear-gradient(145deg, rgba(61, 47, 31, 0.6), rgba(92, 74, 53, 0.4));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 2px solid var(--wood-border);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all var(--transition-base);
  position: relative;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 4px);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 20px rgba(201, 150, 61, 0.1);
  border-color: rgba(201, 150, 61, 0.4);
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--fs-base);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--bg-primary);
  box-shadow: 0 4px 16px rgba(255, 157, 61, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(255, 157, 61, 0.4);
}

.btn-glass {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: var(--glass-hover);
  border-color: var(--accent-primary);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: var(--space-md) 0;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  font-size: var(--fs-md);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.navbar-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.navbar-nav a:hover {
  color: var(--accent-primary);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 900px;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  margin-bottom: var(--space-md);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease;
}

.hero-subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 1s ease 0.2s both;
}

.hero-cta {
  animation: fadeInUp 1s ease 0.4s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chapter Grid - Library Catalog Style */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
}

.chapter-card {
  cursor: pointer;
  position: relative;
  overflow: visible;
}

/* Book spine effect */
.chapter-card::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0;
  width: 8px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-gold) 0%, var(--wood-dark) 100%);
  border-radius: 2px 0 0 2px;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.chapter-card:hover::before {
  opacity: 1;
}

/* Book corner fold effect */
.chapter-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent rgba(201, 150, 61, 0.2) transparent transparent;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.chapter-card:hover::after {
  opacity: 1;
}

.chapter-number {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chapter-number::before {
  content: '📖 ';
  font-size: 0.8em;
  opacity: 0.7;
}

.chapter-title {
  font-size: var(--fs-md);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.chapter-title-sans {
  font-family: var(--font-sanskrit);
  color: var(--sanskrit-text);
  font-size: var(--fs-base);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.chapter-meta {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  font-style: italic;
  opacity: 0.8;
}

.chapter-meta::before {
  content: '• ';
  color: var(--accent-gold);
}

/* Verse Display */
.verse-container {
  min-height: 100vh;
  padding: calc(60px + var(--space-xl)) var(--space-md) var(--space-xl);
}

.verse-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.verse-number {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-sm);
}

.verse-card {
  max-width: 900px;
  margin: 0 auto var(--space-xl);
}

.verse-card.glass-card {
  padding: var(--space-xl);
  background: linear-gradient(145deg, rgba(248, 243, 232, 0.05), rgba(235, 228, 209, 0.03));
  border: 2px solid rgba(201, 150, 61, 0.2);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.verse-card.glass-card:hover {
  transform: none;
}

/* Sacred Text Display - Aged Paper Style */
.verse-sanskrit {
  font-family: var(--font-sanskrit);
  font-size: var(--fs-verse-sanskrit);
  color: #2d2416;
  text-align: center;
  line-height: 2.4;
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(145deg, #f8f3e8, #ebe4d1);
  margin-bottom: var(--space-xl);
  border: 3px double var(--accent-gold);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    0 4px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Decorative corners on sacred text */
.verse-sanskrit::before,
.verse-sanskrit::after {
  content: '❋';
  position: absolute;
  color: var(--accent-gold);
  font-size: 1.2rem;
  opacity: 0.5;
}

.verse-sanskrit::before {
  top: 12px;
  left: 12px;
}

.verse-sanskrit::after {
  bottom: 12px;
  right: 12px;
  transform: rotate(180deg);
}

.verse-section {
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  border-left: 4px solid var(--accent-gold);
  background: linear-gradient(90deg, rgba(248, 243, 232, 0.08), transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
}

.verse-section::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0;
  width: 4px;
  height: 30px;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px rgba(201, 150, 61, 0.5);
}

.verse-section-title {
  font-size: 0.8rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-md);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
}

.verse-section-title::before {
  content: '◆';
  color: var(--accent-gold);
  font-size: 0.7rem;
}

.verse-transliteration {
  font-style: italic;
  color: var(--text-secondary);
  line-height: 2;
  font-size: var(--fs-verse-text);
  font-family: Georgia, 'Times New Roman', serif;
}

.verse-translation {
  color: var(--text-primary);
  line-height: 2;
  font-size: var(--fs-verse-text);
  text-align: justify;
}

/* Navigation Controls */
.verse-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  max-width: 800px;
  margin: var(--space-xl) auto;
}

.verse-nav-btn {
  flex: 1;
  max-width: 200px;
}

.chapter-selector {
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  cursor: pointer;
  transition: all var(--transition-base);
}

.chapter-selector:hover {
  background: var(--glass-hover);
  border-color: var(--accent-primary);
}

/* Loading Spinner */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.py-xl {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

/* Breadcrumb */
.breadcrumb {
  padding: var(--space-md) 0;
  margin-top: 60px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumb-item {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: var(--space-sm);
  color: var(--text-tertiary);
}

.breadcrumb-item a {
  color: var(--text-secondary);
}

.breadcrumb-item a:hover {
  color: var(--accent-primary);
}

/* Search/Filter */
.search-container {
  margin-bottom: var(--space-xl);
}

.search-input {
  width: 100%;
  padding: var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  transition: all var(--transition-base);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--glass-hover);
  box-shadow: 0 0 0 4px rgba(255, 157, 61, 0.1);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}