/* Custom styles that complement Tailwind */

/* Base styles */
* {
    box-sizing: border-box;
}

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

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[data-src] {
    opacity: 0;
}

/* Selection color */
::selection {
    background-color: rgba(194, 34, 34, 0.2);
    color: #1A1A1A;
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid #c22222;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav, .mobile-menu, #backToTop, .marquee-track {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero-grid {
        min-height: auto;
    }
}

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

/* High contrast mode support */
@media (forced-colors: active) {
    .service-card {
        border: 1px solid ButtonText;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-grid > div:first-child {
        order: 2;
    }
    
    .hero-grid > div:last-child {
        order: 1;
        min-height: 50vh;
    }
}

/* Large screens */
@media (min-width: 1280px) {
    .service-card:hover {
        transform: translateY(-8px);
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .service-card:hover {
        transform: none;
    }
    
    .img-reveal:hover img {
        transform: none;
    }
    
    .btn-link::after {
        display: none;
    }
}

/* Navbar scroll state */
.navbar-scrolled {
    background-color: rgba(250, 246, 243, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(194, 34, 34, 0.1);
}

/* Mobile menu animation */
.menu-line {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Service card image overlay */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(194, 34, 34, 0.03) 100%);
    pointer-events: none;
    border-radius: inherit;
}

/* Custom select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline x1='6' y1='9' x2='12' y2='15' x3='18' y2='9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Subtle pattern for sections */
.bg-pattern-dots {
    background-image: radial-gradient(circle, rgba(194, 34, 34, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}
