/**
 * Mobile Touch Target Enhancements
 * WCAG 2.5.5 Compliance: Minimum 44×44px touch targets
 * Applied at mobile breakpoint (< 768px)
 */

@media (max-width: 768px) {
    /* ============================================
       BUTTONS & CTA ELEMENTS
       ============================================ */
    
    button,
    .btn,
    .path-cta,
    .hero3d__action,
    .onboarding-btn,
    .chip,
    .featured-exp-cta,
    .nav-card,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.25rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Primary CTA buttons need even more prominence */
    .path-cta,
    .hero3d__action--primary {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* ============================================
       NAVIGATION LINKS
       ============================================ */
    
    .nav-link,
    .footer-links a {
        min-height: 44px;
        padding: 0.75rem 1rem;
        display: inline-flex;
        align-items: center;
    }
    
    /* Mobile menu toggle must be large enough */
    .mobile-menu-toggle {
        min-height: 48px;
        min-width: 48px;
        padding: 12px;
    }
    
    /* ============================================
       PATH CARDS & INTERACTIVE CARDS
       ============================================ */
    
    .path-card {
        /* Cards themselves don't need min-height, but internal buttons do */
        padding: 2rem 1.5rem;
    }
    
    .path-card .path-cta {
        margin-top: 1.5rem;
        min-height: 48px;
    }
    
    /* ============================================
       FORM ELEMENTS
       ============================================ */
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Radio and checkbox containers */
    .choice-card,
    .radio-option,
    .checkbox-option {
        min-height: 56px; /* Larger for better tap area */
        padding: 1rem 1.25rem;
        display: flex;
        align-items: center;
    }
    
    /* ============================================
       ONBOARDING FLOW
       ============================================ */
    
    .onboarding-close {
        min-height: 48px;
        min-width: 48px;
        font-size: 1.5rem;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .progress-dot {
        min-width: 12px;
        min-height: 12px;
        /* Dots themselves don't need to be 44px, they're visual indicators */
    }
    
    /* ============================================
       FEATURED EXPERIENCE CARDS
       ============================================ */
    
    .featured-link {
        min-height: 44px;
        padding: 0.75rem 0;
        display: flex;
        align-items: center;
        cursor: pointer;
    }
    
    /* ============================================
       LIVE STATS BAR
       ============================================ */
    
    .live-stats-bar {
        /* Make scrollable on mobile */
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding: 0.75rem 1rem;
        scrollbar-width: none; /* Firefox */
    }
    
    .live-stats-bar::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .live-stat {
        flex: 0 0 auto;
        min-width: 140px;
        scroll-snap-align: start;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* ============================================
       SOCIAL LINKS & ICON BUTTONS
       ============================================ */
    
    .social-link {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }
    
    /* ============================================
       TABS & TOGGLES
       ============================================ */
    
    [role="tab"],
    .tab-button,
    .toggle-button {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }
    
    /* ============================================
       SPACING IMPROVEMENTS FOR TOUCH
       ============================================ */
    
    /* Increase spacing between interactive elements */
    .nav-links {
        gap: 1.25rem;
    }
    
    .hero3d__actions {
        gap: 1rem;
        flex-direction: column;
        width: 100%;
    }
    
    .hero3d__action {
        width: 100%;
        text-align: center;
    }
    
    /* ============================================
       PATH CARDS GRID MOBILE OPTIMIZATION
       ============================================ */
    
    .path-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .path-card {
        grid-column: span 1;
    }
    
    /* ============================================
       FOOTER MOBILE OPTIMIZATION
       ============================================ */
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-links li {
        margin-bottom: 0.75rem;
    }
    
    .footer-links a {
        padding: 0.5rem 0;
    }
}

/* ============================================
   SMALL MOBILE (< 480px)
   ============================================ */

@media (max-width: 480px) {
    /* Even more generous touch targets on small screens */
    button,
    .btn,
    .path-cta {
        min-height: 48px;
        font-size: 0.95rem;
    }
    
    .live-stat {
        min-width: 130px;
        font-size: 0.85rem;
    }
    
    /* Single column everything */
    .stats-grid,
    .data-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LANDSCAPE MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
    /* Reduce vertical padding in landscape to maximize content */
    .hero3d {
        min-height: 60vh;
        padding: 4rem 2rem 2rem;
    }
    
    .choose-path-section {
        padding: 2rem 1.5rem;
    }
    
    .path-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ============================================
   FOCUS STATES FOR TOUCH
   ============================================ */

@media (max-width: 768px) {
    /* Enhanced focus indicators for touch devices */
    button:focus-visible,
    a:focus-visible,
    .path-card:focus-visible,
    [role="button"]:focus-visible {
        outline: 3px solid var(--primary-orange);
        outline-offset: 4px;
        box-shadow: 0 0 0 6px rgba(247, 147, 26, 0.2);
    }
    
    /* Active/tap states */
    button:active,
    a:active,
    .path-card:active,
    .chip:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* ============================================
   PREVENT ACCIDENTAL TAPS
   ============================================ */

@media (max-width: 768px) {
    /* Increase spacing between clickable elements to prevent mis-taps */
    .onboarding-buttons {
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .path-quiz-link {
        margin-top: 2rem;
        padding: 1rem 0;
    }
}
