/* ========================================
   PHASE 5 - MOBILE-FIRST & PERFORMANCE
   ======================================== */

/* Touch targets > 44px (Apple/Google recommandation) */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

/* Amélioration des boutons CTA pour mobile */
.btn-primary, .btn-secondary {
    min-height: 48px;
    min-width: 160px;
    font-size: 1rem;
    padding: 12px 24px;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Navigation mobile optimisée */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-menu.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.mobile-menu-item {
    display: block;
    padding: 16px 24px;
    border-bottom: 1px solid #f3f4f6;
    color: #1a2239;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus {
    background-color: #f8fafc;
    color: #0f7cb3;
}

.mobile-menu-item:last-child {
    border-bottom: none;
}

/* Hamburger menu icon - Correction des sélecteurs */
.hamburger,
#mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    position: relative;
}

.hamburger span,
#mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a2239;
    margin: 3px 0;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Animation du hamburger */
.hamburger.active span:nth-child(1),
#mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2),
#mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3),
#mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Overlay pour fermer le menu */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Optimisations pour les petits écrans */
@media (max-width: 768px) {
    .hamburger,
    #mobile-menu-btn {
        display: flex;
    }
    
    .desktop-nav {
        display: none;
    }
    
    /* Amélioration de l'accessibilité */
    .mobile-menu-item:focus {
        outline: 2px solid #0f7cb3;
        outline-offset: 2px;
    }
    
    /* Hero section mobile */
    .hero-content {
        padding: 40px 20px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        margin-bottom: 24px;
    }
    
    /* CTA buttons stack verticalement sur mobile */
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .cta-buttons .btn-primary,
    .cta-buttons .btn-secondary {
        width: 100%;
        max-width: 280px;
    }
    
    /* Stats mobile */
    .stats-mobile {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .stats-mobile .stat-item {
        min-width: 120px;
        padding: 8px;
    }
    
    /* Grille responsive pour les cartes */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    /* Spacing mobile */
    .section {
        padding: 60px 20px;
    }
    
    /* Confidence badges mobile */
    .confidence-badges {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .confidence-badge {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

/* Optimisations pour tablettes */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Performance - Lazy loading placeholder */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #f3f4f6;
    border-radius: 8px;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Optimisations vidéo mobile */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.video-mobile {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Contrôles vidéo mobile */
.video-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.video-control-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.video-control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Pause automatique pour économiser la batterie */
@media (max-width: 768px) {
    .video-autoplay {
        background: #f3f4f6;
    }
    
    .video-autoplay::after {
        content: "Appuyez pour lire";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #1a2239;
        font-weight: 500;
        background: white;
        padding: 8px 16px;
        border-radius: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* Amélioration des formulaires mobile */
.form-mobile input,
.form-mobile textarea,
.form-mobile select {
    min-height: 48px;
    font-size: 16px; /* Évite le zoom sur iOS */
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s ease;
}

.form-mobile input:focus,
.form-mobile textarea:focus,
.form-mobile select:focus {
    outline: none;
    border-color: #1194e2;
    box-shadow: 0 0 0 3px rgba(17, 148, 226, 0.1);
}

/* Optimisations pour les animations mobiles */
@media (prefers-reduced-motion: reduce) {
    .animate-fadeIn,
    .animate-slideUp,
    .animate-pulse-soft {
        animation: none;
    }
    
    .transition,
    .transition-colors {
        transition: none;
    }
}

/* Amélioration des contrastes (WCAG) */
.high-contrast {
    background: #1a2239;
    color: #ffffff;
}

.high-contrast .btn-primary {
    background: #1194e2;
    color: #ffffff;
    border: 2px solid #1194e2;
}

.high-contrast .btn-primary:hover {
    background: #0f7cb3;
    border-color: #0f7cb3;
}

.high-contrast .btn-secondary {
    background: #1ba3b8;
    color: #ffffff;
    border: 2px solid #1ba3b8;
}

.high-contrast .btn-secondary:hover {
    background: #158a9e;
    border-color: #158a9e;
}


/* Optimisations pour les écrans de petite taille */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section {
        padding: 40px 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    .stats-mobile .stat-item {
        min-width: 100px;
    }
}

/* Optimisations pour les écrans à haute densité */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-hd {
        background-image: url('../assets/images/logo/logo_SnapStudio@2x.png');
        background-size: contain;
    }
}

/* Préchargement des ressources critiques */
.preload-critical {
    font-display: swap;
}

/* Optimisations pour économiser la batterie */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        background: #1a1a1a;
        color: #ffffff;
    }
}

/* Scroll behavior amélioré */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Optimisations pour les connexions lentes */
@media (prefers-reduced-data: reduce) {
    .video-container {
        display: none;
    }
    
    .image-heavy {
        display: none;
    }
    
    .reduced-data-message {
        display: block;
        text-align: center;
        padding: 20px;
        background: #f8fafc;
        border-radius: 8px;
        margin: 20px 0;
    }
}

.reduced-data-message {
    display: none;
} 