/* ==========================================================================
   Assemblies of God - Digital Swipeable Booklet & Program Viewer
   Royal Blue & Gold Luxury Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #061322;
  --bg-secondary: #0a1e36;
  --bg-surface: #0f2b4c;
  --bg-card: rgba(14, 37, 65, 0.85);
  
  /* Gold Palette */
  --gold-300: #fceda8;
  --gold-400: #e5bf5c;
  --gold-500: #d4af37;
  --gold-600: #b38e22;
  --gold-gradient: linear-gradient(135deg, #fceda8 0%, #d4af37 50%, #aa8018 100%);
  --gold-glow: 0 0 20px rgba(212, 175, 55, 0.4);

  /* Blue Accents */
  --blue-accent: #2563eb;
  --royal-gradient: linear-gradient(180deg, #05101d 0%, #091c33 50%, #061426 100%);
  
  /* Text & Borders */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: var(--royal-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* App Wrapper */
.booklet-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 19, 34, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.church-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  object-fit: contain;
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold-400);
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-gold);
  color: var(--gold-300);
}

/* ==========================================================================
   Progress Bar & Page Status Header
   ========================================================================== */
.page-status-strip {
  background: #081a2f;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.page-counter {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-400);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.page-counter .live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
}

.swipe-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gold-gradient);
  width: 5.55%; /* (1/18)*100 */
  transition: width 0.25s ease;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
}

/* Quick Jump Category Chips */
.quick-jump-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #071526;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border-subtle);
}

.quick-jump-bar::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover, .chip-btn.active {
  background: var(--gold-gradient);
  color: #061322;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   Main Swipeable Booklet Slider
   ========================================================================== */
.slider-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #040c17;
  padding: 0.75rem 0.5rem;
  min-height: 65vh;
  overflow: hidden;
}

.booklet-carousel {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.booklet-carousel::-webkit-scrollbar {
  display: none;
}

.page-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  user-select: none;
  position: relative;
}

.page-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.4);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}

.page-card img {
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  display: block;
  pointer-events: auto;
  border-radius: var(--radius-md);
}

/* Floating Navigation Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(6, 19, 34, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--gold-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  transition: var(--transition);
  backdrop-filter: blur(6px);
}

.nav-arrow:hover {
  background: var(--gold-gradient);
  color: #061322;
  border-color: transparent;
  transform: translateY(-50%) scale(1.08);
}

.nav-arrow.prev {
  left: 10px;
}

.nav-arrow.next {
  right: 10px;
}

.nav-arrow:disabled {
  opacity: 0.25;
  pointer-events: none;
}

/* Zoom Modal / Lightbox */
.zoom-btn-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(6, 19, 34, 0.8);
  border: 1px solid var(--border-gold);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ==========================================================================
   Thumbnail Strip Bar
   ========================================================================== */
.thumbnail-strip-wrapper {
  background: #081a2f;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

.thumbnail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.thumbnail-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-400);
  letter-spacing: 0.05em;
}

.thumbnail-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-500) transparent;
  -webkit-overflow-scrolling: touch;
}

.thumbnail-item {
  flex: 0 0 54px;
  height: 76px;
  border-radius: var(--radius-sm);
  background: #040d18;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-item.active {
  border-color: var(--gold-400);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
  transform: scale(1.06);
}

.thumbnail-page-num {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.75);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ==========================================================================
   Bottom Action Bar
   ========================================================================== */
.bottom-actions {
  background: #061322;
  border-top: 1px solid var(--border-gold);
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #061322;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--gold-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: #ffffff;
  border: 1px solid var(--border-gold);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--gold-300);
  transform: translateY(-2px);
}

/* ==========================================================================
   Modals (QR & Share)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 11, 20, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), var(--gold-glow);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #071526;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem;
  text-align: center;
}

.qr-box {
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  margin: 0.75rem 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: var(--gold-gradient);
  color: #061322;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: var(--gold-glow), 0 8px 20px rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 480px) {
  .page-card {
    max-width: 100%;
  }
  
  .page-card img {
    max-height: 64vh;
  }

  .nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}
