/* ====================
   Responsive Design - Mobile First
   ==================== */

/* Mobile First - Base styles above are for mobile */

/* Small screens and up (576px and up) */
@media (max-width: 575px) {
    .container {
        padding: 0 15px;
    }
    
    /* Typography adjustments */
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    /* Navigation */
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 2rem 0;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-medium);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid #E2E8F0;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--light-gray);
        margin: 0;
        border-radius: 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-actions {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .nav-brand {
        flex: 1;
    }
    
    /* Hero Section */
    .hero {
        padding-top: 120px;
        min-height: 100vh;
        text-align: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Grid Layouts */
    .value-grid,
    .services-grid,
    .proof-grid,
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Form */
    .capture-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .capture-form {
        padding: 2rem 1.5rem;
    }
    
    /* Service Cards */
    .service-actions {
        flex-direction: column;
    }
    
    .service-actions .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .legal-links {
        justify-content: center;
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cert-logos {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

/* Medium screens (768px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .hero-actions {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .value-grid,
    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .proof-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .capture-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem 0;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-medium);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid #E2E8F0;
    }
    
    .nav-link {
        padding: 1rem 2rem;
    }
}

/* Large screens (992px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-title {
        font-size: 3.2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .capture-content {
        gap: 3rem;
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

/* Extra large screens (1200px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 1200px;
    }
    
    /* Navigation hover effects */
    .nav-item.dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    /* Enhanced animations for larger screens */
    .value-card:hover,
    .service-card:hover,
    .resource-card:hover {
        transform: translateY(-8px);
    }
    
    /* Better spacing for large screens */
    .section {
        padding: 100px 0;
    }
    
    .hero {
        min-height: 100vh;
    }
}

/* Ultra-wide screens (1400px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: 100vh;
        padding-top: 100px;
    }
    
    .hero-stats {
        padding: 1rem 0;
        margin: 1rem 0;
    }
    
    .hero-actions {
        margin: 2rem 0 1rem;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images and icons for retina displays */
    .logo-img,
    .footer-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .header,
    .nav-toggle,
    .hero-actions,
    .btn,
    .footer {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-title,
    .section-title {
        color: #000 !important;
    }
    
    .section {
        padding: 2rem 0;
        break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    /* Optional dark mode styles - can be implemented later */
    :root {
        --dark-mode-bg: #1a1a1a;
        --dark-mode-text: #ffffff;
        --dark-mode-card: #2a2a2a;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-outline {
        border-width: 3px;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-width: 3px;
        box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.3);
    }
}

/* Mobile touch targets */
@media (max-width: 767px) {
    .btn,
    .nav-link,
    .social-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    
    /* Improve form usability on mobile */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 16px;
    }
}

/* iPhone X and similar devices with notch */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 812px) 
    and (-webkit-device-pixel-ratio: 3) {
    
    .header {
        padding-top: env(safe-area-inset-top);
    }
    
    .hero {
        padding-top: calc(80px + env(safe-area-inset-top));
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .capture-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .value-grid,
    .proof-grid,
    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading states for slower connections */
@media (max-width: 767px) {
    .hero-image {
        loading: lazy;
    }
    
    /* Skeleton loading placeholder */
    .loading-skeleton {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
    
    @keyframes loading {
        0% {
            background-position: 200% 0;
        }
        100% {
            background-position: -200% 0;
        }
    }
}

/* Hover states only for devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .value-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-medium);
    }
    
    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-medium);
    }
    
    .resource-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-medium);
    }
    
    .btn:hover {
        transform: translateY(-2px);
    }
}

/* No hover for touch devices */
@media (hover: none) and (pointer: coarse) {
    .value-card:hover,
    .service-card:hover,
    .resource-card:hover,
    .btn:hover {
        transform: none;
    }
    
    /* Tap highlights for better mobile UX */
    .btn,
    .nav-link,
    .value-link {
        -webkit-tap-highlight-color: rgba(30, 58, 138, 0.2);
    }
}

/* Ensure text remains visible during font load */
@font-face {
    font-display: swap;
}

/* Optimize for slow networks */
@media (max-width: 767px) and (prefers-reduced-data: reduce) {
    .hero-image {
        display: none;
    }
    
    .hero-background::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--gradient-primary);
        z-index: -1;
    }
}

/* Focus management for keyboard navigation */
@media (max-width: 767px) {
    .nav-menu.active .nav-link:first-child {
        border-top: 3px solid var(--primary-blue);
    }
    
    .nav-toggle:focus {
        outline: 2px solid var(--primary-blue);
        outline-offset: 2px;
    }
    
    .btn:focus,
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: 2px solid var(--primary-blue);
        outline-offset: 2px;
    }
}