/* ============================================
   Responsive Styles - Mobile-First Approach
   ============================================ */

/* Mobile First - Base styles are for mobile */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    :root {
        --container-padding: 2rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    :root {
        --container-padding: 2.5rem;
        --header-height: 90px;
    }
    
    .top-bar-left,
    .top-bar-right {
        gap: var(--space-xl);
    }
    
    .footer-grid {
        grid-template-columns: 1fr auto;
        gap: var(--space-2xl);
    }
    
    .footer-qrcodes {
        flex-direction: row;
    }
    
    .footer-bottom-content {
        flex-direction: row;
    }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
    .desktop-nav {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr auto;
        gap: var(--space-3xl);
    }
    
    .footer-qrcodes {
        flex-direction: row;
    }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
    :root {
        --container-max: 1320px;
    }
}

/* Mobile-specific styles (max-width: 1023px) */
@media (max-width: 1023px) {
    /* Hide desktop navigation */
    .desktop-nav {
        display: none;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Adjust header */
    .nav-actions .btn-primary {
        display: none;
    }
    
    /* Hide inline search on mobile */
    .nav-search-form {
        display: none;
    }
    
    /* Top bar adjustments */
    .top-bar {
        font-size: var(--text-xs);
    }
    
    .top-bar-left {
        gap: var(--space-sm);
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .top-link span {
        display: none;
    }
    
    /* Ensure no horizontal overflow */
    .container {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Footer adjustments */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    /* Back to top button */
    .back-to-top {
        bottom: var(--space-lg);
        right: var(--space-lg);
        width: 45px;
        height: 45px;
    }
}

/* Tablet-specific styles (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .footer-grid {
        grid-template-columns: 1fr auto;
    }
    
    .footer-qrcodes {
        flex-direction: row;
    }
    
    .top-link span {
        display: inline;
    }
}

/* Small mobile devices (max-width: 575px) */
@media (max-width: 575px) {
    :root {
        --container-padding: 1rem;
        --header-height: 70px;
        --top-bar-height: 36px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .top-bar-right {
        gap: var(--space-sm);
    }
    
    .top-bar-left {
        gap: var(--space-xs);
    }
    
    .search-toggle {
        display: none;
    }
    
    .search-input {
        font-size: var(--text-lg);
        padding: var(--space-md) var(--space-lg);
    }
    
    .search-close {
        top: var(--space-lg);
        right: var(--space-lg);
    }
    
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }
    
    /* Prevent horizontal overflow */
    body, html {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    /* Adjust buttons for mobile */
    .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--text-sm);
    }
    
    .btn-lg {
        padding: var(--space-md) var(--space-lg);
        font-size: var(--text-base);
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .mobile-nav {
        height: calc(100vh - var(--header-height));
        top: var(--header-height);
    }
    
    .top-bar {
        display: none;
    }
    
    .site-header {
        position: fixed;
    }
    
    main {
        padding-top: var(--header-height);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .search-overlay,
    .mobile-nav {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
}

/* Reduced motion preferences */
@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;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --color-dark: #FFFFFF;
        --color-gray-900: #F5F5F5;
        --color-gray-800: #EEEEEE;
        --color-white: #1A1A1A;
        --color-gray-100: #2D2D2D;
        --color-gray-200: #424242;
    }
    */
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .nav-link,
    .mobile-nav-link,
    .btn,
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .nav-link:hover,
    .btn:hover,
    .social-link:hover {
        transform: none;
    }
}

/* Container queries (modern browsers) */
@supports (container-type: inline-size) {
    .container {
        container-type: inline-size;
    }
}

