/* CSS Custom Properties for Theme Variables */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --text-primary: #f4f4f4;
  --text-secondary: #d4c5a9;
  --text-accent: #c9a961;
  --border-color: rgba(196, 169, 97, 0.3);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --button-bg: linear-gradient(135deg, #c9a961, #d4c5a9);
  --button-hover: linear-gradient(135deg, #b8984d, #c2b396);
  --glass-bg: rgba(255, 255, 255, 0.1);
}

/* Light Theme */
.theme-light {
  --bg-primary: #fefcfa;
  --bg-secondary: #f0f2f5;
  --bg-tertiary: #f0ead6;
  --text-primary: #2c2c2c;
  --text-secondary: #6b7280;
  --text-accent: #4338ca;
  --text-gold: #a67c00;
  --border-color: rgba(139, 69, 19, 0.3);
  --button-bg: linear-gradient(135deg, #c4a661 0%, #d4c5a9 100%);
  --glass-bg: rgba(254, 252, 247, 0.2);
  --shadow-color: rgba(44, 24, 16, 0.15);
  --section-bg-1: rgba(196, 166, 97, 0.08);
  --section-bg-2: rgba(212, 197, 169, 0.1);
  --section-bg-3: rgba(184, 134, 11, 0.08);
}

/* Dark Theme */
.theme-dark {
  --bg-primary: #1a1410;
  --bg-secondary: rgba(26, 20, 16, 0.9);
  --bg-tertiary: #0f0c08;
  --text-primary: #f4f1eb;
  --text-secondary: #d4c5a9;
  --text-accent: #c4a661;
  --text-gold: #daa520;
  --border-color: rgba(196, 166, 97, 0.3);
  --button-bg: linear-gradient(135deg, #c4a661 0%, #d4c5a9 100%);
  --glass-bg: rgba(26, 20, 16, 0.15);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --section-bg-1: rgba(196, 166, 97, 0.08);
  --section-bg-2: rgba(212, 197, 169, 0.1);
  --section-bg-3: rgba(218, 165, 32, 0.08);
}

html {
  scroll-behavior: smooth;
}

/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Cinzel:wght@400;500;600&display=swap');

/* Base Styles */
html, body {
  /* one rule only */
  transition: background-color .3s ease, color .3s ease;
}

/* Dark theme background (default) */
body.theme-dark {
  background: linear-gradient(135deg, #1a1410 0%, #0f0c08 50%, #1a1410 100%);
  color: #f4f1eb;
}

body.theme-dark::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at top left, rgba(26, 32, 46, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at top right, rgba(15, 52, 96, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at bottom center, rgba(22, 33, 62, 0.5) 0%, transparent 70%),
    linear-gradient(135deg, rgba(26, 26, 46, 0.6) 0%, rgba(22, 33, 62, 0.8) 50%, rgba(15, 52, 96, 0.7) 100%);
  pointer-events: none;
  z-index: -1;
  animation: gradientShift 20s ease-in-out infinite;
}

/* Light theme background */
body.theme-light {
  background: linear-gradient(135deg, #f8f6f2 0%, #ede7d6 50%, #e6dcc7 100%);
  color: #2c2c2c;
}

body.theme-light::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at top left, rgba(240, 228, 205, 0.7) 0%, transparent 50%),
    radial-gradient(ellipse at top right, rgba(232, 225, 205, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse at bottom center, rgba(235, 220, 190, 0.8) 0%, transparent 70%),
    linear-gradient(135deg, rgba(245, 240, 225, 0.9) 0%, rgba(235, 228, 205, 0.95) 50%, rgba(225, 215, 185, 0.9) 100%);
  pointer-events: none;
  z-index: -1;
  animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% {
    filter: hue-rotate(0deg) brightness(1);
  }
  25% {
    filter: hue-rotate(5deg) brightness(1.05);
  }
  50% {
    filter: hue-rotate(-3deg) brightness(0.98);
  }
  75% {
    filter: hue-rotate(8deg) brightness(1.02);
  }
}

/* Typography */
.font-cinzel {
  font-family: 'Cinzel', serif;
}

.font-crimson {
  font-family: 'Crimson Text', serif;
}

.text-shadow {
  text-shadow: 2px 2px 4px var(--shadow-color);
}

/* App Title Styling */
.intersessions-title {
  color: var(--text-accent) !important;
  font-family: 'Cinzel', serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-shadow: 2px 2px 4px var(--shadow-color) !important;
  display: block !important;
}

/* Theme-specific title colors */
.theme-dark .intersessions-title {
  color: #c4a661 !important;
}

.theme-light .intersessions-title {
  color: #8b4513 !important;
}

/* Theme-specific text colors */
.theme-light p,
.theme-light .text-lg,
.theme-light .text-sm {
  color: #4a4a4a !important;
}

.theme-light .opacity-80 {
  color: #6b7280 !important;
}

.theme-light .opacity-70 {
  color: #9ca3af !important;
}

.theme-dark p,
.theme-dark .text-lg,
.theme-dark .text-sm {
  color: #f4f1eb !important;
}

.theme-dark .opacity-80 {
  color: #d4c5a9 !important;
}

.theme-dark .opacity-70 {
  color: #b8b8b8 !important;
}
  visibility: visible !important;
  font-size: 3rem !important;
  line-height: 1.1 !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

#landing h1 {
  color: var(--text-accent);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-shadow: 2px 2px 4px var(--shadow-color);
  font-size: 3rem;
  line-height: 1.1;
}

/* Theme Toggle Button */
#theme-toggle {
  background: var(--glass-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
  font-size: 1.2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Landing Page */
#landing {
  background: transparent;
}

/* Sin Buttons */
.sin-button {
  background: 
    linear-gradient(135deg, 
      rgba(196, 166, 97, 0.9) 0%, 
      rgba(212, 197, 169, 0.85) 50%,
      rgba(201, 169, 97, 0.9) 100%);
  color: var(--bg-primary);
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(196, 166, 97, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.sin-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.sin-button:hover::before {
  left: 100%;
}

.sin-button:hover {
  background: 
    linear-gradient(135deg, 
      rgba(196, 166, 97, 1) 0%, 
      rgba(212, 197, 169, 0.95) 50%,
      rgba(201, 169, 97, 1) 100%);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(196, 166, 97, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}

/* Back Button */
#back {
  background: var(--glass-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
}

/* Deck Styles */
#deck {
  background: transparent;
  perspective: 1200px;
  overflow-x: hidden;
}

/* Enhanced parallax layers with more depth */
.snap-section:nth-child(2n) {
  transform: translateZ(-30px) scale(1.025);
}

.snap-section:nth-child(2n+1) {
  transform: translateZ(15px) scale(0.99);
}

.snap-section:nth-child(3n) {
  transform: translateZ(-15px) scale(1.012);
}

.snap-section:hover::before {
  backdrop-filter: blur(35px) saturate(200%);
  -webkit-backdrop-filter: blur(35px) saturate(200%);
  transform: translate(-50%, -50%) scale(1.02);
  background: 
    linear-gradient(135deg, 
      rgba(255, 255, 255, 0.18) 0%, 
      rgba(255, 255, 255, 0.12) 25%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.12) 75%,
      rgba(255, 255, 255, 0.18) 100%);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 20px 80px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15);
}

.snap-section {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
  margin: -4px 0;
  position: relative;
  transform-style: preserve-3d;
}

/* Add a 6 px indicator strip on active card background (optional) */
.snap-section[data-active="true"] {
  background-image: linear-gradient(to bottom right, #2d3748, #4c1d95);
}

.snap-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 520px;
  height: 85%;
  background: 
    linear-gradient(135deg, 
      rgba(255, 255, 255, 0.12) 0%, 
      rgba(255, 255, 255, 0.08) 25%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.08) 75%,
      rgba(255, 255, 255, 0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  z-index: -1;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 16px 64px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Light theme glass card enhancement */
body.theme-light .snap-section::before {
  background: 
    linear-gradient(135deg, 
      rgba(255, 255, 255, 0.7) 0%, 
      rgba(254, 252, 247, 0.65) 25%,
      rgba(248, 245, 239, 0.6) 50%,
      rgba(254, 252, 247, 0.65) 75%,
      rgba(255, 255, 255, 0.7) 100%);
  border: 1px solid rgba(139, 69, 19, 0.15);
  backdrop-filter: blur(15px) saturate(110%);
  -webkit-backdrop-filter: blur(15px) saturate(110%);
  box-shadow: 
    0 8px 32px rgba(44, 24, 16, 0.1),
    0 16px 64px rgba(44, 24, 16, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(139, 69, 19, 0.08);
}


.snap-section h2 {
  font-family: 'Cinzel', serif;
  color: var(--text-accent);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.snap-section p {
  font-family: 'Crimson Text', serif;
  line-height: 1.7;
  text-align: center;
  max-width: 400px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Saint name styling */
.snap-section:first-child h2 {
  font-size: 2rem;
  color: var(--text-accent);
  text-shadow: 2px 2px 4px var(--shadow-color);
}

/* Bio section */
.snap-section:nth-child(2) {
  background-image: radial-gradient(circle at center, var(--section-bg-1) 0%, transparent 70%);
}

/* Words of Wisdom section */
.snap-section:nth-child(3) {
  background-image: radial-gradient(circle at center, var(--section-bg-2) 0%, transparent 70%);
}

.quotes-container {
  max-width: 450px;
  text-align: center;
}

.snap-section:nth-child(3) p:first-child {
  font-style: italic;
  font-size: 1.2rem;
  position: relative;
  color: var(--text-secondary);
}

.snap-section:nth-child(3) p:first-child::before,
.snap-section:nth-child(3) p:first-child::after {
  content: '"';
  font-size: 1.5rem;
  color: var(--text-accent);
  font-weight: 600;
}

.snap-section:nth-child(3) p:last-child {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--text-accent);
  margin-top: 1rem;
}

/* Gospel section */
.snap-section:nth-child(4) {
  background-image: radial-gradient(circle at center, var(--section-bg-1) 0%, transparent 70%);
}

.snap-section:nth-child(4) p {
  font-style: italic;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.8;
  text-shadow: 1px 1px 2px var(--shadow-color);
}

.snap-section:nth-child(4) h2 {
  color: var(--text-accent);
  text-shadow: 2px 2px 4px var(--shadow-color);
}

/* Psalms section */
.snap-section:nth-child(5) {
  background-image: radial-gradient(circle at center, var(--section-bg-2) 0%, transparent 70%);
}

.snap-section:nth-child(5) p {
  font-style: italic;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.8;
}

.snap-section:nth-child(5) h2 {
  color: var(--text-accent);
  text-shadow: 2px 2px 4px var(--shadow-color);
}

/* Catechism section */
.snap-section:nth-child(6) {
  background-image: radial-gradient(circle at center, var(--section-bg-3) 0%, transparent 70%);
}

/* Prayer section */
.snap-section:nth-child(7) {
  background-image: radial-gradient(circle at center, var(--section-bg-1) 0%, transparent 70%);
}

.snap-section:nth-child(7) p {
  font-style: italic;
  color: var(--text-secondary);
  font-weight: 500;
}

.snap-section:nth-child(7) h2 {
  color: var(--text-accent);
  text-shadow: 2px 2px 4px var(--shadow-color);
}

/* Scrollbar Styling */
#deck::-webkit-scrollbar {
  width: 8px;
}

#deck::-webkit-scrollbar-track {
  background: var(--glass-bg);
  border-radius: 4px;
}

#deck::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

#deck::-webkit-scrollbar-thumb:hover {
  background: var(--text-accent);
}

/* Responsive Design */
@media (max-width: 640px) {
  .intersections-title,
  #landing h1 {
    font-size: 2.25rem !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
  }
  
  .snap-section {
    padding: 1.5rem;
  }

  .snap-section h2 {
    font-size: 1.5rem;
  }

  .snap-section p {
    font-size: 1rem;
  }

  .sin-button {
    font-size: 0.9rem;
    padding: 0.875rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .intersections-title,
  #landing h1 {
    font-size: 1.875rem !important;
    letter-spacing: 0.025em !important;
  }
  
  #landing .text-center {
    padding: 0 1rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

/* Transition Classes */
.transition-colors {
  transition: background-color 0.3s ease, color 0.3s ease;
}