/*
 * VISUAL POLISH ENHANCEMENTS
 * Professional micro-interactions, refined shadows, sophisticated animations
 * Version: 5.0-POLISH
 * Loads after homepage-makeover.css to enhance without breaking
 */

/* ============================================
   ENHANCED SHADOWS & DEPTH
   ============================================ */
:root {
    /* Refined shadow system for better depth */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-large: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 25px 50px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.08);

    /* Colored shadows for CTAs */
    --shadow-primary-glow: 0 4px 16px rgba(211, 47, 47, 0.2), 0 8px 32px rgba(211, 47, 47, 0.15);
    --shadow-yellow-glow: 0 4px 16px rgba(255, 215, 0, 0.3), 0 8px 32px rgba(255, 215, 0, 0.2);

    /* Smooth transitions */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-elegant: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Refined hero overlay with better gradient */
.hero-overlay {
    background: linear-gradient(
        135deg,
        rgba(211, 47, 47, 0.88) 0%,
        rgba(183, 28, 28, 0.82) 40%,
        rgba(33, 33, 33, 0.75) 100%
    );
    backdrop-filter: blur(2px);
}

/* Hero logo with enhanced glow effect */
.hero-logo-icon {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(255, 255, 255, 0.15),
        0 0 40px rgba(255, 215, 0, 0.2);
    transition: all 0.4s var(--transition-elegant);
}

.hero-logo-icon:hover {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 6px rgba(255, 215, 0, 0.3),
        0 0 60px rgba(255, 215, 0, 0.4);
    transform: scale(1.08) rotate(3deg);
}

/* Enhanced heading with better text shadow */
.hero-heading {
    text-shadow:
        2px 2px 8px rgba(0, 0, 0, 0.6),
        4px 4px 16px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(211, 47, 47, 0.3);
    animation: heroGlow 3s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    from {
        text-shadow:
            2px 2px 8px rgba(0, 0, 0, 0.6),
            4px 4px 16px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(211, 47, 47, 0.3);
    }
    to {
        text-shadow:
            2px 2px 8px rgba(0, 0, 0, 0.6),
            4px 4px 16px rgba(0, 0, 0, 0.4),
            0 0 40px rgba(255, 215, 0, 0.4);
    }
}

/* Primary CTA with magnetic hover effect */
.btn-hero-primary {
    box-shadow: var(--shadow-yellow-glow);
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--transition-elegant);
}

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

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

.btn-hero-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 8px 24px rgba(255, 215, 0, 0.4),
        0 16px 48px rgba(255, 215, 0, 0.3),
        0 0 80px rgba(255, 215, 0, 0.2);
}

.btn-hero-primary:active {
    transform: translateY(-2px) scale(0.98);
}

/* Secondary button with glass morphism enhancement */
.btn-hero-secondary {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s var(--transition-elegant);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(30px) saturate(200%);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.service-card {
    box-shadow: var(--shadow-soft);
    transition: all 0.4s var(--transition-elegant);
    position: relative;
    overflow: hidden;
}

/* Animated gradient border on hover */
.service-card::before {
    background: linear-gradient(
        135deg,
        var(--color-primary) 0%,
        var(--color-primary-light) 50%,
        var(--color-accent-yellow) 100%
    );
    height: 3px;
}

/* Subtle background shine effect */
.service-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.8s ease;
}

.service-card:hover::after {
    transform: translateX(100%) rotate(45deg);
}

.service-card:hover {
    box-shadow: var(--shadow-large);
    transform: translateY(-10px) scale(1.02);
}

/* Service icon with bounce animation */
.service-icon {
    transition: all 0.4s var(--transition-bounce);
    display: inline-block;
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotate(-5deg);
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.15) rotate(-5deg); }
    50% { transform: scale(1.25) rotate(5deg); }
}

/* Enhanced service link arrow */
.service-link {
    position: relative;
    padding-right: 20px;
}

.service-link-arrow {
    position: absolute;
    right: 0;
    transition: all 0.3s var(--transition-elegant);
}

.service-card:hover .service-link-arrow {
    transform: translateX(8px) scale(1.2);
    animation: arrowPulse 0.8s ease infinite;
}

@keyframes arrowPulse {
    0%, 100% { transform: translateX(8px) scale(1.2); }
    50% { transform: translateX(12px) scale(1.3); }
}

/* ============================================
   SECTION LOGO BRANDING POLISH
   ============================================ */

.section-brand-badge {
    transition: all 0.4s var(--transition-bounce);
}

.section-brand-badge:hover {
    transform: scale(1.05);
}

.section-logo-icon {
    box-shadow:
        var(--shadow-medium),
        0 0 20px rgba(211, 47, 47, 0.2);
    transition: all 0.5s var(--transition-bounce);
    position: relative;
}

.section-logo-icon::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent-yellow));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    filter: blur(10px);
}

.section-logo-icon:hover::before {
    opacity: 0.6;
}

.section-logo-icon:hover {
    transform: scale(1.15) rotate(-8deg);
    box-shadow:
        var(--shadow-elevated),
        0 0 40px rgba(255, 215, 0, 0.4);
    border-color: var(--color-accent-yellow);
}

/* ============================================
   WHY CHOOSE CARDS POLISH
   ============================================ */

.why-choose-card {
    box-shadow: var(--shadow-subtle);
    transition: all 0.4s var(--transition-elegant);
    position: relative;
}

.why-choose-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(
        135deg,
        rgba(211, 47, 47, 0.05) 0%,
        rgba(25, 118, 210, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.why-choose-card:hover::after {
    opacity: 1;
}

.why-choose-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-8px) scale(1.02);
}

.why-choose-icon {
    transition: all 0.5s var(--transition-bounce);
    display: inline-block;
    position: relative;
}

.why-choose-card:hover .why-choose-icon {
    transform: scale(1.2) rotate(360deg);
}

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

.testimonial-card {
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        var(--shadow-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s var(--transition-elegant);
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--color-accent-yellow) 0%,
        var(--color-primary) 50%,
        var(--color-accent-yellow) 100%
    );
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: gradientSlide 3s linear infinite;
}

@keyframes gradientSlide {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

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

.testimonial-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(30px) saturate(200%);
    box-shadow:
        var(--shadow-large),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Star rating with pulse effect */
.testimonial-rating {
    animation: ratingGlow 2s ease-in-out infinite;
}

@keyframes ratingGlow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8)); }
}

.star {
    transition: all 0.3s var(--transition-bounce);
    display: inline-block;
}

.testimonial-card:hover .star {
    transform: scale(1.2) rotate(360deg);
    animation: starTwinkle 0.8s ease;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; transform: scale(1.3); }
}

/* Avatar with glow */
.testimonial-avatar {
    box-shadow:
        var(--shadow-medium),
        0 0 20px rgba(211, 47, 47, 0.3);
    transition: all 0.4s var(--transition-elegant);
}

.testimonial-card:hover .testimonial-avatar {
    transform: scale(1.1);
    box-shadow:
        var(--shadow-large),
        0 0 30px rgba(255, 215, 0, 0.5);
}

/* ============================================
   SERVICE AREAS POLISH
   ============================================ */

.service-area-card {
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s var(--transition-elegant);
    position: relative;
    overflow: hidden;
}

.service-area-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
    transform: scaleY(0);
    transition: transform 0.3s var(--transition-elegant);
}

.service-area-card:hover::before {
    transform: scaleY(1);
}

.service-area-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateX(8px) scale(1.02);
    background: linear-gradient(
        90deg,
        rgba(211, 47, 47, 0.05) 0%,
        var(--color-white) 10%
    );
}

.service-area-icon {
    transition: all 0.4s var(--transition-bounce);
    display: inline-block;
}

.service-area-card:hover .service-area-icon {
    transform: scale(1.3) rotate(360deg);
}

/* ============================================
   FAQ ACCORDION POLISH
   ============================================ */

.faq-item {
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s var(--transition-elegant);
}

.faq-item.active {
    box-shadow: var(--shadow-medium);
    transform: scale(1.01);
}

.faq-question {
    position: relative;
    overflow: hidden;
}

.faq-question::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-primary);
    transform: scaleY(0);
    transition: transform 0.3s var(--transition-elegant);
}

.faq-item.active .faq-question::before {
    transform: scaleY(1);
}

.faq-toggle {
    box-shadow: var(--shadow-soft);
    transition: all 0.3s var(--transition-elegant);
}

.faq-item.active .faq-toggle {
    box-shadow: var(--shadow-medium);
    transform: rotate(135deg) scale(1.1);
}

.faq-question:hover .faq-toggle {
    transform: scale(1.15);
    box-shadow: var(--shadow-primary-glow);
}

/* ============================================
   FINAL CTA POLISH
   ============================================ */

.final-cta-overlay {
    background: linear-gradient(
        135deg,
        rgba(33, 33, 33, 0.93) 0%,
        rgba(211, 47, 47, 0.90) 50%,
        rgba(183, 28, 28, 0.88) 100%
    );
    backdrop-filter: blur(3px);
}

/* Emergency badge with enhanced pulse */
.emergency-badge {
    animation: emergencyPulse 2s ease-in-out infinite;
    box-shadow:
        var(--shadow-soft),
        0 0 20px rgba(255, 215, 0, 0.3);
}

@keyframes emergencyPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            var(--shadow-soft),
            0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            var(--shadow-medium),
            0 0 40px rgba(255, 215, 0, 0.5);
    }
}

/* Call Now button with magnetic effect */
.btn-call-now {
    box-shadow: var(--shadow-yellow-glow);
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--transition-elegant);
}

.btn-call-now::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-call-now:hover::before {
    width: 400px;
    height: 400px;
}

.btn-call-now:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow:
        0 12px 32px rgba(255, 215, 0, 0.5),
        0 24px 64px rgba(255, 215, 0, 0.4),
        0 0 100px rgba(255, 215, 0, 0.3);
}

.btn-call-now:active {
    transform: translateY(-3px) scale(1.02);
}

.btn-call-now .btn-icon {
    transition: all 0.4s var(--transition-bounce);
    display: inline-block;
}

.btn-call-now:hover .btn-icon {
    transform: rotate(20deg) scale(1.2);
    animation: phoneBounce 0.6s ease;
}

@keyframes phoneBounce {
    0%, 100% { transform: rotate(20deg) scale(1.2); }
    25% { transform: rotate(-10deg) scale(1.3); }
    75% { transform: rotate(25deg) scale(1.15); }
}

/* Schedule button glass morphism */
.btn-schedule {
    backdrop-filter: blur(25px) saturate(200%);
    box-shadow:
        var(--shadow-medium),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s var(--transition-elegant);
}

.btn-schedule:hover {
    backdrop-filter: blur(35px) saturate(220%);
    box-shadow:
        var(--shadow-large),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale in */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide from left */
@keyframes slideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide from right */
@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Applied by JavaScript intersection observer */
.animate-in {
    animation: fadeInUp 0.8s var(--transition-elegant) forwards;
}

.animate-scale {
    animation: scaleUp 0.6s var(--transition-elegant) forwards;
}

.animate-slide-left {
    animation: slideFromLeft 0.8s var(--transition-elegant) forwards;
}

.animate-slide-right {
    animation: slideFromRight 0.8s var(--transition-elegant) forwards;
}

/* Stagger delays for sequential animation */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-600 { animation-delay: 0.6s; }

/* ============================================
   MOBILE TOUCH POLISH
   ============================================ */

/* Better touch feedback */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover animations on touch devices */
    .service-card:hover,
    .why-choose-card:hover,
    .testimonial-card:hover {
        transform: none;
    }

    /* Add touch-specific active states */
    .service-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .btn-hero-primary:active,
    .btn-call-now:active {
        transform: scale(0.95);
    }

    /* Larger tap targets */
    .faq-toggle {
        width: 40px;
        height: 40px;
    }

    .service-area-card {
        min-height: 60px;
    }
}

/* ============================================
   HIGH CONTRAST MODE SUPPORT
   ============================================ */

@media (prefers-contrast: high) {
    .service-card,
    .why-choose-card,
    .testimonial-card,
    .faq-item {
        border: 2px solid currentColor;
    }

    .btn-hero-primary,
    .btn-call-now {
        border: 3px solid var(--color-black);
    }
}

/* ============================================
   DARK MODE CONSIDERATIONS
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Enhanced shadows for dark backgrounds */
    .service-card,
    .why-choose-card {
        box-shadow:
            var(--shadow-medium),
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }

    .service-card:hover,
    .why-choose-card:hover {
        box-shadow:
            var(--shadow-large),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for transforms */
.service-card,
.why-choose-card,
.testimonial-card,
.service-area-card,
.btn-hero-primary,
.btn-call-now {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Contain paint for better performance */
.service-card,
.why-choose-card,
.testimonial-card {
    contain: layout style paint;
}

/* ============================================
   LOADING STATE POLISH
   ============================================ */

/* Shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ============================================
   PRINT-SPECIFIC POLISH
   ============================================ */

@media print {
    /* Remove all animations and transitions for print */
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        box-shadow: none !important;
    }

    /* Ensure good contrast for print */
    .service-card,
    .why-choose-card,
    .testimonial-card {
        border: 2px solid var(--color-dark-gray);
        page-break-inside: avoid;
    }
}
