/* Custom styles for Andy's Affordable Plumbing and Heating */

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

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #0f432d;
}

/* Selection color */
::selection {
    background: #83c8a5;
    color: #061f15;
}

/* Reveal animations - progressive enhancement */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Stagger children animations */
    .reveal-grid > *:nth-child(1) { transition-delay: 0.1s; }
    .reveal-grid > *:nth-child(2) { transition-delay: 0.2s; }
    .reveal-grid > *:nth-child(3) { transition-delay: 0.3s; }
    .reveal-grid > *:nth-child(4) { transition-delay: 0.4s; }
    .reveal-grid > *:nth-child(5) { transition-delay: 0.5s; }
    .reveal-grid > *:nth-child(6) { transition-delay: 0.6s; }
}

/* Navbar scroll effect */
.navbar-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

/* Mobile menu transitions */
.mobile-menu-open {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Geometric shape float animation */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes floatReverse {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(20px) rotate(-5deg); }
}

.shape-float-1 {
    animation: float 6s ease-in-out infinite;
}

.shape-float-2 {
    animation: floatReverse 8s ease-in-out infinite;
}

.shape-float-3 {
    animation: float 7s ease-in-out infinite;
}

/* Pulse animation for badges */
@keyframes pulse-ring {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.pulse-ring {
    animation: pulse-ring 2s ease-in-out infinite;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid #83c8a5;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    nav, #backToTop, button {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .bg-forest-700, .bg-gray-900 {
        background: #fff !important;
        color: #000 !important;
    }
}

/* 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) {
    .bg-forest-700 {
        background: #000 !important;
    }
    
    .text-forest-700 {
        color: #000 !important;
    }
}

/* Tablet and desktop adjustments */
@media (min-width: 768px) {
    .hero-title {
        line-height: 1.1;
    }
}

/* Large screen optimizations */
@media (min-width: 1024px) {
    .service-card:hover .service-icon {
        transform: scale(1.1) rotate(5deg);
    }
    
    .service-icon {
        transition: transform 0.3s ease;
    }
}
