/* BibleQuest - Custom styles (beyond Tailwind CDN) */

/* Smooth transitions */
* {
  transition-property: color, background-color, border-color, opacity;
  transition-duration: 150ms;
}

/* Parchment background for verse cards */
.parchment-bg {
  background: linear-gradient(135deg, #FDF6E3 0%, #F5E6C8 100%);
}
.dark .parchment-bg {
  background: linear-gradient(135deg, #1e3a5f 0%, #162d4a 100%);
}

/* Gold glow effect */
.glow-gold {
  box-shadow: 0 0 30px rgba(201, 168, 76, 0.15);
}

/* Shake animation for wrong answers */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Slide up animation */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out forwards;
}

/* Word search grid cells */
#grid div, #mini-grid div {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #C9A84C40;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #C9A84C80;
}

/* Form focus styles */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px #C9A84C;
}

/* Responsive font sizes */
@media (max-width: 640px) {
  .font-serif {
    letter-spacing: -0.02em;
  }
}

/* =======================================
   LANDING PAGE STYLES
   ======================================= */

/* Section padding utility */
.section-padding {
  padding: 4rem 1rem;
}
@media (min-width: 640px) {
  .section-padding {
    padding: 5rem 1.5rem;
  }
}
@media (min-width: 1024px) {
  .section-padding {
    padding: 6rem 2rem;
  }
}

/* Hero gradient background */
.bg-gradient-hero {
  background: linear-gradient(to bottom right, #172636, #233952, #0c131b);
}

/* Star twinkle animation for hero */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* Scroll indicator bounce */
@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

.scroll-indicator {
  animation: bounce-down 2s ease-in-out infinite;
}

/* 3D Flip card */
.perspective {
  perspective: 1000px;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 260px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.perspective:hover .flip-card {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Game preview tabs */
.game-tab {
  background-color: transparent;
  color: #577fa7;
  border: 1px solid transparent;
}

.game-tab:hover {
  background-color: rgba(212, 160, 18, 0.1);
  color: #3a5f8a;
}

.game-tab.active {
  background-color: #d4a012;
  color: white;
  border-color: #d4a012;
  box-shadow: 0 4px 12px rgba(212, 160, 18, 0.3);
}

.dark .game-tab {
  color: #abbfd3;
}

.dark .game-tab:hover {
  background-color: rgba(212, 160, 18, 0.15);
  color: #d5dfe9;
}

.dark .game-tab.active {
  background-color: #d4a012;
  color: white;
}

/* FAQ accordion */
.faq-chevron {
  transition: transform 0.2s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

/* Landing navbar scroll states */
#landing-nav.nav-scrolled {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark #landing-nav.nav-scrolled {
  background-color: rgba(12, 19, 27, 0.9);
}

#landing-nav.nav-scrolled .nav-logo-text {
  color: #172636;
}

.dark #landing-nav.nav-scrolled .nav-logo-text {
  color: #fefdfb;
}

#landing-nav.nav-scrolled .nav-link {
  color: #577fa7;
}

#landing-nav.nav-scrolled .nav-link:hover {
  color: #172636;
  background-color: rgba(212, 160, 18, 0.1);
}

.dark #landing-nav.nav-scrolled .nav-link {
  color: #abbfd3;
}

.dark #landing-nav.nav-scrolled .nav-link:hover {
  color: #fefdfb;
}

#landing-nav.nav-scrolled .nav-login-btn {
  border-color: #233952;
  color: #233952;
}

#landing-nav.nav-scrolled .nav-login-btn:hover {
  background-color: rgba(35, 57, 82, 0.1);
}

.dark #landing-nav.nav-scrolled .nav-login-btn {
  border-color: #abbfd3;
  color: #abbfd3;
}

#landing-nav.nav-scrolled #landing-mobile-btn {
  color: #172636;
}

.dark #landing-nav.nav-scrolled #landing-mobile-btn {
  color: #fefdfb;
}

/* Gold pulse animation */
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 30px rgba(201, 168, 76, 0.15); }
  50% { box-shadow: 0 0 40px rgba(201, 168, 76, 0.3); }
}

.animate-pulse-gold {
  animation: pulseGold 3s ease-in-out infinite;
}

/* =======================================
   GAME OVER MODAL
   ======================================= */

.game-over-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.game-over-overlay.active {
  opacity: 1;
}

.game-over-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(12, 19, 27, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.game-over-panel {
  position: relative;
  width: 100%;
  max-width: 32rem;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(201, 168, 76, 0.3);
  padding: 1.5rem;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease-out;
}

.dark .game-over-panel {
  background: #172636;
  border-color: rgba(35, 57, 82, 0.5);
}

.game-over-overlay.active .game-over-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

@keyframes medalSpinIn {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
  80% { transform: scale(0.95) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.game-over-medal {
  font-size: 3.75rem;
  text-align: center;
  margin-bottom: 1rem;
  animation: medalSpinIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

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

.game-over-score-section {
  animation: scoreSlideUp 0.4s ease-out 0.5s both;
}

@keyframes statsReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-over-stats {
  animation: statsReveal 0.3s ease-out 0.8s both;
}

.game-over-actions {
  animation: statsReveal 0.3s ease-out 1.0s both;
}

.game-over-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #577fa7;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.5rem;
  transition: color 0.15s, background-color 0.15s;
}

.game-over-close:hover {
  color: #172636;
  background-color: rgba(201, 168, 76, 0.1);
}

.dark .game-over-close {
  color: #abbfd3;
}

.dark .game-over-close:hover {
  color: #fefdfb;
  background-color: rgba(35, 57, 82, 0.5);
}

.game-over-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.game-over-stat-card {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: #fefdfb;
  text-align: center;
}

.dark .game-over-stat-card {
  background-color: rgba(35, 57, 82, 0.5);
}

/* =======================================
   GAME GUARD MODALS
   ======================================= */

.game-guard-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.game-guard-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.game-guard-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(12, 19, 27, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.game-guard-panel {
  position: relative;
  width: 100%;
  max-width: 28rem;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(201, 168, 76, 0.3);
  padding: 2rem;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              opacity 0.3s ease-out;
}

.dark .game-guard-panel {
  background: #172636;
  border-color: rgba(35, 57, 82, 0.5);
}

.game-guard-overlay.active .game-guard-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}
