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

body {
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.light-mode {
  background-color: #FAF6F0;
  color: #3B2F2F;
}

body.dark-mode {
  background-color: #1C1A17;
  color: #EDE6DB;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: 
    radial-gradient(circle at 20% 30%, #C49A3C 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, #C49A3C 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, #C49A3C 0.5px, transparent 0.5px);
  background-size: 120px 120px, 150px 150px, 80px 80px;
}

.dark-mode body::before {
  opacity: 0.015;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.light-mode ::-webkit-scrollbar-thumb {
  background: #C49A3C40;
  border-radius: 3px;
}

.dark-mode ::-webkit-scrollbar-thumb {
  background: #D4A84340;
  border-radius: 3px;
}

/* Decorative wave divider */
.wave-divider {
  height: 6px;
  background: linear-gradient(90deg, transparent 0%, #C49A3C30 20%, #C49A3C60 50%, #C49A3C30 80%, transparent 100%);
  position: relative;
}

.wave-divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 8px,
    #FAF6F0 8px,
    #FAF6F0 10px
  );
}

.dark-mode .wave-divider::after {
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 8px,
    #1C1A17 8px,
    #1C1A17 10px
  );
}

/* Smooth transitions */
.fade-enter {
  opacity: 0;
  transform: translateY(8px);
}

.fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Commentary card animation */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    max-height: 600px;
    transform: translateY(0);
  }
}

.commentary-enter {
  animation: slideDown 0.4s ease forwards;
}

/* Verse highlight */
.verse-highlight {
  background: linear-gradient(to bottom, transparent 60%, #C49A3C30 60%);
  cursor: pointer;
  transition: background 0.2s ease;
}

.dark-mode .verse-highlight {
  background: linear-gradient(to bottom, transparent 60%, #D4A84330 60%);
}

.verse-highlight:hover {
  background: linear-gradient(to bottom, transparent 40%, #C49A3C50 40%);
}

/* Sidebar slide animation */
@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slideOut {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.sidebar-open {
  animation: slideIn 0.3s ease forwards;
}

.sidebar-close {
  animation: slideOut 0.3s ease forwards;
}

/* Bookmark heart animation */
@keyframes heartBeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.bookmark-animate {
  animation: heartBeat 0.5s ease;
}

/* Tooltip */
.tooltip-content {
  position: absolute;
  z-index: 50;
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 300px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}

.tooltip-content.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.light-mode .tooltip-content {
  background: #FFF8EE;
  border: 1px solid #C49A3C40;
  color: #3B2F2F;
}

.dark-mode .tooltip-content {
  background: #302B26;
  border: 1px solid #D4A84340;
  color: #EDE6DB;
}

/* Mobile bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid;
}

.light-mode .bottom-nav {
  background: #FAF6F0;
  border-color: #C49A3C30;
}

.dark-mode .bottom-nav {
  background: #1C1A17;
  border-color: #D4A84330;
}

/* Reading progress dot */
.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

/* Chapter grid */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 4px;
}

.chapter-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.light-mode .chapter-btn {
  background: #FAF6F0;
  color: #3B2F2F;
}

.light-mode .chapter-btn:hover {
  background: #C49A3C20;
}

.light-mode .chapter-btn.active {
  background: #C49A3C;
  color: white;
}

.light-mode .chapter-btn.read {
  background: #C49A3C15;
}

.dark-mode .chapter-btn {
  background: #2A2520;
  color: #EDE6DB;
}

.dark-mode .chapter-btn:hover {
  background: #D4A84320;
}

.dark-mode .chapter-btn.active {
  background: #D4A843;
  color: #1C1A17;
}

.dark-mode .chapter-btn.read {
  background: #D4A84315;
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Logo SVG styling */
.nsbt-logo {
  transition: fill 0.3s ease;
}

.light-mode .nsbt-logo {
  fill: #B8860B;
}

.dark-mode .nsbt-logo {
  fill: #D4A843;
}