/* ===== Custom Styles for Candyland Learning Center ===== */

/* Base & Typography */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Navigation ===== */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #800020;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link::after {
  background: #800020;
}

/* Mobile menu */
.menu-line {
  transition: all 0.3s ease;
}

#mobile-toggle.active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

#mobile-toggle.active .menu-line:nth-child(2) {
  opacity: 0;
}

#mobile-toggle.active .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
  width: 1.25rem;
}

.mobile-link {
  transition: all 0.2s ease;
}

/* ===== Hero Blobs ===== */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: blob-float 8s ease-in-out infinite;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #fce4ea, #ffb8cc);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #fdf0f3, #f9c4d0);
  bottom: 10%;
  left: -50px;
  animation-delay: -3s;
}

.blob-3 {
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, #fff0e0, #ffd8a8);
  top: 40%;
  right: 30%;
  animation-delay: -5s;
}

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ===== Floating Cards ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes float-delayed {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float-delayed 5s ease-in-out infinite;
  animation-delay: -2s;
}

/* ===== Program Cards ===== */
.program-card {
  position: relative;
  overflow: hidden;
}

.program-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #800020, #ff8aac);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.program-card:hover::before {
  opacity: 1;
}

/* ===== Gallery ===== */
.gallery-item {
  cursor: pointer;
  position: relative;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(128, 0, 32, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ===== Testimonial Cards ===== */
.testimonial-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(128, 0, 32, 0.1);
}

/* ===== Scroll Reveal Animations ===== */
/* Default: visible (progressive enhancement — content always shows) */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Only animate when JS is active and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
  }
  
  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
  
  .reveal-delay-1 { transition-delay: 0.1s; }
  .reveal-delay-2 { transition-delay: 0.2s; }
  .reveal-delay-3 { transition-delay: 0.3s; }
  .reveal-delay-4 { transition-delay: 0.4s; }
}

/* ===== Back to Top ===== */
#back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

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

#back-to-top:not(.visible) {
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-blob {
    filter: blur(60px);
    opacity: 0.25;
  }
  
  .blob-1 {
    width: 300px;
    height: 300px;
  }
  
  .blob-2 {
    width: 250px;
    height: 250px;
  }
  
  .blob-3 {
    width: 150px;
    height: 150px;
  }
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #800020;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Selection ===== */
::selection {
  background: #fce4ea;
  color: #800020;
}
