/* ============================================
   LAR BENEDI - Advanced Animations & Effects
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Open+Sans:wght@300;400;600;700&display=swap');

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #dc2626, #f97316, #dc2626);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* ============================================
   HEADER TRANSPARENT → SOLID
   ============================================ */
.header-transparent {
  background: transparent !important;
  box-shadow: none !important;
}

.header-transparent a:not(.btn) {
  color: #fff !important;
}

.header-transparent .logo-text {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-solid {
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
}

.header-solid a:not(.btn) {
  color: #374151 !important;
}

.header-solid .logo-text {
  background: #dc2626 !important;
  border: none;
}

/* ============================================
   VIDEO BACKGROUND SECTIONS
   ============================================ */
.video-bg-section {
  position: relative;
  overflow: hidden;
}

.video-bg-section video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) scale(1.05);
  object-fit: cover;
  z-index: 0;
}

.video-bg-section .video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.video-bg-section .section-content {
  position: relative;
  z-index: 2;
}

/* Hero overlay */
.hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.45) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* School section overlay - warm tone */
.school-overlay {
  background: linear-gradient(
    135deg,
    rgba(127, 29, 29, 0.75) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

/* CTA section overlay */
.cta-overlay {
  background: linear-gradient(
    135deg,
    rgba(220, 38, 38, 0.85) 0%,
    rgba(153, 27, 27, 0.9) 100%
  );
}

/* Children section overlay */
.children-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* ============================================
   IMAGE BACKGROUND SECTIONS
   ============================================ */
.image-bg-section {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

@media (max-width: 768px) {
  .image-bg-section {
    background-attachment: scroll;
  }
}

.image-bg-section .image-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.image-bg-section .section-content {
  position: relative;
  z-index: 2;
}

/* Volunteer section overlay */
.volunteer-overlay {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.85) 100%
  );
}

/* Adoption overlay */
.adoption-overlay {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 255, 255, 0.7) 100%
  );
}

/* ============================================
   KEN BURNS EFFECT
   ============================================ */
@keyframes kenBurns {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.08) translate(-1%, -1%);
  }
  100% {
    transform: scale(1) translate(0, 0);
  }
}

.ken-burns-bg {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  background-size: cover;
  background-position: center;
  animation: kenBurns 20s ease-in-out infinite;
}

/* ============================================
   FLOATING PARTICLES (HERO)
   ============================================ */
.particles-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background-color: #fff;
  margin-left: 4px;
  animation: blink 0.7s infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children animation */
.stagger-children .stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.active .stagger-item {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.active .stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.active .stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.active .stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.active .stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.active .stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.active .stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   ENHANCED BUTTON EFFECTS
   ============================================ */
.btn-glow {
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.btn-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-glow:hover::before {
  width: 300px;
  height: 300px;
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(220, 38, 38, 0.4);
}

.btn-outline-glow {
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.btn-outline-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(255, 255, 255, 0.2);
}

/* ============================================
   ENHANCED CARD EFFECTS
   ============================================ */
.card-hover-lift {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ============================================
   ICON ANIMATIONS
   ============================================ */
.icon-pulse {
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.icon-bounce-in {
  opacity: 0;
  transform: scale(0);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.icon-bounce-in.active {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   FLOATING ELEMENTS ANIMATION
   ============================================ */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

.float-anim {
  animation: float 3s ease-in-out infinite;
}

/* ============================================
   COUNTER SECTION STYLES
   ============================================ */
.counter-section {
  position: relative;
  overflow: hidden;
}

.counter-item {
  text-align: center;
  padding: 2rem 1rem;
}

.counter-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.counter-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

/* ============================================
   SCROLL DOWN INDICATOR
   ============================================ */
@keyframes scrollDown {
  0% {
    transform: translateY(0) translateX(-50%);
    opacity: 1;
  }
  100% {
    transform: translateY(15px) translateX(-50%);
    opacity: 0;
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

.scroll-indicator-mouse {
  width: 26px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 13px;
  position: relative;
}

.scroll-indicator-wheel {
  width: 4px;
  height: 8px;
  background: #fff;
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollDown 1.5s infinite;
}

.scroll-indicator-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.7;
}

/* ============================================
   GLASSMORPHISM
   ============================================ */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
}

/* ============================================
   TEXT GRADIENT
   ============================================ */
.text-gradient {
  background: linear-gradient(135deg, #dc2626, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   DIVIDER WAVE
   ============================================ */
.section-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 3;
}

.section-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

.section-divider-top {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 3;
  transform: rotate(180deg);
}

.section-divider-top svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

/* ============================================
   PARALLAX
   ============================================ */
.parallax-slow {
  will-change: transform;
}

/* ============================================
   HERO TEXT SHADOW ENHANCED
   ============================================ */
.text-shadow-strong {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================
   BACK TO TOP ENHANCED
   ============================================ */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  pointer-events: none;
}

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

.back-to-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.5);
}

/* ============================================
   RESPONSIVE VIDEO
   ============================================ */
@media (max-width: 768px) {
  .video-bg-section video {
    display: none;
  }

  .video-bg-section .mobile-fallback-bg {
    display: block;
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
  }

  .counter-number {
    font-size: 2.25rem;
  }
}

@media (min-width: 769px) {
  .video-bg-section .mobile-fallback-bg {
    display: none;
  }
}

/* ============================================
   PAGE LOADER
   ============================================ */
.page-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #dc2626;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   SMOOTH VIDEO PLAYBACK
   ============================================ */
.slow-motion {
  /* Applied via JS: playbackRate = 0.6 */
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
  position: relative;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

.lang-flag svg {
  display: block;
  transition: all 0.3s ease;
}

.lang-active {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 2px;
  pointer-events: none;
}

.header-solid .lang-active {
  border-color: rgba(0, 0, 0, 0.15);
}

.lang-inactive {
  opacity: 0.55;
  transform: scale(0.9);
  border: 2px solid transparent;
  padding: 2px;
  text-decoration: none;
}

.lang-inactive:hover {
  opacity: 1;
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-solid .lang-inactive:hover {
  border-color: rgba(0, 0, 0, 0.15);
}
