/* ============================================
   Keith's Alterations - Custom Styles
   ============================================ */

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

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

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

::-webkit-scrollbar-thumb {
    background: #d45a3d;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b5482e;
}

/* Selection color */
::selection {
    background: #ffe8e2;
    color: #2D3748;
}

/* ============================================
   Scroll Reveal Animations
   Progressive enhancement - only active when
   JS runs AND user prefers motion
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* Reduced motion - ensure content is always visible */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Navbar Scroll Effect
   ============================================ */
.navbar-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Button & Interactive Hover Effects
   ============================================ */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   Image Loading Optimization
   ============================================ */
img {
    background-color: #e7e5e4;
}

/* ============================================
   Form Focus Styles
   ============================================ */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ============================================
   Mobile Menu Transition
   ============================================ */
#mobileMenu {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

#mobileMenu.hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobileMenu:not(.hidden) {
    max-height: 400px;
    opacity: 1;
}

/* ============================================
   Gallery Hover Zoom
   ============================================ */
.gallery-item {
    overflow: hidden;
}

.gallery-item img {
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ============================================
   Service Card Tilt Effect (optional JS)
   ============================================ */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ============================================
   Loading State for Form
   ============================================ */
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"].loading {
    pointer-events: none;
    opacity: 0.7;
}

button[type="submit"].loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
