/**
 * Interactions & Micro-animations CSS - GBII Pertama
 * Modern, performant, lightweight CSS for interactive UI components
 */

:root {
  --interact-primary: #2563eb;
  --interact-primary-hover: #1d4ed8;
  --interact-accent: #38bdf8;
  --interact-surface: #ffffff;
  --interact-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --interact-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
  --interact-shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.14);
}

/* 1. Top Reading Scroll Progress Bar */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
  z-index: 10001;
  transition: width 0.12s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

/* 2. Dynamic Sticky Header Elevation */
.site-header {
  transition: background-color 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease !important;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08) !important;
}

/* 3. Floating Quick Action Controls (Back to Top & Quick Pastoral WhatsApp) */
.floating-actions-container {
  position: fixed;
  right: 22px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.floating-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, opacity 0.25s ease, background 0.2s ease;
  text-decoration: none;
  outline: none;
  position: relative;
}

.floating-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.floating-btn:active {
  transform: translateY(0) scale(0.96);
}

.floating-btn-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: #0f172a;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.floating-btn-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent #0f172a;
}

.floating-btn:hover .floating-btn-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Back to Top Button */
.back-to-top-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  background: #ffffff;
  color: #2563eb;
  border: 1px solid #e2e8f0;
}

.back-to-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* 4. Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* 5. Interactive Category Filter Bar (Pills) */
.interactive-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 36px auto;
}

.filter-pill {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-pill:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}

.filter-pill.is-active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

/* Card Filtering Animation */
.filterable-item {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.filterable-item.is-hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.96);
}

/* 6. Live Search Bar */
.live-search-container {
  max-width: 480px;
  margin: 0 auto 28px auto;
  position: relative;
}

.live-search-input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  font-size: 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 9999px;
  background: #ffffff;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.live-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.live-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 1.05rem;
}

.live-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  color: #475569;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
}
.live-search-clear:hover {
  background: #cbd5e1;
}

.no-results-state {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  display: none;
}
.no-results-state.is-visible {
  display: block;
}

/* 7. Interactive Accordions (for FAQs and Details) */
.accordion-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.accordion-item.is-open {
  border-color: #93c5fd;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
}

.accordion-header {
  width: 100%;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  user-select: none;
  transition: color 0.2s ease;
}

.accordion-header:hover {
  color: #2563eb;
}

.accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, color 0.2s ease;
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
  background: #eff6ff;
  color: #2563eb;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s ease;
  padding: 0 22px;
  color: #475569;
  line-height: 1.7;
}

.accordion-item.is-open .accordion-body {
  padding: 0 22px 20px 22px;
}

/* 8. Interactive Stat Counter Box */
.stat-counter-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-counter-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.07);
}
.stat-counter-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--nv-primary-accent, #2563eb);
  line-height: 1.1;
  margin-bottom: 6px;
}
.stat-counter-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}

/* 9. Interactive Copy Button & Toast Notification */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.copy-btn:hover {
  background: #2563eb;
  color: #ffffff;
}
.copy-btn:active {
  transform: scale(0.96);
}

#toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10002;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

#toast-notification.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* 10. Interactive Card Hover micro-interaction */
.interactive-card {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease !important;
}
.interactive-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1) !important;
}

@media (max-width: 640px) {
  .floating-actions-container {
    right: 16px;
    bottom: 16px;
  }
  .floating-btn {
    width: 44px;
    height: 44px;
  }
}

/* 11. Pillars Slider: Strictly horizontal scrolling only, prevent vertical jitter */
.pillars-slider {
  display: flex !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scroll-snap-type: x mandatory;
  gap: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 10px;
  padding-bottom: 22px;
  margin-top: -40px;
  align-items: stretch;
}
.pillars-slider::-webkit-scrollbar {
  display: none;
}
.pillars-slider .pillar-card {
  flex: 0 0 calc(25% - 15px);
  scroll-snap-align: start;
  min-width: 220px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
@media (max-width: 991px) {
  .pillars-slider .pillar-card {
    flex-basis: calc(50% - 10px);
  }
}
@media (max-width: 575px) {
  .pillars-slider .pillar-card {
    flex-basis: 85%;
  }
}

/* Compact hero with touch-friendly controls and explicit motion preference. */
.hero-cover-section { min-height: 500px; padding: 0 24px; }
.hero-bg-slide { opacity: 0; transform: scale(1.03); transition: opacity 1.2s ease, transform 6s ease; pointer-events: none; }
.hero-bg-slide.active { opacity: .55 !important; transform: scale(1); }
.hero-slide-dots { align-items: center; }
.hero-slide-dot { width: 44px; height: 44px; position: relative; background: transparent !important; box-shadow: none !important; }
.hero-slide-dot::after { content: ''; position: absolute; left: 4px; right: 4px; top: 20px; height: 4px; border-radius: 4px; background: #a3b6d8; }
.hero-slide-dot.active::after { background: #2f5aae; }
.floating-btn:focus-visible .floating-btn-tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 600px) {
  .hero-cover-section { min-height: 0; }
  .floating-actions-container { right: 14px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-bg-slide { transform: none; }
}
