/* Custom Styles for E & S Auto Repair */

/* Base & Utilities */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection Color */
::selection {
    background-color: rgba(251, 191, 36, 0.3);
    color: #500724;
}

/* Scroll Reveal Animation */
.scroll-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);
}

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

/* Hero Fade-In Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-fill-mode: both;
}

/* Scroll Line Animation */
@keyframes scrollLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        transform: scaleY(1);
        transform-origin: top;
    }
    51% {
        transform-origin: bottom;
    }
    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

.animate-scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

/* Navbar Scrolled State */
.navbar-scrolled {
    background-color: rgba(46, 3, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu Transitions */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

/* Hamburger Animation */
#menu-btn.active #bar1 {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-btn.active #bar2 {
    opacity: 0;
}

#menu-btn.active #bar3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 100%;
}

/* Mobile Link Animation */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }
#mobile-menu.open .mobile-link:nth-child(6) { transition-delay: 0.35s; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9d174d;
}

/* Focus Styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* Image Hover Effect */
img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Service Card Gradient Hover */
.group:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-icon {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smooth Image Loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Print Styles */
@media print {
    header, footer, #contact-form, .scroll-reveal {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .font-serif {
        color: #000;
    }
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .text-white\/70 {
        color: #fff;
    }
    
    .text-gray-500 {
        color: #374151;
    }
}

/* Landscape Mobile */
@media (max-width: 640px) and (orientation: landscape) {
    #hero {
        min-height: 100vh;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
}

/* Tablet-specific adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
    .font-serif.text-4xl.md\:text-5xl {
        font-size: 3rem;
    }
}
