*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-hover: #F1F5F9;
  --text: #1E293B;
  --text-soft: #64748B;
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-light: #EEF2FF;
  --border: #E2E8F0;
  --gold: #D97706;
  --gold-light: #FEF3C7;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --max-w: 800px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #1E293B;
  --surface-hover: #334155;
  --text: #F8FAFC;
  --text-soft: #94A3B8;
  --accent: #818CF8;
  --accent-hover: #A5B4FC;
  --accent-light: rgba(79, 70, 229, 0.15);
  --border: #334155;
  --gold: #FCD34D;
  --gold-light: rgba(217, 119, 6, 0.1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1120;
    --surface: #1E293B;
    --surface-hover: #334155;
    --text: #F8FAFC;
    --text-soft: #94A3B8;
    --accent: #818CF8;
    --accent-hover: #A5B4FC;
    --accent-light: rgba(79, 70, 229, 0.15);
    --border: #334155;
    --gold: #FCD34D;
    --gold-light: rgba(217, 119, 6, 0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.5);
  }
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle at 100% 0%, var(--accent-light) 0%, transparent 600px);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  padding: 24px 0;
  margin-bottom: 40px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 10px;
  flex-shrink: 0;
}
.logo .logo-icon svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); }
.logo .logo-text { -webkit-text-fill-color: var(--text); }
.logo .logo-bible { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
header nav { font-family: var(--font-sans); font-size: 15px; font-weight: 500; display: flex; align-items: center; }
header nav a {
  color: var(--text-soft);
  text-decoration: none;
  margin-left: 24px;
  transition: color 0.2s;
}
header nav a:hover { color: var(--accent); }

.lang-select {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: 8px;
}
.lang-select:hover { border-color: var(--accent); color: var(--accent); }
.lang-select option { background: var(--surface); color: var(--text); }

.theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  cursor: pointer;
  margin-left: 20px;
  padding: 6px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { color: var(--accent); background: var(--surface-hover); }
[data-theme="dark"] .moon-icon { display: none; }
:root:not([data-theme="dark"]) .sun-icon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .moon-icon { display: none; }
  :root:not([data-theme="light"]) .sun-icon { display: block; }
}

/* Breadcrumbs */
.breadcrumb {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 24px;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.breadcrumb a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
.breadcrumb a:hover { opacity: 0.8; }
.breadcrumb .sep { margin: 0 8px; opacity: 0.4; }

/* Typography */
h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  margin-bottom: 8px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 48px 0 24px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.subtitle {
  font-size: 1.125rem;
  color: var(--text-soft);
  margin-bottom: 32px;
}

/* Verse display */
.verses {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.verse-block {
  padding: 12px 0;
  margin: 4px 0;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.verse-block:hover {
  background: var(--surface-hover);
  transform: translateX(4px);
}
.verse-link { color: inherit; text-decoration: none; display: block; padding: 0 12px; }
.vn {
  font-family: var(--font-sans);
  font-size: 0.7em;
  font-weight: 700;
  color: var(--accent);
  vertical-align: super;
  margin-right: 6px;
  user-select: none;
  opacity: 0.8;
}

/* Verse of the Day */
.votd-section { margin: 32px 0; }
.votd-card { display: block; text-decoration: none; color: inherit; transition: transform 0.2s; }
.votd-card:hover { transform: translateY(-2px); }
.votd-ref { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent); margin-top: 12px; text-align: right; }
.votd-explanation { font-size: 15px; color: var(--text-soft); line-height: 1.6; margin-top: 8px; }

/* Explore Scripture */
.explore-section { margin: 32px 0; }
.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.explore-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; text-decoration: none; color: inherit; transition: transform 0.2s, box-shadow 0.2s; box-shadow: var(--shadow-sm); }
.explore-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.explore-text { font-size: 15px; line-height: 1.6; color: var(--text-soft); font-style: italic; }
.explore-ref { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--accent); margin-top: 12px; }
@media (max-width: 768px) { .explore-grid { grid-template-columns: 1fr; } }

/* Featured verse (verse page) */
.featured-verse {
  font-size: 1.5rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: 32px 0;
  position: relative;
  border: 1px solid var(--border);
}
.featured-verse::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 20px;
  font-family: var(--font-display);
  font-size: 80px;
  color: var(--gold);
  opacity: 0.2;
  line-height: 1;
}

/* AI content cards */
.insight-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  margin: 24px 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.insight-card h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.insight-card h3::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.insight-card p { font-size: 1.05rem; line-height: 1.8; color: var(--text-soft); }

/* Prayer card */
.prayer-card { border-left: 4px solid var(--gold); }
.prayer-text { font-style: italic; }

/* Devotional card */
.devotional-card { border-left: 4px solid var(--accent); }

/* Sermon outline */
.sermon-outline { padding-left: 20px; }
.sermon-outline li { margin-bottom: 16px; line-height: 1.7; color: var(--text-soft); font-size: 1.05rem; }
.sermon-outline strong { color: var(--text); font-family: var(--font-display); }

/* Reading plan */
.reading-plan { padding-left: 20px; }
.reading-plan li { margin-bottom: 12px; line-height: 1.6; color: var(--text-soft); font-size: 1rem; }
.reading-plan a { color: var(--accent); text-decoration: none; font-weight: 600; }
.reading-plan a:hover { text-decoration: underline; }

/* Share card */
.social-caption { font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; }
.copy-btn {
  font-family: var(--font-sans);
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.copy-btn:hover { background: var(--accent-hover); }

/* Topics */
.topics { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.tag {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--accent-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.tag:hover { border-color: var(--accent); color: var(--surface); background: var(--accent); transform: translateY(-1px); }

/* FAQ */
.faq { margin: 32px 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--surface);
  transition: all 0.2s ease;
  overflow: hidden;
}
.faq details[open] { box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.faq summary {
  padding: 20px 24px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 20px;
  color: var(--text-soft);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 24px 24px; font-size: 16px; line-height: 1.7; color: var(--text-soft); }

/* Cross references */
.cross-refs { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.cross-refs a {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}
.cross-refs a:hover { background: var(--accent); color: white; border-color: var(--accent); transform: translateY(-1px); }

/* Chapter navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-weight: 600;
}
.chapter-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chapter-nav a:hover { background: var(--surface-hover); color: var(--accent); border-color: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Compare table */
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 16px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--surface); }
.compare-table th, .compare-table td { padding: 20px 24px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.compare-table th { background: var(--surface-hover); font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; width: 25%; }
.compare-table tr:last-child td, .compare-table tr:last-child th { border-bottom: none; }
.compare-table td { line-height: 1.7; color: var(--text-soft); }

/* Cards grid (translations, languages, books) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 24px 0 48px;
}
.card-grid a {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.card-grid a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: var(--accent);
}
.card-grid small {
  color: var(--text-soft);
  margin-left: auto;
  font-weight: 500;
  font-size: 13px;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4); }

/* Compare link */
.compare-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 32px;
  padding: 18px 24px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}
.compare-cta:hover { background: var(--accent-light); border-color: var(--accent); border-style: solid; }

/* Ads integration styles */
.ad-unit {
  margin: 40px 0;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-placeholder { margin: 20px 0; }

/* Amazon contextual links */
.amazon-section { margin: 36px 0; }
.amazon-heading {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}
.amazon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.amazon-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}
.amazon-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.amazon-card-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.amazon-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.amazon-card-arrow {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--gold);
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.2s;
}
.amazon-card:hover .amazon-card-arrow { opacity: 1; }
.amazon-disclosure {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 10px;
  opacity: 0.6;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 48px 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-soft);
}
footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
footer p { margin: 8px 0; }

/* Hero (homepage) */
.hero {
  text-align: center;
  padding: 64px 0 32px;
}
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
.hero p {
  font-size: 1.25rem;
  color: var(--text-soft);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* RTL support */
[dir="rtl"] body { font-family: 'Noto Sans Arabic', 'Noto Sans Hebrew', var(--font-sans); }
[dir="rtl"] .breadcrumb .sep { transform: scaleX(-1); display: inline-block; }
[dir="rtl"] header nav a { margin-left: 0; margin-right: 24px; }
[dir="rtl"] .featured-verse::before { left: auto; right: 20px; }
[dir="rtl"] .verse-block:hover { transform: translateX(-4px); }
[dir="rtl"] .vn { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .chapter-nav { flex-direction: row-reverse; }
[dir="rtl"] .card-grid small { margin-left: 0; margin-right: auto; }

/* Unicode rendering */
.verse-link, .verse-block, .featured-verse, .compare-table td {
  unicode-bidi: plaintext;
  text-rendering: optimizeLegibility;
}

@media (max-width: 768px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 40px 0 20px; }
  .hero h1 { font-size: 2.5rem; }
  h1 { font-size: 1.75rem; }
  .featured-verse { font-size: 1.25rem; padding: 24px; margin: 24px 0; }
  .verses { padding: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .amazon-box { flex-direction: column; text-align: center; gap: 16px; padding: 24px; }
  .chapter-nav { flex-direction: column; gap: 16px; }
  .chapter-nav a { width: 100%; justify-content: center; }
}
