/* styles.css - Optimized for Performance and SEO */

/* Critical CSS - Above the fold styles */
:root {
    --dark-blue: #1a365d;
    --primary-blue: #1e40af;
    --primary-blue-hover: #2563eb;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --bg-light: #f9fafb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Accessibility */
.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 styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Navigation */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    will-change: transform;
}

.sticky-nav.scrolled {
    box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/images/hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin-top: 96px; /* Adjusted for h-24 navbar (6rem = 96px) */
}

@media (max-width: 768px) {
    .hero-section {
        background-attachment: scroll;
        margin-top: 80px;
    }
}

/* Service Cards */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.form-header {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-textbox, 
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    outline: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    background-color: #fff;
}

.form-textbox:focus, 
.form-textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-submit-button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 1rem;
}

.form-submit-button:hover:not(:disabled) {
    background-color: var(--primary-blue-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.form-submit-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
    border-top: 1px solid #e5e7eb;
}

#mobile-menu.hidden {
    display: none;
}

#mobile-menu a {
    transition: all 0.2s ease;
}

#mobile-menu a:hover {
    background-color: var(--bg-light);
}

/* Utility Classes */
.hover\:text-dark-blue:hover {
    color: var(--dark-blue);
}

.text-dark-blue {
    color: var(--dark-blue);
}

.bg-dark-blue {
    background-color: var(--dark-blue);
}

/* Animation Classes */
.transition-all {
    transition: all 0.3s ease;
}

.hover\:scale-105:hover {
    transform: scale(1.05);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
}

/* Loading states */
#header,
#footer {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#header.loaded,
#footer.loaded {
    opacity: 1;
}

/* Print Styles */
@media print {
    .sticky-nav,
    #footer,
    .form-submit-button,
    .bg-black {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-textbox,
    .form-textarea {
        border-width: 2px;
    }
    
    .form-submit-button {
        border: 2px solid transparent;
    }
}

/* Reduced Motion Support */
@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;
    }
}

/* Performance Optimizations */
.hero-section,
.service-card img {
    will-change: auto;
}

/* Lazy Loading Images */
img[loading="lazy"] {
    background-color: #f3f4f6;
}

/* Custom Scrollbar for Better UX */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

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