/**
 * Le Studio By M - CSS Responsive
 * Optimisations mobile, tablette et desktop
 */

/* ====================================
   BREAKPOINTS
   ==================================== */

/* 
Mobile: < 576px
Tablette: 576px - 992px  
Desktop: > 992px
Large: > 1200px
*/

/* ====================================
   MOBILE FIRST - Base pour mobile
   ==================================== */

/* Container responsive */
.container-minimal,
.container {
    padding-left: 20px !important;
    padding-right: 20px !important;
    max-width: 100%;
}

/* ====================================
   TABLETTE - 576px et plus
   ==================================== */

@media (min-width: 576px) {
    .container-minimal,
    .container {
        padding-left: 30px !important;
        padding-right: 30px !important;
    }
}

/* ====================================
   DESKTOP - 992px et plus
   ==================================== */

@media (min-width: 992px) {
    .container-minimal {
        max-width: 1140px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .container {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ====================================
   MOBILE - max 768px
   ==================================== */

@media (max-width: 768px) {
    /* Typographie mobile */
    h1, .h1 {
        font-size: clamp(2rem, 8vw, 3rem) !important;
    }
    
    h2, .h2 {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
    }
    
    h3, .h3 {
        font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
    }
    
    /* Hero Section */
    .hero-section,
    .hero-minimal {
        padding: 60px 0 40px !important;
        min-height: auto !important;
    }
    
    .hero-video-container {
        height: 60vh !important;
        min-height: 400px !important;
    }
    
    /* Navigation */
    .navbar {
        padding: 10px 15px !important;
    }
    
    .navbar-brand img {
        max-height: 40px !important;
    }
    
    .nav-link {
        padding: 12px 0 !important;
        font-size: 1rem !important;
    }
    
    /* Boutons */
    .btn, .btn-lg {
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-primary, .btn-outline-primary {
        display: block !important;
        width: 100% !important;
    }
    
    /* Cards */
    .card, .card-minimal {
        margin-bottom: 20px !important;
    }
    
    .plan-card-minimal,
    .plan-card {
        margin-bottom: 20px !important;
    }
    
    /* Grid layouts */
    .plans-grid,
    .services-grid,
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Spacing */
    section {
        padding: 40px 0 !important;
    }
    
    .section-padding {
        padding: 40px 0 !important;
    }
    
    /* Footer */
    footer {
        padding: 40px 0 20px !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    /* Formulaires */
    .form-step,
    .registration-form {
        padding: 20px !important;
    }
    
    .form-row,
    .row {
        margin-bottom: 15px !important;
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Video */
    video {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Boutique */
    .product-card {
        margin-bottom: 20px;
    }
    
    .product-images {
        margin-bottom: 20px;
    }
    
    /* Planning */
    .schedule-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .schedule-table table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    /* Stats/Analytics */
    .stats-grid,
    .analytics-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 10px !important;
    }
    
    /* Texte */
    .text-large {
        font-size: 1rem !important;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    /* Steps indicator */
    .steps-indicator {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .step-label {
        font-size: 0.7rem !important;
    }
    
    /* Pricing cards */
    .pricing-section {
        padding: 30px 0 !important;
    }
    
    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }
}

/* ====================================
   TABLETTE - 576px à 992px
   ==================================== */

@media (min-width: 576px) and (max-width: 992px) {
    /* Grid 2 colonnes sur tablette */
    .plans-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Hero */
    .hero-section {
        padding: 80px 0 60px !important;
    }
    
    /* Boutons */
    .btn, .btn-lg {
        width: auto;
        display: inline-block;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ====================================
   SMARTPHONE - max 480px
   ==================================== */

@media (max-width: 480px) {
    /* Très petit écran */
    body {
        font-size: 14px !important;
    }
    
    h1, .h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }
    
    h2, .h2 {
        font-size: 1.5rem !important;
    }
    
    /* Hero */
    .hero-content {
        padding: 20px !important;
    }
    
    .hero-video-container {
        height: 50vh !important;
        min-height: 350px !important;
    }
    
    /* Navbar */
    .navbar-collapse {
        background: white;
        padding: 15px;
        border-radius: 10px;
        margin-top: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    
    /* Boutons */
    .btn, .btn-lg {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }
    
    /* Cards */
    .card, .plan-card {
        padding: 20px !important;
    }
    
    /* Espacements réduits */
    section {
        padding: 30px 0 !important;
    }
    
    :root {
        --space-xs: 0.25rem;
        --space-sm: 0.5rem;
        --space-md: 1rem;
        --space-lg: 2rem;
        --space-xl: 3rem;
        --space-2xl: 4rem;
    }
    
    /* Prix */
    .plan-price .price-amount,
    .price-amount {
        font-size: 2rem !important;
    }
    
    /* Formulaires */
    .form-control-lg {
        font-size: 0.95rem !important;
        padding: 10px 15px !important;
    }
    
    /* Steps */
    .step-circle {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.85rem !important;
    }
}

/* ====================================
   ORIENTATION LANDSCAPE (mobile horizontal)
   ==================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-video-container {
        height: 100vh !important;
    }
    
    .hero-section {
        min-height: 100vh !important;
    }
}

/* ====================================
   OPTIMISATIONS TOUCHSCREEN
   ==================================== */

@media (hover: none) {
    /* Agrandir zones tactiles */
    .btn,
    .nav-link,
    a {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
    }
    
    /* Désactiver effets hover */
    .card:hover,
    .btn:hover,
    .plan-card:hover {
        transform: none !important;
    }
}

/* ====================================
   PRINT (impression)
   ==================================== */

@media print {
    /* Masquer navigation et footer */
    nav, footer, .navbar, .btn {
        display: none !important;
    }
    
    /* Optimiser pour impression */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt !important;
    }
    
    a {
        text-decoration: underline !important;
    }
    
    /* Éviter coupures de page */
    .card, .section {
        page-break-inside: avoid;
    }
}

/* ====================================
   ACCESSIBILITÉ
   ==================================== */

/* Focus visible pour navigation clavier */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--logo-turquoise) !important;
    outline-offset: 2px !important;
}

/* Améliorer contraste pour malvoyants */
@media (prefers-contrast: high) {
    :root {
        --text-gray: #333;
        --medium-gray: #999;
    }
    
    .btn {
        border: 2px solid currentColor !important;
    }
}

/* Mode sombre (si système) */
@media (prefers-color-scheme: dark) {
    /* Désactivé pour garder identité visuelle */
    /* Décommentez si vous voulez un mode sombre */
    /*
    :root {
        --pure-white: #1A1A1A;
        --charcoal: #FFFFFF;
        --text-gray: #CCCCCC;
    }
    */
}

/* ====================================
   ANIMATIONS RÉDUITES (préférence système)
   ==================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====================================
   CORRECTIONS SPÉCIFIQUES PAR PAGE
   ==================================== */

/* Page d'accueil */
@media (max-width: 768px) {
    .hero-overlay {
        padding: 30px 20px !important;
    }
    
    .hero-overlay h1 {
        font-size: 2.5rem !important;
    }
    
    .stats-container {
        flex-direction: column !important;
        gap: 20px !important;
    }
}

/* Page cours */
@media (max-width: 768px) {
    .course-card {
        margin-bottom: 20px;
    }
    
    .course-details {
        flex-direction: column;
        gap: 15px;
    }
}

/* Page boutique */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr !important;
    }
    
    .product-details {
        padding: 20px !important;
    }
    
    .product-images-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Page abonnements */
@media (max-width: 768px) {
    .plan-toggle {
        flex-direction: column !important;
        width: 100%;
    }
    
    .toggle-btn {
        width: 100% !important;
        margin-bottom: 5px;
    }
    
    .billing-date-selector {
        padding: 15px !important;
    }
}

/* Page inscription */
@media (max-width: 768px) {
    .form-step {
        padding: 20px 15px !important;
    }
    
    .steps-indicator {
        margin-bottom: 20px;
        padding: 0 10px;
    }
    
    .step-item {
        flex: 1;
        min-width: 60px;
    }
    
    .step-circle {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
    }
    
    .step-label {
        font-size: 0.7rem !important;
        display: block;
    }
}

/* Admin responsive */
@media (max-width: 992px) {
    .admin-sidebar {
        position: fixed !important;
        left: -280px;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .admin-sidebar.show {
        left: 0 !important;
    }
    
    .admin-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* ====================================
   UTILITAIRES RESPONSIVE
   ==================================== */

/* Affichage conditionnel */
@media (max-width: 768px) {
    .d-none-mobile {
        display: none !important;
    }
    
    .d-block-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .d-none-desktop {
        display: none !important;
    }
    
    .d-block-desktop {
        display: block !important;
    }
}

/* Texte responsive */
.text-responsive {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.title-responsive {
    font-size: clamp(1.5rem, 5vw, 3rem);
}

/* Padding responsive */
.p-responsive {
    padding: clamp(1rem, 3vw, 3rem);
}

.py-responsive {
    padding-top: clamp(2rem, 5vw, 5rem);
    padding-bottom: clamp(2rem, 5vw, 5rem);
}

/* Gap responsive */
.gap-responsive {
    gap: clamp(1rem, 3vw, 2rem);
}

/* ====================================
   IMAGES RESPONSIVE
   ==================================== */

img {
    max-width: 100%;
    height: auto;
}

/* Images de cours */
.course-image,
.product-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

@media (max-width: 768px) {
    .course-image {
        height: 200px;
    }
    
    .product-image {
        height: 250px;
    }
}

/* ====================================
   TABLEAU RESPONSIVE
   ==================================== */

@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 8px !important;
        font-size: 0.85rem !important;
    }
}

/* ====================================
   MODAL RESPONSIVE
   ==================================== */

@media (max-width: 576px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 15px;
    }
    
    .modal-body {
        padding: 20px 15px;
    }
}

/* ====================================
   CART / PANIER RESPONSIVE
   ==================================== */

@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    .cart-summary {
        position: relative !important;
        width: 100% !important;
        margin-top: 20px;
    }
}

/* ====================================
   DASHBOARD MEMBRE RESPONSIVE
   ==================================== */

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    
    .booking-card {
        padding: 15px !important;
    }
    
    .subscription-card {
        padding: 20px !important;
    }
}

/* ====================================
   FIXES SPÉCIFIQUES
   ==================================== */

/* Fix overflow horizontal */
body {
    overflow-x: hidden;
}

/* Fix vidéo débordante */
video {
    max-width: 100%;
    height: auto;
}

/* Fix images boutique */
.product-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Fix footer columns */
@media (max-width: 768px) {
    .footer-column {
        width: 100% !important;
        margin-bottom: 30px;
    }
}

/* ====================================
   PERFORMANCES MOBILE
   ==================================== */

/* Optimisation scroll */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling sauf si motion réduite */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ====================================
   CORRECTIONS BOOTSTRAP OVERRIDE
   ==================================== */

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .row {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }
    
    .col, [class*="col-"] {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

