/* ============================================
   KRC Contractors - Custom Styles
   ============================================ */

/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: #0d9488;
    color: #ffffff;
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.hidden {
    opacity: 0;
    transform: translateY(30px);
}

/* Hero animation - runs immediately */
.reveal-hero {
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Navbar Transitions
   ============================================ */
#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

#navbar.scrolled .text-slate-900 {
    color: #0f172a !important;
}

#navbar.scrolled .text-slate-700 {
    color: #334155 !important;
}

#navbar.scrolled .text-slate-500 {
    color: #64748b !important;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background-color: #0d9488;
    transition: width 0.3s ease;
}

.mobile-link:hover::after {
    width: 80%;
}

/* ============================================
   Form Styles
   ============================================ */
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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 2rem;
}

select:focus {
    outline: none;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   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;
    }
    
    .reveal.hidden {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Focus Styles for Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

/* ============================================
   Image Lazy Loading
   ============================================ */
img {
    max-width: 100%;
    height: auto;
}
