/* ============================================
   GLOBAL V2 STYLESHEET
   Path: /assets/css/global-v2.css
   Purpose: Consolidated styles for new templates
   Primary use: Character profiles and study pages
   Version: 2.1.0 - Updated with cosmic eye nav logo
   Last Updated: 2025-01-15
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Primary Colors */
  --primary-dark: #0a0a0a;
  --primary-light: #ffffff;
  
  /* Accent Colors */
  --accent-blue: #00b4d8;
  --accent-purple: #7209b7;
  --accent-rose: #e11d48;
  --accent-gold: #d4af37;
  --accent-green: #10b981;

  /* Layout */
  --nav-height: 88px;
  
  /* Cosmic Logo Colors */
  --cosmic-cyan: #3EE4FF;
  --cosmic-blue: #57A9FF;
  --cosmic-indigo: #6C4FF7;
  --cosmic-magenta: #E94BFF;
  --cosmic-pink: #FA4ABA;
  --cosmic-orange: #FF9B4A;
  
  /* Neutral Colors */
  --text-gray: #6b7280;
  --bg-gray: #f5f5f5;
  --border-light: #e5e7eb;
  --muted: #6b7280; 
  --muted-2: #9ca3af;
  --panel: #f8fafc;
  --bg: #ffffff;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow: rgba(0,0,0,.05);
  
  /* Semantic Colors */
  --ring: #d1d5db;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  /* Layout */
  --max-width-content: 1100px;
  --max-width-wide: 1400px;
}

/* ============================================
   BASE RESET & DEFAULTS
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--primary-dark);
  background: linear-gradient(to bottom, #fafafa 0%, #f3f4f6 100%);
  overflow-x: hidden;
  font-size: 16px;
}

/* ============================================
   NAVIGATION
   ============================================ */
#main-nav {
  position: fixed;
  width: 100%;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

#main-nav.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

nav:not(#main-nav) {
  position: static;
  width: auto;
  top: auto;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;
}

.nav-container {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--primary-dark);
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

/* Updated logo-icon for cosmic eye image */
.logo-icon {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon img {
  height: 74px;
  width: auto;
  display: block;
}

.logo-icon svg {
  /* Fallback for pages still using inline SVG */
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-gray);
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-dark);
  background-color: rgba(0, 0, 0, 0.05);
}

.dropdown {
  position: relative;
}

.dropdown-toggle::after {
  content: '▾';
  font-size: 0.8rem;
  margin-left: 0.25rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after,
.dropdown.active .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--primary-light);
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-radius: 8px;
  z-index: 1;
  top: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  border: 1px solid var(--border-light);
}

/* Invisible bridge to prevent hover gap */
.dropdown-content::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.dropdown-content a {
  color: var(--text-gray);
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
}

.dropdown-content a:hover {
  background-color: var(--bg-gray);
  color: var(--primary-dark);
  padding-left: 1.5rem;
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
  display: block;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--primary-dark);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ============================================
   HERO OFFSET FOR FIXED NAV
   ============================================ */
body {
  padding-top: var(--nav-height);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-dark);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 2000;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   CONTENT LAYOUT
   ============================================ */
.content-section { 
  max-width: var(--max-width-content); 
  margin: 0 auto; 
  padding: 7.5rem 1rem 2rem;
}

.container {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.section-title { 
  font-size: 2.2rem; 
  margin: .25rem 0 1.5rem; 
  display: flex; 
  align-items: center; 
  gap: .75rem; 
  color: #1a202c;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.section-icon { 
  font-size: 1.2em; 
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-gray);
  font-size: 1rem;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs { 
  font-size: .9rem; 
  color: var(--muted); 
  margin-bottom: 1rem; 
}

.breadcrumbs a { 
  color: inherit; 
  text-decoration: none; 
  transition: color 0.2s;
}

.breadcrumbs a:hover { 
  color: var(--accent-blue); 
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.theology-card { 
  background: var(--bg); 
  border: 1px solid var(--border-light); 
  border-radius: 16px; 
  padding: 1.5rem 1.75rem; 
  margin: 1.5rem 0; 
  box-shadow: 0 4px 6px -1px var(--shadow), 0 2px 4px -1px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.theology-card h3 { 
  margin: .1rem 0 1rem; 
  color: #1a202c;
  font-size: 1.4rem;
  font-weight: 700;
}

@media (hover: hover) {
  .theology-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px var(--shadow-lg), 0 4px 6px -2px var(--shadow);
  }
}

.panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 1.25rem;
}

.panel h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--accent-purple);
}

/* ============================================
   GRID SYSTEMS
   ============================================ */
.grid-2 { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
  gap: 1.5rem; 
}

.grid-3 { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
  gap: 1.5rem; 
}

.grid-4 { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
  gap: 1rem; 
}

/* ============================================
   TAGS & BADGES
   ============================================ */
.tag { 
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--ring); 
  border-radius: 999px; 
  padding: .2rem .75rem; 
  font-size: .85rem; 
  margin: .15rem .35rem .15rem 0; 
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  font-weight: 500;
  transition: all 0.2s;
}

.tag:hover {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
  color: white;
  border-color: transparent;
}

.tag.primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
  color: white;
  border-color: transparent;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table { 
  width: 100%; 
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
}

thead th { 
  background: linear-gradient(135deg, var(--panel) 0%, #e5e7eb 100%);
  font-weight: 600; 
  color: #1a202c;
  text-align: left;
  padding: .8rem .75rem;
}

th, td { 
  border-top: 1px solid var(--border-light); 
  padding: .75rem; 
  vertical-align: top; 
  text-align: left; 
}

tbody tr:hover {
  background: var(--panel);
}

/* ============================================
   KEY INSIGHTS & CALLOUTS
   ============================================ */
.key-insight {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left: 4px solid #3b82f6;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.key-insight strong {
  color: #1e40af;
}

.significance { 
  background: var(--panel);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  border-left: 4px solid var(--success);
}

.significance h4 { 
  margin: .2rem 0 .75rem; 
  color: var(--success);
  font-size: 1.1rem;
}

/* ============================================
   META DATA
   ============================================ */
.meta { 
  display: flex; 
  gap: 1rem; 
  flex-wrap: wrap; 
  margin: 1rem 0; 
}

.meta .kv { 
  background: linear-gradient(135deg, #fff 0%, var(--panel) 100%);
  border: 1px solid var(--ring); 
  border-radius: 12px; 
  padding: .5rem .9rem; 
  font-size: .95rem; 
  transition: all 0.2s;
}

.meta .kv:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px var(--shadow);
}

/* ========================================
   PAGE NAVIGATION (Flexible for 4, 5, 6+ pages)
   ======================================== */
.page-navigation {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
  border: 2px solid #4a5fff;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem auto;
  max-width: 1100px;
}

.page-navigation:has(.page-nav-item:nth-child(6)) {
  max-width: 1200px;
}

.page-navigation:not(:has(.page-nav-item:nth-child(5))) {
  max-width: 900px;
}

.page-navigation h3 {
  color: #2a3aaa;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  text-align: center;
}

.page-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.page-nav-item {
  flex: 0 1 calc(20% - 1rem);
  min-width: 180px;
  max-width: 220px;
  background: white;
  border: 1px solid #d0d8ff;
  padding: 1.25rem;
  text-align: center;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
  position: relative;
  min-height: 120px;
  cursor: pointer;
}

.page-nav-grid:has(.page-nav-item:nth-child(6)) .page-nav-item {
  flex: 0 1 calc(16.666% - 1rem);
  min-width: 160px;
  max-width: 200px;
}

.page-nav-grid:not(:has(.page-nav-item:nth-child(5))) .page-nav-item {
  flex: 0 1 calc(25% - 1rem);
  min-width: 200px;
  max-width: 250px;
}

.page-nav-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(74, 95, 255, 0.15);
  border-color: #4a5fff;
}

.page-nav-item.current {
  background: #4a5fff;
  color: white;
  border-color: #4a5fff;
  cursor: default;
}

.page-nav-item h4 {
  color: #4a5fff;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.page-nav-item.current h4 {
  color: white;
}

.nav-subtitle {
  font-size: 0.85rem;
  color: #666;
  margin: 0.3rem 0;
}

.page-nav-item.current .nav-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

.nav-status {
  font-weight: bold;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.page-nav-item.current .nav-status {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  display: inline-block;
}

.nav-link {
  color: #2a3aaa;
  font-size: 0.85rem;
  display: inline-block;
  transition: transform 0.3s ease;
  position: absolute;
  bottom: 1rem;
  right: 1rem;
}

.page-nav-item:hover .nav-link {
  transform: translateX(3px);
}

/* ========================================
   RESPONSIVE BREAKPOINTS FOR PAGE NAV
   ======================================== */
@media (min-width: 1100px) {
  .page-nav-item {
    max-width: none;
  }
}

@media (min-width: 700px) and (max-width: 1099px) {
  .page-navigation {
    max-width: 800px;
  }
  
  .page-nav-item {
    flex: 0 1 calc(33.333% - 1rem);
    min-width: 200px;
    max-width: 250px;
  }
  
  .page-nav-grid:not(:has(.page-nav-item:nth-child(5))) .page-nav-item {
    flex: 0 1 calc(50% - 1rem);
    max-width: 300px;
  }
}

@media (min-width: 500px) and (max-width: 699px) {
  .page-navigation {
    max-width: 600px;
  }
  
  .page-nav-item {
    flex: 0 1 calc(50% - 1rem);
    min-width: 200px;
    max-width: 280px;
  }
}

@media (max-width: 499px) {
  .page-navigation {
    padding: 1rem;
    margin: 1rem -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-width: 100%;
  }
  
  .page-navigation h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .page-nav-grid {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .page-nav-item {
    flex: 1 1 100%;
    min-width: auto;
    max-width: none;
    padding: 0.75rem;
    border-radius: 6px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  
  .page-nav-item h4 {
    font-size: 0.85rem;
  }
  
  .nav-link {
    position: static;
    margin-top: 0.5rem;
  }
  
  .nav-subtitle {
    flex: 1;
    text-align: left;
    margin-left: 0;
  }
}

/* ========================================
   BIBLIOGRAPHY SECTION
   ======================================== */
.bibliography-section {
  max-width: 100%;
  margin: 3rem auto;
}

.bibliography-section summary {
  cursor: pointer;
  list-style: none;
  outline: none;
}

.bibliography-header {
  background: var(--bg, #fff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.bibliography-header:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bibliography-content {
  padding: 2rem 0;
  animation: slideDown 0.3s ease-out;
  max-width: 100%;
  overflow-x: auto;
}

.bibliography-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bibliography-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.bibliography-text {
  flex: 1;
  min-width: 0;
}

.bibliography-title {
  margin: 0;
  color: #1a202c;
  font-size: 1.4rem;
  word-break: break-word;
}

.bibliography-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}

.expand-indicator {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

details[open] .expand-indicator {
  transform: rotate(180deg);
}

.source-category {
  margin-bottom: 2.5rem;
}

.source-category h4 {
  color: var(--accent-purple, #667eea);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.source-entry {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.source-entry:last-child {
  border-bottom: none;
}

.source-citation {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.source-usage {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.usage-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  background: linear-gradient(135deg, #e11d48, #7209b7);
  color: white;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-height: 32px;
  transition: all 0.2s ease;
}

.usage-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.usage-note {
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}

.citation-note {
  background: #f8f9ff;
  border: 1px solid #d0d8ff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.citation-note p {
  margin: 0.5rem 0;
}

/* Enhanced bibliography variant */
.bibliography-section.enhanced {
  margin: 3rem 0;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.bibliography-section.enhanced .bibliography-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-rose));
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  margin: 0;
}

.bibliography-section.enhanced .bibliography-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.bibliography-section.enhanced .bibliography-icon {
  font-size: 2rem;
  color: white;
}

.bibliography-section.enhanced .bibliography-title {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
}

.bibliography-section.enhanced .bibliography-subtitle {
  margin: 0.25rem 0 0 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
}

.bibliography-section.enhanced .bibliography-content {
  padding: 2rem;
  background: #f8fafc;
}

.bibliography-section.enhanced .source-category h4 {
  color: var(--accent-purple);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-gold);
}

.bibliography-section.enhanced .source-entry {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border-left: 3px solid var(--accent-purple);
  border-bottom: none;
}

.bibliography-section.enhanced .expand-indicator svg {
  color: white;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeSlideDown {
  from { 
    opacity: 0; 
    transform: translateY(var(--slide-distance, 20px)); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes fadeSlideLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: transform, opacity;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  animation: fadeSlideDown 0.6s ease-out;
}

.fade-slide-down {
  animation: fadeSlideDown 0.6s ease-out;
}

.fade-slide-left {
  animation: fadeSlideLeft 0.6s ease-out;
}

/* Timeline animations */
.timeline-item {
  position: relative;
  padding: 1rem 1rem 1rem 1.5rem;
  margin-bottom: 1rem;
  opacity: 1;
  transform: translateX(0);
  border-left: 3px solid transparent;
  background: rgba(248, 250, 252, 0.5);
  border-radius: 0 8px 8px 0;
  transition: all 0.3s ease;
  animation: fadeSlideLeft 0.6s ease-out backwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease-in;
}

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

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* Animation utilities */
.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-500 { animation-delay: 0.5s; }

/* ============================================
   UI ELEMENTS
   ============================================ */
.section-divider { 
  height: 2px; 
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
  margin: 3rem 0; 
  border: 0; 
}

.note { 
  font-size: .9rem; 
  color: var(--muted); 
  font-style: italic;
  margin-top: 1rem;
}

.cross-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent-blue);
  transition: all 0.2s;
  text-decoration: none;
  margin: 0.25rem;
}

.cross-ref:hover {
  background: var(--accent-blue);
  color: white;
  transform: translateX(2px);
}

/* ============================================
   PROGRESS INDICATORS
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-rose));
  z-index: 1001;
  transition: width 0.2s ease;
  width: 0%;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(114, 9, 183, 0.3);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(114, 9, 183, 0.4);
}

/* ============================================
   QUICK NAVIGATION SIDEBAR
   ============================================ */
.quick-nav-sidebar {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 500;
}

@media (min-width: 1400px) {
  .quick-nav-sidebar {
    display: flex;
  }
}

.quick-nav-item {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-light);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.quick-nav-item:hover,
.quick-nav-item.active {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
  transform: scale(1.5);
}

.quick-nav-item::before {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-dark);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.quick-nav-item:hover::before {
  opacity: 1;
}

/* ============================================
   BUTTONS
   ============================================ */
.primary-button {
  background: var(--primary-dark);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid transparent;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.secondary-button {
  background: transparent;
  color: var(--primary-dark);
  padding: 1rem 2rem;
  border: 2px solid var(--primary-dark);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.secondary-button:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Cosmic gradient buttons - matching logo colors */
.cosmic-button {
  background: linear-gradient(135deg, var(--cosmic-cyan) 0%, var(--cosmic-blue) 30%, var(--cosmic-indigo) 70%, var(--cosmic-magenta) 100%);
  color: #001B3A;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  box-shadow: 0 4px 15px rgba(62,228,255,0.25);
}

.cosmic-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(62,228,255,0.4);
  filter: brightness(1.05);
}

.cosmic-button.muted {
  background: linear-gradient(135deg, #5BC0D6 0%, #6A9FD9 30%, #7B6BBD 70%, #8E7BB8 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(107,107,189,0.2);
}

.cosmic-button.muted:hover {
  box-shadow: 0 8px 25px rgba(107,107,189,0.35);
  filter: brightness(1.08);
}

/* Tab Buttons */
.tab-button {
  padding: 0.6rem 1.25rem;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  color: #6b7280;
  cursor: pointer;
  font-weight: 600;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-button:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
  background: linear-gradient(135deg, #e11d48, #7209b7);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
  transform: translateY(0);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }

.text-center { text-align: center; }
.text-muted { color: var(--text-gray); }
.font-bold { font-weight: 700; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-gray);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.empty-state-subtext {
  font-size: 1rem;
  opacity: 0.8;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #2c2c2c 100%);
  color: var(--primary-light);
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 6rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(114, 9, 183, 0.1) 0%, transparent 70%);
}

footer p {
  position: relative;
  z-index: 1;
}

/* ============================================
   CHARACTER PROFILE COMPONENTS
   ============================================ */
.hebrew, .hebrew-large {
  font-family: 'SBL Hebrew', 'Ezra SIL', serif;
  direction: rtl;
  unicode-bidi: embed;
  color: var(--accent-purple);
}

.greek, .greek-large {
  font-family: 'SBL Greek', 'Times New Roman', serif;
  direction: ltr;
  unicode-bidi: normal;
  color: var(--accent-purple);
}

.hebrew-large, .greek-large {
  font-size: 1.5rem;
  font-weight: bold;
}

.hebrew-inline, .greek-inline {
  display: inline-block;
  padding: 0 0.3rem;
  color: var(--accent-purple);
}

.hebrew-inline {
  font-family: 'SBL Hebrew', 'Ezra SIL', serif;
  direction: rtl;
  unicode-bidi: embed;
}

.greek-inline {
  font-family: 'SBL Greek', 'Times New Roman', serif;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 1.5rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
  border-radius: 2px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.35rem;
  top: 1.3rem;
  width: 10px;
  height: 10px;
  background: var(--accent-purple);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(114, 9, 183, 0.2);
  transition: all 0.3s ease;
}

.timeline-item:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left-color: var(--accent-gold);
  transform: translateX(5px);
}

.timeline-item:hover::before {
  background: var(--accent-rose);
  transform: scale(1.3);
  box-shadow: 0 0 0 5px rgba(225, 29, 72, 0.2);
}

/* Chiasm Structure */
.chiasm-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px -1px var(--shadow);
}

.chiasm-card h3 {
  margin: .1rem 0 1rem;
  color: #1a202c;
  font-size: 1.4rem;
  font-weight: 700;
}

.chiasm-structure {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: linear-gradient(135deg, var(--panel) 0%, #f9fafb 100%);
  border: 2px dashed var(--ring);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1rem 0;
}

.chiasm-line {
  padding: .3rem 0;
  transition: background 0.2s;
}

.chiasm-center {
  padding: .75rem 1rem;
  margin: .75rem 0;
  border-left: 4px solid var(--accent-blue);
  background: linear-gradient(90deg, #ecfeff 0%, #cffafe 100%);
  border-radius: 8px;
  font-weight: 600;
}

.indent-1 { padding-left: 1.5rem; }
.indent-2 { padding-left: 3rem; }
.indent-3 { padding-left: 4.5rem; }
.indent-4 { padding-left: 6rem; }

/* Word Study */
.word-study {
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border: 1px solid #fbbf24;
  margin: 1.5rem 0;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
}

.word-study h4 {
  margin: .5rem 0 .75rem;
  color: #92400e;
}

/* Fixed nav spacing for character profiles */
.character-profile .content-section,
.character-profile main {
  padding-top: 0;
}

/* Character Type Badge */
.character-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--info) 0%, #60a5fa 100%);
  color: white;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 1rem 0;
}

/* Complexity Indicator */
.complexity-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.complexity-indicator .label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.875rem;
}

.complexity-level {
  display: flex;
  gap: 0.25rem;
}

.complexity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-light);
}

.complexity-dot.filled {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
}

/* Study Questions */
.question-list {
  counter-reset: question;
  list-style: none;
  padding: 0;
}

.question-list li {
  counter-increment: question;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
  color: #475569;
  line-height: 1.7;
}

.question-list li::before {
  content: counter(question);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--panel);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-purple);
  border: 1px solid var(--border-light);
}

/* Song Links */
.song-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-rose) 100%);
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin: 0.25rem;
  transition: all 0.2s;
}

.song-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(114, 9, 183, 0.3);
}

/* Nav grid */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  transition: all 0.2s;
  min-height: 60px;
}

.nav-button:hover {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-rose));
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  /* Mobile nav logo size - reduced to prevent text wrap */
  .logo-icon img {
    height: 58px;
  }
  
  /* Prevent logo text from wrapping */
  .logo {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  
  .logo-text {
    white-space: nowrap;
    font-size: 1.25rem;
  }
  
  .nav-links {
    position: fixed;
    top: 65px;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links.active {
    right: 0;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .dropdown-content {
    position: static;
    display: block;
    box-shadow: none;
    background: var(--bg-gray);
    margin-left: 1rem;
    margin-top: 0.5rem;
    border-radius: 0;
    border: none;
    border-left: 2px solid var(--border-light);
  }
  
  .dropdown-toggle::after {
    display: none;
  }
  
  .content-section {
    padding: 2rem 1rem 2rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
  
  .indent-1 { padding-left: 1rem; }
  .indent-2 { padding-left: 2rem; }
  .indent-3 { padding-left: 3rem; }
  .indent-4 { padding-left: 4rem; }
  
  /* Enhanced dropdown states for mobile */
  .nav-links .dropdown.active .dropdown-content {
    display: block !important;
  }
  
  .nav-links .dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
  }
  
  /* Mobile nav dropdown tap-friendly */
  .nav-links .dropdown .dropdown-content {
    display: none;
    margin: 0.25rem 0 0.5rem 0;
    padding: 0.25rem 0;
    border-left: 3px solid var(--border-light);
    background: #fafafa;
  }

  .nav-links .dropdown:focus-within .dropdown-content {
    display: block;
  }

  .nav-links .dropdown > .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    padding: 0.75rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
  }

  .nav-links .dropdown > .dropdown-toggle::after {
    content: '▸';
    margin-left: 0.5rem;
    transition: transform .2s ease;
  }
  
  .nav-links .dropdown:focus-within > .dropdown-toggle::after {
    transform: rotate(90deg);
  }

  .nav-links .dropdown .dropdown-content a {
    padding: 0.6rem 0.75rem 0.6rem 1.25rem;
    border-radius: 6px;
    margin: 0.15rem 0;
  }

  .nav-links a {
    min-height: 48px;
    padding: 0.75rem;
  }
  
  /* Page navigation mobile */
  .page-navigation {
    border-top: 1px solid #d0d8ff;
    border-bottom: 1px solid #d0d8ff;
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin-left: -1rem;
    margin-right: -1rem;
  }
  
  .page-nav-item {
    text-align: left;
  }
  
  .nav-footer-grid {
    grid-template-columns: 1fr;
  }
  
  .bibliography-header {
    padding: 1rem;
    border-radius: 8px;
  }
  
  .bibliography-title {
    font-size: 1.1rem;
  }
  
  .bibliography-subtitle {
    font-size: 0.85rem;
  }
  
  .bibliography-content {
    padding: 1rem 0;
  }
  
  .source-usage {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .tab-nav {
    gap: 0.5rem;
  }
  
  .tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-height: 40px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .logo-icon img {
    height: 36px;
  }
  
  .logo-text {
    font-size: 1.1rem;
  }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

body.menu-open {
  overflow: hidden;
}

/* About page special styling */
body.about-page .section-title {
  background: linear-gradient(135deg, var(--bg-soft, #f0f4ff), #e8eeff);
  border: 2px solid var(--accent-blue, #4a5fff);
  padding: 1rem 1.25rem;
  border-radius: 1rem;
}
/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  nav, .mobile-menu-toggle, .reading-progress, 
  .skip-link, .back-to-top, .quick-nav-sidebar, footer {
    display: none;
  }
  
  .theology-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
  
  details[open] summary ~ * {
    display: block !important;
  }
}