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

/* ==================================
   Tablet: 768px and below (Mobile Navigation)
   ================================== */
@media (max-width: 768px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.5rem;
        --font-size-h3: 1.25rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
    }

    /* Mobile Navigation - Floating Glass */
    .navbar {
        top: 10px;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: calc(var(--nav-height) + 20px);
        left: 10px;
        right: 10px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        padding: var(--spacing-md);
        gap: var(--spacing-xs);
        box-shadow: 0 8px 32px 0 rgba(30, 58, 138, 0.15);
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--transition-normal), opacity var(--transition-normal);
        max-height: calc(100vh - var(--nav-height) - 40px);
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-link {
        display: block;
        padding: var(--spacing-sm);
        border-radius: 12px;
        text-align: center;
    }

    .nav-link:hover {
        background: rgba(30, 58, 138, 0.1);
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-images {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .hero-image {
        height: 250px;
    }

    /* About Section */
    .about {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .about p {
        font-size: 1rem;
    }

    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--spacing-sm);
        padding: var(--spacing-md) 0;
    }

    /* Equipment Grid */
    .equipment-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .equipment-image {
        height: 250px;
    }

    /* Lightbox on Mobile */
    .lightbox-image {
        max-width: 95%;
        max-height: 75vh;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        padding: var(--spacing-xs);
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        font-size: 2rem;
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .lightbox-caption {
        font-size: 1rem;
        padding: var(--spacing-xs) var(--spacing-sm);
        bottom: 10px;
    }

    /* Container padding */
    .container {
        padding: 0 var(--spacing-sm);
    }
}

/* ==================================
   Mobile Small: 480px and below
   ================================== */
@media (max-width: 480px) {
    :root {
        --font-size-h1: 1.75rem;
        --font-size-h2: 1.25rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
    }

    .hero {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-image {
        height: 200px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .equipment-image {
        height: 200px;
    }

    .nav-container {
        padding: 0 var(--spacing-sm);
    }

    .page-title {
        font-size: 1.75rem;
    }
}

/* ==================================
   Tablet Landscape: 769px to 1023px
   ================================== */
@media (min-width: 769px) and (max-width: 1023px) {
    .hero-images {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-images .hero-image:last-child {
        grid-column: 1 / -1;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .equipment-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================================
   Desktop: 1024px and up
   ================================== */
@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .hero-images {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================================
   Large Desktop: 1440px and up
   ================================== */
@media (min-width: 1440px) {
    :root {
        --max-width: 1400px;
        --font-size-h1: 3.5rem;
    }

    .hero-title {
        font-size: 4.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: var(--spacing-lg);
    }

    .hero-image {
        height: 350px;
    }
}

/* ==================================
   Touch Device Adjustments
   ================================== */
/* Disable hover effects on touch devices */
@media (hover: none) {
    .gallery-item:hover {
        transform: none;
        box-shadow: none;
    }

    .gallery-item:hover .gallery-image {
        transform: none;
    }

    .equipment-card:hover {
        transform: none;
        box-shadow: var(--shadow-lg);
    }

    .hero-image:hover {
        transform: none;
    }

    .nav-link:hover {
        background-color: transparent;
        color: var(--color-text);
    }

    /* Enable active states instead */
    .gallery-item:active {
        opacity: 0.9;
    }
}

/* Enable hover effects only on devices that support it */
@media (hover: hover) {
    .nav-link:hover {
        background-color: var(--color-primary);
        color: white;
    }

    .equipment-card:hover {
        transform: translateY(-8px);
    }

    .gallery-item:hover {
        transform: translateY(-4px);
    }
}

/* ==================================
   Print Styles
   ================================== */
@media print {
    .navbar,
    .nav-toggle,
    .footer,
    .lightbox {
        display: none !important;
    }

    main {
        margin-top: 0;
    }

    .hero {
        min-height: auto;
        padding: 2rem;
    }

    .gallery-grid,
    .equipment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    a {
        text-decoration: underline;
    }

    .fade-in {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==================================
   Reduced Motion for Accessibility
   ================================== */
@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;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }

    .lazy {
        animation: none;
    }
}

    /* TikTok Section - Mobile */
    .tiktok-card {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-lg);
    }

    .tiktok-logo img {
        width: 100px;
        height: 100px;
    }

    .tiktok-number {
        font-size: 2rem;
    }

    .tiktok-stats {
        justify-content: center;
    }

    /* About Section - Mobile */
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    /* 404 Error Page - Mobile */
    .error-code {
        font-size: clamp(60px, 20vw, 120px);
    }

    .error-title {
        font-size: 1.5rem;
    }

    .error-description {
        font-size: 1rem;
    }

    .error-actions {
        flex-direction: column;
        width: 100%;
    }

    .error-actions .cta-button,
    .error-actions .cta-button-secondary {
        width: 100%;
        justify-content: center;
    }

    .error-links-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .error-link-card {
        padding: var(--spacing-md);
    }
}

/* ==================================
   High Contrast Mode
   ================================== */
@media (prefers-contrast: high) {
    :root {
        --color-text: #000000;
        --color-background: #ffffff;
        --color-border: #000000;
    }

    .hero {
        background: var(--color-primary-dark);
    }

    button,
    .nav-link {
        border: 2px solid currentColor;
    }
}

/* ==================================
   Dark Mode Support (Optional Future Enhancement)
   ================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --color-background: #0f172a;
        --color-surface: #1e293b;
        --color-text: #f1f5f9;
        --color-text-light: #cbd5e1;
        --color-border: #334155;
    }
    */
}
