/* ============================================
   ANDERS ENGINEERING - CUSTOM STYLES
   Utility Drafting & Permitting Support
   ============================================ */

/* ============================================
   CUSTOM ANIMATIONS
   ============================================ */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

section {
    scroll-margin-top: 80px;
}

/* ============================================
   HEADER SCROLL BEHAVIOR
   ============================================ */

#header {
    transition: all 0.3s ease;
}

#header.scrolled {
    background-color: rgba(44, 52, 68, 0.98);
    backdrop-filter: blur(10px);
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

*::-webkit-scrollbar {
    width: 12px;
}

*::-webkit-scrollbar-track {
    background: #2C3444;
}

*::-webkit-scrollbar-thumb {
    background-color: #D4AF37;
    border-radius: 6px;
    border: 3px solid #2C3444;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #e5c158;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

#scroll-to-top {
    transition: all 0.3s ease;
}

#scroll-to-top.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    transition: all 0.3s ease;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
textarea:hover {
    border-color: #D4AF37;
}

input.invalid,
textarea.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

input.valid,
textarea.valid {
    border-color: #10b981;
}

.error-message {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ============================================
   TEXT SELECTION
   ============================================ */

::selection {
    background-color: #D4AF37;
    color: #2C3444;
}

::-moz-selection {
    background-color: #D4AF37;
    color: #2C3444;
}

/* ============================================
   MOBILE MENU ANIMATION
   ============================================ */

#mobile-menu {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 500px;
    opacity: 1;
}

#mobile-menu-button i {
    transition: transform 0.3s ease;
}

#mobile-menu-button.active i {
    transform: rotate(90deg);
}

/* ============================================
   ACCESSIBILITY - SCREEN READER ONLY
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    header,
    footer,
    #scroll-to-top {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
}

/* ============================================
   REDUCED MOTION (Accessibility)
   ============================================ */

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