/* Mobile Styles - Optimized for Kaptur */

/* Hide mobile menu by default on ALL screen sizes */
#navLinks {
    display: none;
}

/* Hide mobile-only elements on desktop */
.filters-header-mobile {
    display: none;
}

@media (max-width: 768px) {

    /* Show mobile filter header */
    .filters-header-mobile {
        display: flex !important;
    }

    /* =========================================
       1. GLOBAL RESET & SIZING
       ========================================= */
    html {
        font-size: 12px;
    }

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
    }

    body.menu-open {
        overflow: hidden !important;
        height: 100vh !important;
        touch-action: none !important;
    }

    body {
        /* overflow-x: hidden; - Moved to html, body */
        /* width: 100vw; - Changed to 100% and moved to html, body */
    }

    .container,
    .navbar-container {
        padding-left: 10px !important;
        padding-right: 15px !important;
        /* Plus d'espace à droite pour le burger */
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    /* Fix pour la partie droite (User + Burger) */
    .nav-right {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-shrink: 0 !important;
        /* Ne jamais rétrécir cette partie */
        margin-left: auto !important;
    }

    /* Fix pour le logo qui doit s'adapter */
    .logo,
    .navbar-logo {
        flex-shrink: 1 !important;
        /* Le logo peut rétrécir si besoin */
        min-width: 0 !important;
        /* Permet le rétrécissement flex */
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .section,
    .section-new {
        padding-left: 0 !important;
        padding-right: 8px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box;
    }

    #section-accueil {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #section-accueil * {
        margin-left: 0 !important;
    }

    .section {
        display: none !important;
        min-height: auto !important;
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    #section-accueil {
        padding-top: 0 !important;
    }

    .section.active {
        display: block !important;
    }

    #notificationPanel,
    .notification-panel {
        width: 100% !important;
        max-width: 100vw !important;
        right: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        border-radius: 0 !important;
        display: none;
        transform: translateX(100%);
        z-index: 2000 !important;
    }

    #notificationPanel.active,
    .notification-panel.active {
        display: block !important;
        transform: translateX(0);
    }

    #kptur-intro-overlay {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        z-index: -9999 !important;
    }

    /* HOMEPAGE OVERFLOW FIXES */
    /* Fix "Voir tous les coaches" button overflow */
    .btn-new,
    .btn-outline-new,
    .btn-primary-new {
        max-width: 100% !important;
        width: auto !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 0.75rem 1rem !important;
    }

    /* Fix why-kaptur-stats overflow (48h box) */
    .why-kaptur-stats {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 1rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        padding: 1rem 0.5rem !important;
        overflow-x: hidden !important;
    }

    .why-kaptur-stats>div {
        flex: 0 1 calc(33.333% - 1rem) !important;
        min-width: 90px !important;
        max-width: 120px !important;
        box-sizing: border-box !important;
        padding: 0.5rem !important;
    }

    /* =========================================
       2. COACH CARDS - SAME VISUAL AS WEB BUT MINIATURIZED
       ========================================= */

    /* Grid Layout */
    #topCoaches.coaches-carousel,
    #coachesGrid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px 12px !important;
        /* Increased to 12px to prevent edge cutoff */
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* Main Card Wrapper - Restore visual style from CSS but scaled */
    #topCoaches .coach-card,
    #coachesGrid .coach-card {
        width: calc(100% - 8px) !important;
        min-width: 0 !important;
        max-width: calc(100% - 8px) !important;
        height: auto !important;
        min-height: 160px !important;
        padding: 0 !important;
        margin: 4px !important;
        /* Increased from 2px to 4px to prevent border cutoff */
        display: flex !important;
        flex-direction: column !important;

        /* Mimic Web Style */
        background: rgba(15, 23, 42, 0.8) !important;
        border: 1px solid rgba(168, 85, 247, 0.3) !important;
        border-radius: 10px !important;
        overflow: visible !important;
        /* Permet aux badges de dépasser */
        position: relative !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    }

    /* --- HEADER SECTION (Avatar + Info) --- */

    /* Force Column Layout for Header on Mobile (Web is Row) */
    #topCoaches .coach-card-header-new,
    #coachesGrid .coach-card-header-new {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        padding: 10px 4px 4px 4px !important;
        width: 100% !important;
        height: auto !important;
        /* Mimic Web Header Gradient? Or keep transparent? 
           Web uses transparent header inside content usually, 
           but let's ensure it fits. */
    }

    /* Avatar */
    #topCoaches .coach-avatar-container,
    #coachesGrid .coach-avatar-container {
        position: relative !important;
        flex-shrink: 0 !important;
        margin-bottom: 4px !important;
    }

    #topCoaches .coach-avatar-img,
    #coachesGrid .coach-avatar-img {
        width: 50px !important;
        /* Scaled down from 80px */
        height: 50px !important;
        border-radius: 50% !important;
        border: 2px solid rgba(168, 85, 247, 1) !important;
        /* Purple border like web */
        box-shadow: 0 0 10px rgba(168, 85, 247, 0.3) !important;
        object-fit: cover !important;
    }

    #topCoaches .coach-online-indicator,
    #coachesGrid .coach-online-indicator {
        width: 8px !important;
        height: 8px !important;
        bottom: 0 !important;
        right: 0 !important;
        border: 1px solid rgba(15, 23, 42, 1) !important;
    }

    /* Coach Info */
    #topCoaches .coach-info-header,
    #coachesGrid .coach-info-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 2px !important;
        width: 100% !important;
    }

    /* Name - White & Bold */
    #topCoaches .coach-name-new,
    #coachesGrid .coach-name-new {
        font-size: 0.85rem !important;
        /* Tiny but readable */
        font-weight: 700 !important;
        color: white !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    }

    /* Title - Hide on very small cards */
    #topCoaches .coach-title-new,
    #coachesGrid .coach-title-new {
        display: none !important;
    }

    /* Rating - Stars + Value */
    #topCoaches .coach-rating-new,
    #coachesGrid .coach-rating-new {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        margin-top: 2px !important;
    }

    #topCoaches .stars-new,
    #coachesGrid .stars-new {
        display: flex !important;
        gap: 1px !important;
    }

    #topCoaches .stars-new i,
    #coachesGrid .stars-new i {
        font-size: 9px !important;
        /* Tiny stars */
    }

    #topCoaches .rating-value-new,
    #coachesGrid .rating-value-new {
        font-size: 0.7rem !important;
        font-weight: 600 !important;
        color: white !important;
    }

    #topCoaches .rating-count-new,
    #coachesGrid .rating-count-new {
        display: none !important;
    }

    /* --- BODY SECTIONS --- */

    /* ELO Section - Styled Box */
    #topCoaches .coach-elo-section,
    #coachesGrid .coach-elo-section {
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid rgba(168, 85, 247, 0.2) !important;
        border-radius: 6px !important;
        padding: 4px !important;
        margin: 4px 4px 0 4px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        min-height: auto !important;
    }

    #topCoaches .elo-label,
    #coachesGrid .elo-label {
        font-size: 0.45rem !important;
        color: rgba(255, 255, 255, 0.5) !important;
        margin-bottom: 1px !important;
        letter-spacing: 0.5px !important;
    }

    #topCoaches .elo-value,
    #coachesGrid .elo-value {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        color: white !important;
        margin: 0 !important;
    }

    /* Pricing Section - Simplified */
    #topCoaches .coach-pricing-section,
    #coachesGrid .coach-pricing-section {
        border-top: none !important;
        /* Remove divider to save space */
        padding: 4px !important;
        margin: 2px 4px !important;
        min-height: auto !important;
    }

    /* Notification Panel Mobile */
    .notification-header {
        padding: 1rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .notification-header h3 {
        flex: 1 !important;
        margin: 0 !important;
        font-size: 1.1rem !important;
    }

    .notification-actions {
        display: flex !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .notification-actions .btn-clear-all {
        order: 1 !important;
        /* Delete button on left */
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: static !important;
        /* Force static to prevent overlap */
        margin: 0 !important;
        transform: none !important;
        background: rgba(255, 255, 255, 0.1) !important;
        /* Slight background to see bounds */
        border-radius: 50% !important;
    }

    .notification-actions .btn-close {
        order: 2 !important;
        /* Close button on right */
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: static !important;
        /* Force static to prevent overlap */
        margin: 0 !important;
        transform: none !important;
    }

    /* Prevent background scroll when notifications panel is open */
    body.notifications-open {
        overflow: hidden !important;
        height: 100vh !important;
        touch-action: none !important;
    }

    /* Mobile Profile Avatar Size */
    .profil-avatar {
        width: 40px !important;
        height: 40px !important;
        margin: 0 auto 0.5rem !important;
    }

    .profil-avatar img {
        width: 40px !important;
        height: 40px !important;
    }

    /* Capture (Kaptur) Section - Mobile Layout Fixes - AGGRESSIVE */
    #section-kaptur {
        overflow-x: hidden !important;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    #section-kaptur * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #section-kaptur .container {
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #section-kaptur .kaptur-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
    }

    #section-kaptur .kaptur-title-group {
        margin-bottom: 1rem !important;
        width: 100% !important;
    }

    #section-kaptur h1 {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
        word-wrap: break-word !important;
    }

    #section-kaptur img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* Force vertical layout for all direct children */
    #section-kaptur>*,
    #section-kaptur .container>*,
    #section-kaptur .row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* Reservation Section - Mobile Layout Fixes - AGGRESSIVE */
    #section-reservation {
        overflow-x: hidden !important;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    #section-reservation * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #section-reservation .container {
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #section-reservation h1,
    #section-reservation h2 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        word-wrap: break-word !important;
    }

    #section-reservation .booking-modal-new,
    #section-reservation .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
    }

    #section-reservation .booking-calendar-new {
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 4px !important;
    }

    /* Force vertical layout for all direct children */
    #section-reservation>*,
    #section-reservation .container>*,
    #section-reservation .row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* Ensure no elements can cause horizontal scroll */
    #section-kaptur .col,
    #section-kaptur [class*="col-"],
    #section-reservation .col,
    #section-reservation [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem 0 !important;
    }

    /* Kaptur Grid - Force single column on mobile */
    #section-kaptur .kaptur-grid,
    .kaptur-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100% !important;
        padding: 0.5rem !important;
    }

    /* Kaptur Cards - ensure they fit screen */
    #section-kaptur .kaptur-card,
    .kaptur-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1rem 0 !important;
        box-sizing: border-box !important;
    }

    /* Kaptur Header - Ensure buttons are accessible */
    #section-kaptur .kaptur-header {
        flex-wrap: wrap !important;
        gap: 1rem !important;
    }

    #section-kaptur .kaptur-header .btn-primary,
    #section-kaptur #createAuction {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        box-sizing: border-box !important;
        /* Ensure button is clickable */
        pointer-events: auto !important;
        cursor: pointer !important;
        z-index: 1 !important;
    }

    /* Kaptur Tabs - Responsive layout like reservations */
    .kaptur-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .kaptur-tabs .tab-btn {
        flex: 1 1 auto !important;
        min-width: calc(33.333% - 0.5rem) !important;
        padding: 0.6rem 0.5rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
        /* Ensure buttons are clickable */
        pointer-events: auto !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    }

    /* All buttons in Kaptur section - ensure clickable */
    #section-kaptur button {
        pointer-events: auto !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        position: relative !important;
        z-index: 10 !important;
    }

    /* Kaptur Tab Content - STRICT VISIBILITY */
    #section-kaptur .tab-content {
        display: none !important;
        width: 100% !important;
    }

    #section-kaptur .tab-content.active {
        display: block !important;
        animation: none !important;
        /* Remove animation on mobile to prevent glitches */
    }

    /* Reservation Section - ULTRA AGGRESSIVE Force vertical layout */
    #section-reservation,
    section[id*="reservation"],
    section[class*="reservation"] {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* Force ALL grids in reservation to single column */
    #section-reservation *[class*="grid"],
    #section-reservation .coaches-grid,
    #section-reservation .reservation-grid,
    #section-reservation .booking-grid,
    section[id*="reservation"] *[class*="grid"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100% !important;
        padding: 0.5rem !important;
    }

    /* Force ALL rows in reservation to column */
    #section-reservation .row,
    #section-reservation *[class*="row"],
    section[id*="reservation"] .row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* Reservation Cards */
    #section-reservation .coach-card,
    #section-reservation .reservation-card,
    #section-reservation .booking-card,
    #section-reservation *[class*="card"] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1rem 0 !important;
        box-sizing: border-box !important;
        flex: none !important;
    }

    /* Force all columns to full width */
    #section-reservation *[class*="col"],
    section[id*="reservation"] *[class*="col"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Mes Réservations Section - Specific Mobile Fixes */
    #section-mes-reservations {
        overflow-x: hidden !important;
        width: 100% !important;
        padding: 1rem !important;
    }

    #section-mes-reservations .container {
        padding: 0 !important;
        width: 100% !important;
    }

    /* Reservations Tabs - Force responsive layout */
    .reservations-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .reservations-tabs .tab-btn {
        flex: 1 1 auto !important;
        min-width: calc(33.333% - 0.5rem) !important;
        padding: 0.6rem 0.5rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    /* =========================================
       UNIVERSAL SECTION LAYOUT - MOBILE
       All sections follow same pattern:
       - Header with title at top
       - Content below, within bounds
       ========================================= */

    /* Apply to ALL sections */
    .section .container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Section Headers - consistent across all */
    .kaptur-header,
    .reservations-header,
    .profil-header,
    .section-header {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-bottom: 1.5rem !important;
        gap: 1rem !important;
    }

    /* Section Title Groups */
    .kaptur-title-group,
    .reservations-title-group,
    .profil-title-group,
    .section-title-group {
        width: 100% !important;
    }

    /* Section Titles */
    .section h1 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        word-wrap: break-word !important;
        margin-bottom: 0.5rem !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Force no top spacing on first child of sections */
    .section> :first-child,
    .section .container> :first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* FIX SPECIFIC FOR TROUVER UN COACH */
    #section-recherche {
        padding-top: 55px !important;
        /* Reduced to 55px - very aggressive */
        margin-top: 0 !important;
    }

    #section-recherche .search-container-new {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    #section-recherche .search-header-new {
        margin-top: -15px !important;
        /* Increased negative margin */
        padding-top: 0 !important;
        margin-bottom: 0.5rem !important;
        /* Further reduced bottom margin */
    }

    /* FIX SPECIFIC FOR DEVENIR COACH */
    #section-devenir-coach {
        padding-top: 55px !important;
        margin-top: 0 !important;
    }

    #section-devenir-coach .devenir-coach-container-new {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    #section-devenir-coach .devenir-coach-hero-new {
        margin-top: -15px !important;
        padding-top: 0 !important;
    }

    /* Section Descriptions */
    .kaptur-description,
    .reservations-description,
    .section-description {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }

    /* Mes Réservations Section - Specific Mobile Fixes */
    #section-mes-reservations {
        overflow-x: hidden !important;
        width: 100% !important;
        padding: 1rem !important;
    }

    #section-mes-reservations .container {
        padding: 0 !important;
        width: 100% !important;
    }

    /* Reservations Header - Like Kaptur */
    #section-mes-reservations .reservations-header {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-bottom: 1rem !important;
    }

    /* Reservations Tabs - Force responsive layout */
    .reservations-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 1rem !important;
    }

    .reservations-tabs .tab-btn {
        flex: 1 1 auto !important;
        min-width: calc(33.333% - 0.5rem) !important;
        max-width: calc(33.333% - 0.5rem) !important;
        padding: 0.6rem 0.4rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Reservations List - Ensure vertical layout */
    .reservations-list {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 0.5rem 0 !important;
    }

    /* Reservation Cards - Full width mobile */
    .reservation-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1rem 0 !important;
        box-sizing: border-box !important;
    }

    /* =========================================
       PROFILE SECTION - MOBILE LAYOUT
       ========================================= */

    #section-profil {
        overflow-x: hidden !important;
        width: 100% !important;
        padding: 1rem !important;
    }

    #section-profil .container {
        padding: 0 !important;
        width: 100% !important;
    }

    /* Profile Layout - Force vertical stacking */
    .profil-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 1rem !important;
    }

    /* Profile Sidebar - Full width on mobile */
    .profil-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
    }

    /* Profile Content - Full width */
    .profil-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem !important;
        box-sizing: border-box !important;
    }

    /* Profile Tabs - Responsive layout */
    .profil-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
        padding: 0.5rem !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
    }

    .profil-tabs .tab-btn {
        flex: 1 1 auto !important;
        min-width: calc(23% - 0.5rem) !important;
        padding: 0.6rem 0.3rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    /* Profile Tab Content */
    .profil-content .tab-content {
        width: 100% !important;
        padding: 1rem 0.5rem !important;
    }

    /* Form Grids - Force single column */
    #section-profil .form-grid,
    .profil-content .form-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    #section-profil .form-group,
    .profil-content .form-group {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Payment Methods Grid */
    #section-profil .payment-methods,
    .payment-methods {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    /* Settings Section */
    #section-profil .settings-section {
        width: 100% !important;
        margin-bottom: 1.5rem !important;
    }

    /* Ensure all inputs are full width */
    #section-profil input,
    #section-profil select,
    #section-profil textarea {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* =========================================
       PAYMENT SECTION - MOBILE RESPONSIVE
       ========================================= */

    /* Payment Tab Content */
    #tab-paiement {
        width: 100% !important;
        overflow-x: hidden !important;
        padding: 0.5rem !important;
    }

    /* Payment Section Container */
    #tab-paiement .payment-section,
    .payment-section {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
        overflow-x: hidden !important;
    }

    /* Payment Table - Card Layout for Mobile */
    .payments-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
    }

    .payments-table thead {
        display: none !important;
        /* Hide headers */
    }

    .payments-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .payments-table tr {
        display: flex !important;
        flex-direction: column !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(168, 85, 247, 0.2) !important;
        border-radius: 12px !important;
        padding: 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .payments-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.5rem 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        width: 100% !important;
        text-align: right !important;
    }

    .payments-table td:last-child {
        border-bottom: none !important;
    }

    /* Add labels via CSS content for each column */
    .payments-table td:nth-of-type(1)::before {
        content: "Date";
        font-weight: bold;
        color: #94a3b8;
    }

    .payments-table td:nth-of-type(2)::before {
        content: "Client";
        font-weight: bold;
        color: #94a3b8;
    }

    .payments-table td:nth-of-type(3)::before {
        content: "Origine";
        font-weight: bold;
        color: #94a3b8;
    }

    .payments-table td:nth-of-type(4)::before {
        content: "Montant";
        font-weight: bold;
        color: #94a3b8;
    }

    .payments-table td:nth-of-type(5)::before {
        content: "Statut";
        font-weight: bold;
        color: #94a3b8;
    }

    /* Remove horizontal scroll wrapper styles since we are now vertical */
    #tab-paiement .table-wrapper,
    .payments-table-wrapper {
        overflow-x: visible !important;
    }

    /* Payment Methods */
    .payment-methods {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .payment-method-card {
        width: 100% !important;
        padding: 0.75rem !important;
        box-sizing: border-box !important;
    }

    /* Verification Button */
    #tab-paiement button,
    .payment-section button {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
        box-sizing: border-box !important;
        margin: 0.5rem 0 !important;
    }

    /* =========================================
       SETTINGS/PARAMETRES SECTION - MOBILE
       ========================================= */

    #tab-parametres {
        width: 100% !important;
        padding: 0.5rem !important;
    }

    .settings-section {
        width: 100% !important;
        margin-bottom: 1.5rem !important;
    }

    .settings-option {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }

    /* Modal Adjustments */
    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
    }

    /* Mobile Chat Input Fix - ULTRA SPECIFIC */
    /* Reset Section Constraints avec support safe area */
    #section-messages {
        padding: 0 !important;
        padding-top: env(safe-area-inset-top) !important;
        /* Respecter la safe area en haut (encoche iPhone) */
        padding-bottom: env(safe-area-inset-bottom) !important;
        /* Respecter la safe area en bas (barre navigation) */
        height: 100dvh !important;
        /* Use dvh (dynamic viewport height) pour gérer les barres de navigation */
        overflow: hidden !important;
        margin: 0 !important;
    }

    #section-messages .container {
        padding: 0 !important;
        height: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .messages-layout-new {
        height: 100% !important;
        /* Fill the section */
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    .chat-area-new {
        height: 100% !important;
        /* Fill the section */
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        transform: none !important;
        background: #000000 !important;
        /* Background noir pour correspondre */
    }

    .messages-area-new {
        padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)) !important;
        /* Espace pour input (70px) + barre navigation (80px) + safe area + espace vide généreux (50px) - ajusté dynamiquement par JS */
        height: auto !important;
        overflow-y: auto !important;
        flex: 1 !important;
        /* Fill remaining space */
        min-height: 0 !important;
        scroll-padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)) !important;
        /* Assurer que le scroll fonctionne jusqu'en bas */
    }

    #section-messages .message-input-area-new,
    .messages-section-new .message-input-area-new,
    .chat-area-new .message-input-area-new,
    .message-input-area-new {
        position: fixed !important;
        /* Garder fixed pour éviter le bloc noir */
        bottom: max(80px, env(safe-area-inset-bottom, 80px)) !important;
        /* Valeur minimale de 80px pour Chrome Android, iOS utilise safe-area */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        background: #000000 !important;
        /* Background noir pour correspondre au reste */
        padding: 10px !important;
        padding-bottom: calc(10px + max(80px, env(safe-area-inset-bottom, 80px))) !important;
        /* Padding supplémentaire avec valeur minimale */
        height: auto !important;
        max-height: 100px !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
        margin: 0 !important;
        transform: none !important;
        flex-shrink: 0 !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        /* Transition douce pour les ajustements JavaScript */
        transition: bottom 0.2s ease, padding-bottom 0.2s ease !important;
    }

    /* Fix conversation list to full height */
    .conversations-list-new {
        height: 100% !important;
        /* Fill the section */
        max-height: none !important;
        min-height: 0 !important;
        width: 100% !important;
    }

    .conversations-scroll-new {
        height: calc(100vh - 80px) !important;
        /* Full height minus header */
        overflow-y: auto !important;
    }

    #topCoaches .price-row,
    #coachesGrid .price-row {
        display: flex !important;
        justify-content: center !important;
        gap: 6px !important;
    }

    #topCoaches .price-col,
    #coachesGrid .price-col {
        text-align: center !important;
    }

    #topCoaches .price-label,
    #coachesGrid .price-label {
        display: block !important;
        /* Show labels "Semaine/Weekend" */
        font-size: 0.65rem !important;
        margin-bottom: 2px !important;
        color: #94a3b8 !important;
    }

    #topCoaches .price-value,
    #coachesGrid .price-value {
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        color: #a855f7 !important;
        margin: 0 !important;
    }

    /* Only show one price if possible, or side by side */

    /* Hide Specialties Section */
    #topCoaches .coach-specialties-section,
    #coachesGrid .coach-specialties-section {
        display: none !important;
    }

    /* Footer - Reserve Button */
    #topCoaches .coach-card-footer-new,
    #coachesGrid .coach-card-footer-new {
        padding: 4px !important;
        margin-top: auto !important;
        /* Push to bottom */
    }

    #topCoaches .btn-reserve-coach,
    #coachesGrid .btn-reserve-coach {
        width: 100% !important;
        padding: 4px 0 !important;
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
        background: linear-gradient(90deg, #FFFFFF 0%, rgba(168, 85, 247, 1) 100%) !important;
        /* Restore web gradient */
        border: none !important;
        color: black !important;
        /* Web text color */
        cursor: pointer !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        box-shadow: 0 2px 5px rgba(168, 85, 247, 0.3) !important;
    }

    #topCoaches .btn-reserve-coach span,
    #coachesGrid .btn-reserve-coach span {
        position: relative !important;
        z-index: 2 !important;
        font-size: 0.65rem !important;
    }

    /* Rank Badge - Circular like web (scaled for mobile) */
    #topCoaches .coach-rank-badge,
    #coachesGrid .coach-rank-badge {
        display: flex !important;
        flex-direction: column !important;
        /* Icône en haut, numéro en bas */
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        left: -5px !important;
        /* Légèrement hors de la carte comme sur web */
        top: -5px !important;
        z-index: 10 !important;
        width: 30px !important;
        /* Réduit de 40px web à 30px mobile */
        height: 30px !important;
        border-radius: 50% !important;
        /* Circulaire comme web */
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) !important;
        /* Ombre comme web */
        transition: all 0.3s !important;
    }

    #topCoaches .coach-rank-badge i,
    #coachesGrid .coach-rank-badge i {
        font-size: 0.65rem !important;
        /* 12px environ */
        margin-bottom: 1px !important;
    }

    #topCoaches .coach-rank-badge span,
    #coachesGrid .coach-rank-badge span {
        font-size: 0.5rem !important;
        /* 8px environ */
        font-weight: 700 !important;
        line-height: 1 !important;
    }

    /* Rank Badge Colors - Same as web */
    .rank-badge-gold {
        background: linear-gradient(135deg, #FFD700, #FFA500) !important;
        color: #1a1a1a !important;
    }

    .rank-badge-silver {
        background: linear-gradient(135deg, #C0C0C0, #A0A0A0) !important;
        color: #1a1a1a !important;
    }

    .rank-badge-bronze {
        background: linear-gradient(135deg, #CD7F32, #B8860B) !important;
        color: white !important;
    }

    .rank-badge-default {
        background: rgba(168, 85, 247, 0.8) !important;
        color: white !important;
    }

    /* NEW Badge - Visible on Mobile (top-right corner) */
    #topCoaches .new-coach-badge,
    #coachesGrid .new-coach-badge {
        display: block !important;
        position: absolute !important;
        top: 5px !important;
        right: 5px !important;
        z-index: 10 !important;
        background: linear-gradient(135deg, #ef4444, #dc2626) !important;
        color: white !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
        font-size: 0.6rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    }

    /* Hide chess piece decorations */
    .chess-piece-card,
    .coach-card-header::before,
    .coach-card-header::after {
        display: none !important;
    }

    /* =========================================
       3. FOOTER - 3 COLUMNS LAYOUT
       ========================================= */

    /* Override main footer padding */
    .footer-new {
        padding-top: 10px !important;
        /* Reduced from 4rem */
        padding-bottom: 10px !important;
        /* Reduced from 2rem */
    }

    .footer-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        /* 3 columns as requested */
        gap: 5px !important;
        /* Reduced gap */
        padding: 10px 5px !important;
        /* Reduced padding */
        width: 100% !important;
        overflow-x: hidden !important;
        margin-bottom: 10px !important;
        /* Reduced from 3rem */
    }

    /* Reorder items: Nav, Legal, Contact first */
    .footer-col:nth-child(2) {
        /* Navigation */
        order: 1 !important;
    }

    .footer-col:nth-child(3) {
        /* Legal */
        order: 2 !important;
    }

    .footer-col:nth-child(4) {
        /* Contact */
        order: 3 !important;
    }

    /* Logo & Description at the bottom, full width */
    .footer-col:nth-child(1) {
        order: 4 !important;
        grid-column: 1 / -1 !important;
        /* Span all 3 columns */
        text-align: center !important;
        margin-top: 10px !important;
        /* Reduced margin */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .footer-col {
        width: 100% !important;
        min-width: 0 !important;
        padding: 2px !important;
        /* Reduced padding */
        font-size: 0.7rem !important;
    }

    .footer-col p {
        font-size: 0.7rem !important;
        line-height: 1.3 !important;
        /* Reduced line height */
    }

    .footer-col h3 {
        font-size: 0.85rem !important;
        margin-bottom: 5px !important;
        /* Reduced margin */
    }

    .footer-links li,
    .footer-links a {
        font-size: 0.65rem !important;
        padding: 1px 0 !important;
        /* Reduced padding */
        line-height: 1.2 !important;
        /* Reduced line height */
    }

    .footer-col:first-child {
        padding-bottom: 0 !important;
    }

    /* Center logo content */
    .footer-col:nth-child(1)>div:first-child {
        justify-content: center !important;
        margin-bottom: 0.5rem !important;
        /* Reduced margin */
    }

    .footer-col:nth-child(1) p {
        margin-bottom: 0.5rem !important;
        /* Reduced margin */
    }

    .footer-social {
        margin-top: 5px !important;
        /* Reduced margin */
        padding-top: 0 !important;
        display: flex !important;
        justify-content: center !important;
        gap: 10px !important;
    }

    .footer-social a {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
        background: rgba(168, 85, 247, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .footer-bottom {
        font-size: 0.6rem !important;
        padding: 5px 0 !important;
        /* Reduced padding */
        margin: 0 !important;
        text-align: center !important;
    }

    .footer-col .logo-icon-box {
        width: 1.5rem !important;
        height: 1.5rem !important;
        font-size: 0.8rem !important;
    }

    /* =========================================
       4. "COMMENT ÇA MARCHE" - COMPACT HORIZONTAL
       ========================================= */

    .how-it-works-section {
        padding: 10px 5px !important;
    }

    .how-it-works-section .section-title-new {
        margin-bottom: 10px !important;
    }

    .timeline-line,
    .timeline-progress {
        display: none !important;
    }

    .steps-container {
        position: relative !important;
        display: block !important;
        height: 250px !important;
        width: 85% !important;
        max-width: 350px !important;
        margin: 0 auto 0 5% !important;
        overflow: visible !important;
    }

    .step-item {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        opacity: 0 !important;
        transform: scale(0.9) translateY(20px) !important;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 0 !important;
        pointer-events: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 15px 12px !important;
        background: rgba(15, 23, 42, 0.8) !important;
        border-radius: 12px !important;
        border: 1px solid rgba(168, 85, 247, 0.2) !important;
        margin: 0 !important;
    }

    .step-item.carousel-active {
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
        z-index: 10 !important;
        pointer-events: auto !important;
    }

    .step-item.hidden {
        display: flex !important;
    }

    .step-circle {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
        margin-bottom: 10px !important;
        order: -1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: linear-gradient(135deg, #a855f7, #6366f1) !important;
        border-radius: 50% !important;
        color: white !important;
        font-weight: 700 !important;
    }

    .step-content-left-group,
    .step-content-right-group {
        display: contents !important;
    }

    .step-icon-card {
        margin: 8px 0 !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
    }

    .step-icon-box {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }

    .step-text-content {
        width: 100% !important;
        text-align: center !important;
        padding: 0 !important;
        margin-top: 8px !important;
    }

    .step-text-content h3 {
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }

    .step-text-content p {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
        color: #94a3b8 !important;
    }

    /* =========================================
       5. STATS - FIT ON ONE LINE, NO SCROLL
       ========================================= */

    .why-kaptur-stats {
        margin-top: 15px !important;
        margin-bottom: 20px !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 5px !important;
        padding: 10px 5px !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .why-kaptur-stats>div {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 8px 4px !important;
        background: rgba(15, 23, 42, 0.5) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(168, 85, 247, 0.2) !important;
        text-align: center !important;
    }

    .why-kaptur-stats>div>div:first-child {
        font-size: 1.2rem !important;
        margin-bottom: 2px !important;
    }

    .why-kaptur-stats>div>div:last-child {
        font-size: 0.55rem !important;
        white-space: nowrap !important;
    }

    /* =========================================
       6. FILTERS PANEL WITH CLOSE BUTTON
       ========================================= */

    .filters-panel-new {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        background: #0f172a !important;
        z-index: 2500 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding-top: 20px !important;
        box-sizing: border-box !important;
    }

    .filters-panel-new.open {
        transform: translateX(0) !important;
    }

    .filters-panel-content-new {
        padding: 15px !important;
        padding-bottom: 80px !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .filters-header-mobile {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid rgba(168, 85, 247, 0.2) !important;
    }

    .filters-title-new {
        margin: 0 !important;
        font-size: 1.1rem !important;
    }

    .btn-close-filters {
        width: 36px !important;
        height: 36px !important;
        border-radius: 50% !important;
        background: rgba(168, 85, 247, 0.2) !important;
        border: none !important;
        color: #a855f7 !important;
        font-size: 1rem !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* =========================================
       7. MENUS & NAVIGATION
       ========================================= */

    .mobile-menu-toggle {
        display: block !important;
        background-color: transparent !important;
        opacity: 1 !important;
        border: none !important;
        padding: 6px 10px;
        z-index: 3000 !important;
        box-shadow: none !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }

    .mobile-menu-toggle span {
        background-color: #fff !important;
        height: 2px;
        margin: 4px 0;
        width: 20px;
        display: block;
    }

    #navLinks {
        z-index: 2999 !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        background-color: #0f172a !important;
        padding: 0.75rem !important;
        flex-direction: column !important;
        border-bottom: 1px solid rgba(168, 85, 247, 0.2) !important;
        display: none !important;
    }

    #navLinks.mobile-open {
        display: flex !important;
    }

    #navLinks .nav-link {
        color: #ffffff !important;
        padding: 10px 12px !important;
        display: block !important;
        text-decoration: none !important;
        font-size: 0.9rem !important;
    }

    #userDropdown {
        position: fixed !important;
        top: 60px !important;
        right: 8px !important;
        width: 220px !important;
        background-color: #0f172a !important;
        border: 1px solid rgba(168, 85, 247, 0.3) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9) !important;
        z-index: 2000 !important;
        padding: 8px !important;
        border-radius: 10px !important;
    }

    .dropdown-item {
        color: #ffffff !important;
        opacity: 1 !important;
        background: transparent !important;
        display: flex !important;
        align-items: center;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    .dropdown-item i {
        color: #a855f7 !important;
        margin-right: 8px;
    }

    .dropdown-item span {
        display: inline-block !important;
        color: #ffffff !important;
    }

    /* Hide admin validation link on mobile */
    #validationCoachLink {
        display: none !important;
    }

    /* =========================================
       8. OTHER ELEMENTS - COMPACT
       ========================================= */

    .features-grid-new {
        position: relative !important;
        display: block !important;
        height: 200px !important;
        width: 85% !important;
        max-width: 350px !important;
        margin: 0 auto 10px auto !important;
        overflow: visible !important;
    }

    .feature-card-new {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        opacity: 0 !important;
        transform: scale(0.9) translateY(20px) !important;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 0 !important;
        pointer-events: none !important;
        padding: 12px !important;
    }

    .feature-card-new.carousel-active {
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
        z-index: 10 !important;
        pointer-events: auto !important;
    }

    .feature-card-new h3 {
        font-size: 0.9rem !important;
    }

    .feature-card-new p {
        font-size: 0.75rem !important;
        max-height: 80px !important;
        overflow-y: auto !important;
        margin-bottom: 10px !important;
        line-height: 1.4 !important;
    }

    .testimonials-grid {
        position: relative !important;
        display: block !important;
        height: 220px !important;
        width: 90% !important;
        max-width: 350px !important;
        margin: 0 auto 0 auto !important;
        overflow: visible !important;
    }

    .testimonial-card,
    .testimonials-grid>div {
        position: absolute !important;
        top: 0 !important;
        left: -5px !important;
        width: 100% !important;
        min-width: 100% !important;
        opacity: 0 !important;
        transform: scale(0.9) translateY(20px) !important;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 0 !important;
        pointer-events: none !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    .testimonial-card.carousel-active,
    .testimonials-grid>div.carousel-active {
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
        z-index: 10 !important;
        pointer-events: auto !important;
    }

    .kaptur-card {
        min-width: 75vw !important;
        max-width: 75vw !important;
    }

    .hero-stats-new {
        display: flex !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .stat-item-new {
        padding: 8px 12px !important;
    }

    .stat-number-new {
        font-size: 1.2rem !important;
    }

    .stat-label-new {
        font-size: 0.65rem !important;
    }

    /* =========================================
       9. MESSAGES FIX - FORCE APPLY
       ========================================= */

    /* Container */
    html body #messagesArea .message-sent,
    html body #messagesArea .message-received,
    html body #messagesArea .message.sent,
    html body #messagesArea .message.received {
        display: flex !important;
        margin-bottom: 8px !important;
        /* Augmenté de 1px à 8px pour éviter le chevauchement */
        background: transparent !important;
        align-items: flex-end !important;
        min-height: auto !important;
        /* Changed from 0 to auto */
        height: auto !important;
        padding: 0 !important;
        gap: 0 !important;
        flex-shrink: 0 !important;
        /* Empêcher le rétrécissement */
        position: relative !important;
        /* Pour le z-index */
    }

    /* BULLE - MINIMAL - MAXIMUM SPECIFICITY */
    html body #messagesArea .message-sent .message-content,
    html body #messagesArea .message-received .message-content,
    html body #messagesArea .message.sent .message-content,
    html body #messagesArea .message.received .message-content,
    html body .messages-area-new .message-sent .message-content,
    html body .messages-area-new .message-received .message-content {
        display: inline-block !important;
        max-width: 85% !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 4px 8px !important;
        /* Ultra compact */
        border-radius: 12px !important;
        font-size: 14px !important;
        line-height: 1.1 !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        white-space: normal !important;
        /* Force normal wrapping */
    }

    /* EXCEPTION: Bulles contenant des cartes de réservation - largeur maximale et BLOCK */
    html body #messagesArea .message-content:has(.proposal-card-new),
    html body .messages-area-new .message-content:has(.proposal-card-new) {
        max-width: 95% !important;
        width: 95% !important;
        /* Force width */
        display: block !important;
        /* Force block instead of inline-block */
        padding: 0 !important;
        background: transparent !important;
        margin-bottom: 5px !important;
    }

    /* FIX OVERLAPPING: Ajouter de la marge au CONTENEUR du message quand il y a une carte */
    html body #messagesArea .message-sent:has(.proposal-card-new),
    html body #messagesArea .message-received:has(.proposal-card-new),
    html body .messages-area-new .message-sent:has(.proposal-card-new),
    html body .messages-area-new .message-received:has(.proposal-card-new) {
        margin-bottom: 25px !important;
        /* Beaucoup plus d'espace après le message */
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        flex-shrink: 0 !important;
        /* Empêcher le rétrécissement */
        display: flex !important;
        /* Garder flex pour l'alignement */
    }

    /* EXCEPTION: Messages système - largeur maximale */
    html body #messagesArea .message-sent.system-message .message-content,
    html body #messagesArea .message-received.system-message .message-content,
    html body #messagesArea .system-message .message-content {
        max-width: 95% !important;
        width: 95% !important;
        display: block !important;
        text-align: center !important;
        background: rgba(168, 85, 247, 0.1) !important;
        border: 1px solid rgba(168, 85, 247, 0.3) !important;
        padding: 10px 12px !important;
        margin-bottom: 15px !important;
        /* Plus d'espace pour les messages système */
    }

    /* Force remove margins from all children - MAXIMUM SPECIFICITY */
    html body #messagesArea .message-content *,
    html body #messagesArea .message-content p,
    html body #messagesArea .message-content div,
    html body #messagesArea .message-content span {
        margin: 0 !important;
        padding: 0 !important;
        line-height: inherit !important;
        min-height: 0 !important;
        display: inline !important;
        /* Force inline to avoid block spacing */
    }

    /* EXCEPTION: Carte de réservation - ne PAS appliquer les styles inline */
    html body #messagesArea .message-content .proposal-card-new,
    html body #messagesArea .message-content .proposal-card-new * {
        display: block !important;
        margin: initial !important;
        padding: initial !important;
        line-height: 1.5 !important;
        min-height: auto !important;
        text-align: left !important;
    }

    html body #messagesArea .message-content .proposal-card-new {
        display: block !important;
        width: 100% !important;
        max-width: 560px !important;
        /* +10% width (was 510px) */
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        position: relative !important;
        clear: both !important;
        /* Increase vertical size by adding more padding */
        padding: 24px !important;
        /* +20% padding (was 20px) */
    }

    /* Restaurer le flex/grid pour les éléments internes de la carte */
    html body #messagesArea .message-content .proposal-card-new .proposal-header-new {
        display: flex !important;
        margin-bottom: 24px !important;
        /* +20% margin (was 20px) */
        padding-bottom: 20px !important;
        /* Increased padding */
    }

    html body #messagesArea .message-content .proposal-card-new .proposal-mode-new .mode-value,
    html body #messagesArea .message-content .proposal-card-new .proposal-recurrence-new,
    html body #messagesArea .message-content .proposal-card-new .proposal-actions-new button,
    html body #messagesArea .message-content .proposal-card-new .proposal-status {
        display: flex !important;
    }

    html body #messagesArea .message-content .proposal-card-new .proposal-grid-new {
        display: grid !important;
        gap: 20px !important;
        /* +25% gap (was 16px) */
        margin-bottom: 24px !important;
        /* +20% margin (was 20px) */
    }

    /* HEURE - inline collée */
    html body #messagesArea .message-time,
    html body #messagesArea .message-content .message-time {
        display: inline-block !important;
        font-size: 10px !important;
        color: rgba(255, 255, 255, 0.6) !important;
        margin-left: 4px !important;
        vertical-align: bottom !important;
        line-height: 1 !important;
    }

    /* FIX DATE SEPARATOR OVERLAP - AGGRESSIVE */
    html body #messagesArea .date-separator {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin-top: 40px !important;
        /* Marge supérieure très large */
        margin-bottom: 20px !important;
        padding-top: 10px !important;
        clear: both !important;
        position: relative !important;
        z-index: 5 !important;
        background: transparent !important;
        min-height: 40px !important;
        /* Force height */
    }

    html body #messagesArea .date-separator span {
        background: rgba(30, 41, 59, 0.9) !important;
        border: 1px solid rgba(148, 163, 184, 0.3) !important;
        padding: 6px 16px !important;
        border-radius: 20px !important;
        font-size: 12px !important;
        color: #94a3b8 !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
        position: relative !important;
        z-index: 6 !important;
    }

    /* FIX SYSTEM MESSAGES CONTAINER - FORCE BLOCK & SPACING */
    html body #messagesArea .message-sent.system-message,
    html body #messagesArea .message-received.system-message,
    html body #messagesArea .message.system-message {
        display: block !important;
        /* Force block layout */
        width: 100% !important;
        margin-bottom: 30px !important;
        /* Large margin after system message */
        height: auto !important;
        min-height: auto !important;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
    }

    /* Ensure card border doesn't overlap */
    html body #messagesArea .message-content .proposal-card-new {
        z-index: 10 !important;
        /* Higher than date separator if needed, but spacing should fix it */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
        /* Ensure shadow is visible */
        position: relative !important;
    }

    /* FIX PASSWORD TOGGLE MOBILE */
    .toggle-password {
        width: auto !important;
        right: 10px !important;
        background: transparent !important;
        z-index: 10 !important;
        padding: 5px !important;
        height: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        /* Force dark color for visibility on white background */
        color: #333 !important;
    }

    .toggle-password i {
        font-size: 1.2rem !important;
        color: #333 !important;
    }

    /* =========================================
       10. CALENDAR & MODAL FIXES
       ========================================= */

    /* Fix Calendar Width & Grid */
    .calendar-grid {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        width: 100% !important;
        gap: 4px !important;
        padding: 5px !important;
        box-sizing: border-box !important;
    }

    .calendar-day {
        width: 100% !important;
        aspect-ratio: 1/1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.9rem !important;
        border-radius: 50% !important;
    }

    .calendar-header {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }

    .calendar-header div {
        font-size: 0.8rem !important;
        color: #94a3b8 !important;
    }

    /* Fix Close Buttons Visibility */
    .close-modal,
    .close-btn,
    .btn-close,
    .modal-close-btn {
        font-size: 1rem !important;
        padding: 6px !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 9999 !important;
        color: white !important;
        background: rgba(0, 0, 0, 0.5) !important;
        border-radius: 50% !important;
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        cursor: pointer !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }

    /* Ensure modal content has space for the close button */
    .modal-content {
        padding-top: 50px !important;
    }

    /* =========================================
       12. NEW CALENDAR FIXES (OVERRIDES)
       ========================================= */

    .calendar-container-new {
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .booking-calendar-new,
    .calendar-weekdays-new {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 2px !important;
        width: 100% !important;
    }

    .booking-calendar-new .calendar-day {
        width: 100% !important;
        aspect-ratio: 1/1 !important;
        font-size: 0.8rem !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .calendar-weekdays-new span {
        font-size: 0.7rem !important;
        padding: 2px 0 !important;
    }
}