/* Styles responsive pour le site */

/* Variables CSS */
:root {
    --nav-height: 64px;
    --mobile-menu-transition: 0.3s ease-in-out;
}

/* Reset et base */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Navigation responsive */
@media (max-width: 767px) {
    /* Ajustements pour la navigation mobile */
    nav .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Logo plus petit sur mobile */
    nav .text-xl {
        font-size: 1.125rem;
    }
    
    /* Masquer les éléments desktop */
    .hidden.md\:flex {
        display: none !important;
    }
    
    /* Boutons de navigation mobile */
    nav .flex.items-center.space-x-4 {
        gap: 0.5rem;
    }
    
    nav .flex.items-center.space-x-4 > button:not(.mobile-menu-btn),
    nav .flex.items-center.space-x-4 > a {
        display: none;
    }
    
    /* Menu mobile */
    .mobile-menu {
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: slideDown var(--mobile-menu-transition);
    }
    
    .mobile-menu.hidden {
        animation: none;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Bouton hamburger */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 0.5rem;
        transition: background-color 0.2s;
    }
    
    .mobile-menu-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-menu-btn svg {
        transition: transform 0.2s;
    }
    
    .mobile-menu-btn:active svg {
        transform: scale(0.9);
    }
}

/* Sections responsive */
@media (max-width: 640px) {
    /* Hero section */
    section.pt-32 {
        padding-top: 6rem;
    }
    
    h1.text-5xl,
    h1.text-6xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
    
    h2.text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
    
    /* Grilles responsive */
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.md\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .grid.lg\:grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Espacement mobile */
    .space-x-8 > * + * {
        margin-left: 1rem;
    }
    
    .space-x-12 > * + * {
        margin-left: 1.5rem;
    }
    
    /* Boutons responsive */
    .flex.flex-col.sm\:flex-row {
        flex-direction: column;
    }
    
    .flex.flex-col.sm\:flex-row > * {
        width: 100%;
    }
    
    /* Cards et conteneurs */
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Timeline responsive */
    .timeline-item .flex-1.text-right {
        text-align: left;
        padding-right: 0;
        padding-bottom: 1rem;
    }
    
    .timeline-item .flex-1.pl-8 {
        padding-left: 0;
        padding-top: 1rem;
    }
    
    /* Footer responsive */
    footer .grid.md\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    footer .flex.flex-col.md\:flex-row {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* Tablettes */
@media (min-width: 641px) and (max-width: 1023px) {
    /* Ajustements pour tablettes */
    .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.lg\:grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    h1.text-5xl.lg\:text-6xl {
        font-size: 3rem;
        line-height: 1;
    }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Support du mode sombre système */
@media (prefers-color-scheme: dark) {
    /* Les styles sont déjà optimisés pour le mode sombre */
}

/* Optimisations pour les écrans haute résolution */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Bordures plus fines sur les écrans Retina */
    .border {
        border-width: 0.5px;
    }
    
    .border-t {
        border-top-width: 0.5px;
    }
    
    .border-b {
        border-bottom-width: 0.5px;
    }
}

/* Styles pour l'impression */
@media print {
    nav,
    footer,
    .mobile-menu,
    .mobile-menu-btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .text-white {
        color: black !important;
    }
    
    .bg-black {
        background: white !important;
    }
}

/* Amélioration de la lisibilité sur petits écrans */
@media (max-width: 374px) {
    html {
        font-size: 14px;
    }
    
    .text-sm {
        font-size: 0.8125rem;
    }
    
    .text-xs {
        font-size: 0.75rem;
    }
}

/* Support pour les écrans très larges */
@media (min-width: 1920px) {
    .max-w-7xl {
        max-width: 1400px;
    }
}

/* Animations smooth pour les transitions */
.mobile-menu a,
.mobile-menu button {
    transition: all 0.2s ease-in-out;
}

.mobile-menu a:active,
.mobile-menu button:active {
    transform: scale(0.98);
}

/* Fix pour iOS Safari */
@supports (-webkit-touch-callout: none) {
    .mobile-menu {
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    body.menu-open {
        position: fixed;
        width: 100%;
    }
}

/* Amélioration du focus pour l'accessibilité */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.mobile-menu-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Styles pour les statistiques responsive */
@media (max-width: 640px) {
    .flex.items-center.space-x-8 {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .flex.items-center.space-x-8 > .h-10.w-px {
        display: none;
    }
}