/**
 * Pioneer Autotronics - Animation Styles
 * Modern animations and effects for the website
 */

/* ============================================
   SCROLL ANIMATIONS (AOS-like)
   ============================================ */

/* Default: show all elements (fallback if JS fails) */
[data-aos] {
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Only hide elements when JS has initialized */
body.aos-ready [data-aos]:not(.aos-animate) {
    opacity: 0;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}
[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}
[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}
[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}
[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}
[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

[data-aos="flip-up"] {
    transform: perspective(2500px) rotateX(30deg);
}
[data-aos="flip-up"].aos-animate {
    transform: perspective(2500px) rotateX(0);
}

/* Delay utilities */
[data-aos-delay="100"] { transition-delay: 100ms; }
[data-aos-delay="200"] { transition-delay: 200ms; }
[data-aos-delay="300"] { transition-delay: 300ms; }
[data-aos-delay="400"] { transition-delay: 400ms; }
[data-aos-delay="500"] { transition-delay: 500ms; }
[data-aos-delay="600"] { transition-delay: 600ms; }

/* ============================================
   HERO SECTION
   ============================================ */

.hero-modern {
    position: relative;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.95) 0%, rgba(15, 118, 110, 0.9) 50%, rgba(13, 148, 136, 0.85) 100%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Floating badges */
.savings-badge {
    animation: bounce-subtle 2s ease-in-out infinite;
}

@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ============================================
   COUNTER ANIMATIONS
   ============================================ */

.counter-value {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.counter-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   SERVICE CARDS
   ============================================ */

.service-card-modern {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e5e7eb;
}

.service-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: #0d9488;
}

.service-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card-modern:hover::before {
    transform: scaleX(1);
}

.popular-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.service-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(13, 148, 136, 0.2));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.service-card-modern:hover .service-icon-wrapper {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    transform: scale(1.1) rotate(5deg);
}

.service-card-modern:hover .service-icon-wrapper i {
    color: white;
}

/* ============================================
   STEPS / PROCESS
   ============================================ */

.step-card {
    position: relative;
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(13, 148, 136, 0.4);
}

.step-connector {
    position: absolute;
    top: 40px;
    right: -50%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #0d9488, #e5e7eb);
}

/* ============================================
   TESTIMONIALS
   ============================================ */

.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
}

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

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 20px;
    left: 24px;
    font-size: 80px;
    font-family: Georgia, serif;
    color: rgba(13, 148, 136, 0.1);
    line-height: 1;
}

.testimonial-stars {
    color: #fbbf24;
}

.testimonial-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0d9488;
}

/* ============================================
   COMPARISON TABLE
   ============================================ */

.comparison-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.comparison-header {
    padding: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.comparison-header.us {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
}

.comparison-header.dealer {
    background: #f3f4f6;
    color: #6b7280;
}

.comparison-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-check {
    color: #10b981;
}

.comparison-x {
    color: #ef4444;
}

/* ============================================
   BRAND LOGOS
   ============================================ */

.brand-logo {
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.brand-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: #1f2937;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-in 0.3s ease;
    max-width: 360px;
}

.toast.success {
    background: linear-gradient(135deg, #0d9488, #0f766e);
}

.toast.error {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.hiding {
    animation: toast-out 0.3s ease forwards;
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-modern {
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.cta-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.92), rgba(15, 118, 110, 0.95));
}

/* ============================================
   BUTTON EFFECTS
   ============================================ */

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::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-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* ============================================
   TRUST BADGES
   ============================================ */

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.trust-badge:hover {
    transform: translateY(-5px);
}

.trust-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.trust-badge:hover .trust-icon {
    transform: scale(1.1);
}

/* ============================================
   SMOOTH SCROLL
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .hero-modern {
        min-height: 500px;
        background-attachment: scroll;
    }

    .step-connector {
        display: none;
    }

    .testimonial-card::before {
        font-size: 50px;
    }

    .cta-modern {
        background-attachment: scroll;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   PULSE ANIMATION FOR LIVE INDICATORS
   ============================================ */

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0; }
}
