/* ============================================
   AMÉLIORATIONS MOBILE AVANCÉES
   ============================================ */

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        bottom: 0;
        width: 100%;
        max-width: 320px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background: rgba(0, 0, 0, 0.96);
        color: #fff;
        text-align: center;
        transition: right 0.3s ease;
        padding: 80px 0 20px;
        gap: 0;
        overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18);
        z-index: 1050;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-item {
        width: 100%;
        padding: 18px 0;
        border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        font-size: 1rem;
        padding: 10px 20px;
        display: inline-block;
        width: 100%;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

/* Touch-friendly buttons */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 18px 45px;
        min-height: 48px;
        font-size: 1.05rem;
    }

    .service-card {
        padding: 30px;
    }

    .floating-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    a {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
    }
}

/* Optimisation pour les petits écrans */
@media (max-width: 480px) {
    /* Typography optimization */
    body {
        font-size: 16px; /* Prévenir le zoom sur iOS */
    }

    /* Hero adjustments */
    .hero {
        min-height: 100vh;
        padding-top: 20px;
    }

    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.3;
    }

    .hero-description {
        font-size: 0.9rem;
        line-height: 1.5;
        max-width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }

    .btn {
        width: 100%;
        padding: 15px 20px;
    }

    /* Service cards touch optimization */
    .service-card {
        padding: 20px;
        margin: 0;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Portfolio grid */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .portfolio-image {
        aspect-ratio: 1;
    }

    /* Contact form */
    .contact-form-wrapper {
        padding: 20px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 1rem; /* Prévenir le zoom sur iOS */
        min-height: 48px;
    }

    .contact-content {
        gap: 20px;
    }

    /* Floating buttons repositioning */
    .floating-btn.whatsapp {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

    .floating-btn.call {
        bottom: 90px;
        right: 20px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-section {
        text-align: center;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 20px;
        min-height: auto;
    }

    .testimonial-text {
        font-size: 1rem;
    }
}

/* Landscape orientation optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 40px 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-description {
        display: none;
    }

    .hero-scroll {
        display: none;
    }
}

/* ============================================
   ANIMATIONS MOBILES OPTIMISÉES
   ============================================ */

/* Réduire les animations sur les appareils de faible performance */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimisation pour les appareils tactiles */
@supports (padding: max(0px)) {
    .btn,
    .service-card,
    .nav-link {
        /* Ajouter de l'espace pour les doigts */
        padding: max(padding-value, 10px);
    }
}

/* ============================================
   OPTIMISATIONS PERFORMANCE MOBILE
   ============================================ */

/* Lazy loading images */
img {
    loading: lazy;
}

/* Optimisé pour les connexions lentes */
@media (max-width: 768px) {
    .service-card,
    .portfolio-item,
    .training-card {
        transform: none; /* Réduire les transformations */
        will-change: auto;
    }

    .hero-background {
        background-attachment: scroll; /* Pas de parallax sur mobile */
    }
}

/* ============================================
   DARK MODE SUPPORT (Optionnel)
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --color-white: #0f0f0f;
        --color-black: #f5f5f5;
        --color-beige: #1a1a1a;
        --color-light-gray: #1a1a1a;
        --color-dark-gray: #d0d0d0;
    }

    .navbar {
        background: rgba(15, 15, 15, 0.95);
    }

    .service-card,
    .portfolio-info,
    .contact-form-wrapper {
        background: #1a1a1a;
        border-color: rgba(212, 175, 55, 0.2);
    }
}

/* ============================================
   OPTIMISATIONS SUPPLÉMENTAIRES
   ============================================ */

/* Smooth scrolling sur tous les navigateurs */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* Optimiser la performance avec will-change */
.navbar {
    will-change: transform;
}

.service-card:hover,
.portfolio-item:hover {
    will-change: transform;
}

/* Focus visible pour l'accessibilité */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* Supprimer le focus outline sur click mais le garder pour keyboard */
button:active,
a:active {
    outline: none;
}

/* ============================================
   OPTIMISATION POUR IPHONE/SAFARI
   ============================================ */

/* Éviter le zoom au focus sur input */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    font-size: 16px;
}

/* Smooth scrolling sur iOS */
-webkit-overflow-scrolling: touch;

/* Couleur du lien sur iOS */
a {
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
}

/* Status bar sur iOS */
body {
    background-color: #ffffff;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .hero-scroll,
    .floating-btn,
    .contact-form-wrapper,
    .footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        page-break-inside: avoid;
        page-break-after: always;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ============================================
   HIGH DPI SCREENS OPTIMIZATION
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-gold);
    color: var(--color-black);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode */
@media (prefers-contrast: more) {
    :root {
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    }

    .service-card,
    .portfolio-item {
        border: 2px solid var(--color-gold);
    }
}

/* Reduced motion for animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   CONTAINER QUERIES (Futur CSS)
   ============================================ */

@supports (container-type: inline-size) {
    .service-card,
    .portfolio-item,
    .training-card {
        container-type: inline-size;
    }

    @container (min-width: 400px) {
        .service-card {
            padding: 40px;
        }
    }

    @container (max-width: 300px) {
        .service-card {
            padding: 20px;
        }
    }
}
