/* ========== WV Solar - Custom Styles ========== */

/* Smooth scroll */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ========== SCROLL PROGRESS BAR ========== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #DC2626, #F59E0B);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

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

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

/* Reveal from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Reveal from right */
.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Reveal scale (for cards) */
.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  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-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children - delays applied via JS */
.stagger-1 { transition-delay: 0s; }
.stagger-2 { transition-delay: 0.12s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.36s; }
.stagger-5 { transition-delay: 0.48s; }
.stagger-6 { transition-delay: 0.60s; }
.stagger-7 { transition-delay: 0.72s; }
.stagger-8 { transition-delay: 0.84s; }
.stagger-9 { transition-delay: 0.96s; }
.stagger-10 { transition-delay: 1.08s; }
.stagger-11 { transition-delay: 1.20s; }
.stagger-12 { transition-delay: 1.32s; }

/* ========== HERO ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-fadeIn {
  animation: fadeIn 0.8s ease-out both;
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out both;
}

.animation-delay-200 {
  animation-delay: 200ms;
}

.animation-delay-400 {
  animation-delay: 400ms;
}

.animation-delay-600 {
  animation-delay: 600ms;
}

/* ========== GLASSMORPHISM ========== */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-dark {
  background: rgba(30, 58, 95, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== HOVER ANIMATIONS ========== */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button press effect */
.btn-press {
  transition: transform 0.15s ease;
}

.btn-press:active {
  transform: scale(0.96);
}

/* Icon spin on hover */
.hover-spin:hover svg {
  transform: rotate(12deg);
  transition: transform 0.3s ease;
}

/* ========== PARALLAX ========== */
.parallax-bg {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

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

/* ========== HEADER ========== */
#header {
  transition: all 0.3s ease;
}

#header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ========== PROJECT FILTERS ========== */
.project-filter {
  background: white;
  color: #6B7280;
  border: 1px solid #E5E7EB;
  transition: all 0.3s ease;
}

.project-filter:hover {
  border-color: #DC2626;
  color: #DC2626;
  transform: translateY(-2px);
}

.project-filter.active {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}

/* ========== PROJECT CARDS ========== */
.project-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.project-card.hidden-card {
  opacity: 0;
  transform: scale(0.8);
  position: absolute;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* ========== FAQ ========== */
.faq-item {
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: #DC2626;
}

.faq-item.active {
  border-color: #DC2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: #DC2626;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-item.active .faq-content {
  max-height: 500px;
}

/* ========== LIGHTBOX ========== */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#lightbox.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

#lightbox .lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.3s;
}

#lightbox .lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* ========== WHATSAPP PULSE ========== */
@keyframes whatsapp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

#whatsapp-float {
  animation: whatsapp-pulse 2s infinite;
  transition: transform 0.3s ease;
}

#whatsapp-float:hover {
  transform: scale(1.15);
}

/* ========== PHONE INPUT MASK ========== */
input[type="tel"] {
  font-variant-numeric: tabular-nums;
}

/* ========== SELECTION ========== */
::selection {
  background: #DC2626;
  color: white;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #F8FAFC;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ========== FORM STEP TRANSITION ========== */
#form-step-1, #form-step-2 {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ========== COUNTER ANIMATION ========== */
@keyframes countPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.counter-done {
  animation: countPulse 0.4s ease;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hover-lift:hover {
    transform: none;
  }
  .project-card:hover {
    transform: none;
  }
  #scroll-progress {
    display: none;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .counter {
    font-size: 1.75rem;
  }
}
