/* 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;
    }

    body {
        overflow-x: hidden;
        width: 100vw;
    }

    .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: 60px !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;
    }

    /* =========================================
       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 5px !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Main Card Wrapper - Restore visual style from CSS but scaled */
    #topCoaches .coach-card,
    #coachesGrid .coach-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 160px !important;
        padding: 0 !important;
        margin: 0 !important;
        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;
    }

    #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 - ALL VISIBLE, NO SCROLL
       ========================================= */

    .footer-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        padding: 0 5px 5px 5px !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .footer-col {
        width: 100% !important;
        min-width: 0 !important;
        padding: 8px !important;
        font-size: 0.65rem !important;
    }

    .footer-col p {
        font-size: 0.65rem !important;
        line-height: 1.4 !important;
    }

    .footer-col h3 {
        font-size: 0.75rem !important;
        margin-bottom: 8px !important;
    }

    .footer-links li,
    .footer-links a {
        font-size: 0.6rem !important;
        padding: 2px 0 !important;
        line-height: 1.3 !important;
    }

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

    .footer-social {
        margin-top: 0 !important;
        padding-top: 40px !important;
        display: flex !important;
        gap: 10px !important;
    }

    .footer-social a {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
    }

    .footer-bottom {
        font-size: 0.6rem !important;
        padding: 10px 0 !important;
        margin: 0 !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;
    }
}