/* ==========================================================================
   Solarix Theme — Animations CSS
   ========================================================================== */

/* ----------------------------------------------------------------------------
   Base Animation Utilities
   ---------------------------------------------------------------------------- */
.animate-fade-up,
.animate-slide-left,
.animate-slide-right,
.animate-pop,
.animate-scale {
    opacity: 0;
    transform-origin: center;
}

.animate-fade-up    { transform: translateY(40px); }
.animate-slide-left { transform: translateX(60px); }
.animate-slide-right{ transform: translateX(-60px); }
.animate-pop        { transform: scale(0.85); }
.animate-scale      { transform: scaleX(0); }

/* Animated-in states */
.animate-fade-up.animated,
.animate-slide-left.animated,
.animate-slide-right.animated,
.animate-pop.animated {
    opacity: 1;
    transform: translate(0) scale(1);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-scale.animated {
    transform: scaleX(1);
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Delay helpers */
[data-delay="100"].animated { transition-delay: 0.1s; }
[data-delay="200"].animated { transition-delay: 0.2s; }
[data-delay="300"].animated { transition-delay: 0.3s; }
[data-delay="400"].animated { transition-delay: 0.4s; }
[data-delay="500"].animated { transition-delay: 0.5s; }
[data-delay="600"].animated { transition-delay: 0.6s; }

/* ----------------------------------------------------------------------------
   Hero Animations
   ---------------------------------------------------------------------------- */
@keyframes solarPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(1.08); }
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-16px); }
}

@keyframes heroGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(245, 166, 35, 0.3); }
    50%       { box-shadow: 0 0 80px rgba(245, 166, 35, 0.6), 0 0 120px rgba(0, 212, 170, 0.2); }
}

@keyframes particleDrift {
    0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-120px) translateX(40px) rotate(360deg); opacity: 0; }
}

@keyframes energyRay {
    0%   { transform: scaleX(0); opacity: 0; }
    50%  { opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}

.hero-particle {
    animation: particleDrift var(--duration, 4s) ease-in infinite;
    animation-delay: var(--delay, 0s);
}

.hero-futuristic__glow {
    animation: solarPulse 4s ease-in-out infinite;
}

.hero-stat-float {
    animation: heroFloat 3s ease-in-out infinite;
}

/* Scroll Indicator */
@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%       { transform: translateY(8px); opacity: 0.5; }
}

.scroll-indicator__dot {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    margin: 0 auto;
    animation: scrollBounce 1.5s ease-in-out infinite;
}

.hero-futuristic__scroll-cue {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    letter-spacing: 0.1em;
}

.scroll-indicator {
    width: 28px;
    height: 44px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 14px;
    margin: 0 auto 8px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

/* ----------------------------------------------------------------------------
   Card Hover Effects
   ---------------------------------------------------------------------------- */
.service-card,
.service-dark-card,
.blog-card,
.team-card,
.package-card,
.benefit-card,
.value-card,
.cert-badge {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.service-card:hover,
.service-dark-card:hover,
.blog-card:hover,
.team-card:hover,
.benefit-card:hover,
.value-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 60px rgba(10, 37, 64, 0.18);
}

.package-card:hover:not(.package-card--popular) {
    transform: translateY(-4px);
}

.package-card--popular {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 30px 70px rgba(245, 166, 35, 0.25);
}

/* Service dark card inner glow */
.service-dark-card {
    position: relative;
    overflow: hidden;
}

.service-dark-card__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 120%, rgba(245, 166, 35, 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.service-dark-card:hover .service-dark-card__glow {
    opacity: 1;
}

/* ----------------------------------------------------------------------------
   Button Animations
   ---------------------------------------------------------------------------- */
@keyframes btnShine {
    0%   { left: -100%; }
    100% { left: 200%; }
}

.btn--primary {
    position: relative;
    overflow: hidden;
}

.btn--primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    skewX: -20deg;
    transition: none;
}

.btn--primary:hover::after {
    animation: btnShine 0.6s ease-in-out;
}

/* Ripple effect */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to { transform: scale(4); opacity: 0; }
}

/* ----------------------------------------------------------------------------
   Logo Ticker
   ---------------------------------------------------------------------------- */
@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.trust-marquee__track,
.logo-ticker__track {
    animation: ticker 24s linear infinite;
    display: flex;
    width: max-content;
}

.trust-marquee__track:hover,
.logo-ticker__track:hover {
    animation-play-state: paused;
}

/* ----------------------------------------------------------------------------
   Counter Animation
   ---------------------------------------------------------------------------- */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------------
   Progress Bars
   ---------------------------------------------------------------------------- */
.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--solarix-amber), var(--solarix-teal));
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------------------------------------------------------
   Live Dashboard
   ---------------------------------------------------------------------------- */
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--solarix-teal);
}

.live-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--solarix-teal);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

/* ----------------------------------------------------------------------------
   Solar Grid Animation (Futuristic Hero)
   ---------------------------------------------------------------------------- */
.solar-grid-animation {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 170, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 170, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridFade 8s ease-in-out infinite alternate;
}

@keyframes gridFade {
    from { opacity: 0.5; }
    to   { opacity: 1; }
}

/* ----------------------------------------------------------------------------
   FAQ Accordion
   ---------------------------------------------------------------------------- */
.faq-item__answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item__answer:not([hidden]) {
    max-height: 500px;
}

.faq-item__answer[hidden] {
    display: block !important;
    visibility: hidden;
    pointer-events: none;
}

.faq-item__icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.faq-item[aria-expanded="true"] .faq-item__icon,
.faq-item.open .faq-item__icon {
    transform: rotate(45deg);
}

/* ----------------------------------------------------------------------------
   Pricing Toggle Animation
   ---------------------------------------------------------------------------- */
.pricing-toggle__btn {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--solarix-navy);
    border: 2px solid var(--solarix-amber);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pricing-toggle__btn[aria-checked="true"] {
    background: var(--solarix-amber);
}

.pricing-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.pricing-toggle__btn[aria-checked="true"] .pricing-toggle__thumb {
    transform: translateX(24px);
}

/* ----------------------------------------------------------------------------
   Testimonial Swiper Custom Styles
   ---------------------------------------------------------------------------- */
.testimonials-dark .swiper-button-next,
.testimonials-dark .swiper-button-prev {
    color: var(--solarix-amber);
    background: rgba(255,255,255,0.05);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.3s ease;
}

.testimonials-dark .swiper-button-next:hover,
.testimonials-dark .swiper-button-prev:hover {
    background: rgba(245, 166, 35, 0.2);
}

.testimonials-dark .swiper-button-next::after,
.testimonials-dark .swiper-button-prev::after {
    font-size: 16px;
}

/* ----------------------------------------------------------------------------
   Solar Calculator Widget
   ---------------------------------------------------------------------------- */
#billSlider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.2);
    outline: none;
}

#billSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--solarix-amber);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.5);
    transition: transform 0.2s ease;
}

#billSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ----------------------------------------------------------------------------
   Back to Top
   ---------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

#backToTop {
    animation: fadeInUp 0.3s ease forwards;
}

/* ----------------------------------------------------------------------------
   Page Transitions
   ---------------------------------------------------------------------------- */
@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.site-main {
    animation: pageIn 0.4s ease forwards;
}

/* ----------------------------------------------------------------------------
   Reduced Motion Support
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-fade-up,
    .animate-slide-left,
    .animate-slide-right,
    .animate-pop,
    .animate-scale {
        opacity: 1;
        transform: none;
    }

    .trust-marquee__track,
    .logo-ticker__track {
        animation: none;
    }
}
