/* =============================================
   CRCR Clubs - Map styles
   ============================================= */

.crcr-map-wrapper {
    font-family: inherit;
    margin: 20px 0;
}

/* --- Filtres --- */
.crcr-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

/* --- Boutons région --- */
.crcr-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Filtre discipline --- */
.crcr-disciplines {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #f0f7fb;
    border: 1px solid #c8e4f3;
    border-radius: 8px;
    animation: crcr-fadein 0.2s ease;
}

@keyframes crcr-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.crcr-filter-label {
    font-size: 13px;
    font-weight: 700;
    color: #0073aa;
    white-space: nowrap;
}

.crcr-discipline-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crcr-discipline-btn {
    padding: 5px 12px;
    border: 1.5px solid #0073aa;
    background: #fff;
    color: #0073aa;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.crcr-discipline-btn:hover {
    background: #e8f4fb;
    transform: translateY(-1px);
}

.crcr-discipline-btn.active {
    background: #0073aa;
    color: #fff;
}

.crcr-region-btn {
    padding: 8px 16px;
    border: 2px solid #0073aa;
    background: #fff;
    color: #0073aa;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.crcr-region-btn:hover {
    background: #e8f4fb;
    transform: translateY(-1px);
}

.crcr-region-btn.active {
    background: #0073aa;
    color: #fff;
}

/* --- Conteneur carte + sidebar --- */
.crcr-map-container {
    display: flex !important;
    align-items: stretch !important;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#crcr-map {
    flex: 1;
    min-width: 0;
    z-index: 0;
}

/* --- Sidebar --- */
.crcr-sidebar {
    width: 300px !important;
    min-width: 280px !important;
    height: 500px !important;
    max-height: 500px !important;
    background: #f9f9f9;
    border-left: 1px solid #ddd;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* --- Header sidebar fixe --- */
.crcr-sidebar-header {
    flex-shrink: 0 !important;
    padding: 14px 16px;
    background: #0073aa;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crcr-sidebar-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.crcr-club-count {
    background: rgba(255,255,255,0.25);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: bold;
}

/* --- Liste scrollable --- */
.crcr-club-list {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    max-height: calc(500px - 50px) !important;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: #c0d8e8 transparent;
}

.crcr-club-list::-webkit-scrollbar {
    width: 5px;
}

.crcr-club-list::-webkit-scrollbar-track {
    background: transparent;
}

.crcr-club-list::-webkit-scrollbar-thumb {
    background: #c0d8e8;
    border-radius: 10px;
}

.crcr-placeholder {
    color: #888;
    font-size: 14px;
    padding: 20px;
    text-align: center;
    margin: 0;
}

/* --- Carte club --- */
.crcr-club-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.crcr-club-card:hover {
    box-shadow: 0 2px 8px rgba(0,115,170,0.15);
    border-color: #0073aa;
}

.crcr-club-card.active {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.crcr-club-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.crcr-club-info {
    font-size: 12px;
    color: #555;
    margin: 2px 0;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.crcr-club-info span {
    flex: 1;
}

.crcr-club-disciplines {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.crcr-discipline-tag {
    background: #e8f4fb;
    color: #0073aa;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.crcr-club-links {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.crcr-club-links a {
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
}

.crcr-club-links a:hover {
    text-decoration: underline;
}

/* --- Popup Leaflet --- */
.crcr-popup h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: #0073aa;
}

.crcr-popup p {
    margin: 3px 0;
    font-size: 12px;
    color: #555;
}

/* --- Loading --- */
.crcr-loading {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 14px;
}



/* =============================================
   RESPONSIVE — Tablette & Mobile
   ============================================= */

/* --- Tablette (768px - 1024px) --- */
@media (max-width: 1024px) and (min-width: 769px) {
    .crcr-sidebar {
        width: 260px !important;
        min-width: 240px !important;
    }

    .crcr-region-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* --- Mobile & petite tablette (max 768px) --- */
@media (max-width: 768px) {

    /* Filtres */
    .crcr-filters {
        gap: 6px;
    }

    .crcr-regions {
        justify-content: center;
        gap: 6px;
    }

    .crcr-region-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .crcr-disciplines {
        justify-content: center;
        padding: 8px 10px;
    }

    /* Conteneur : colonne, carte en haut, liste en bas */
    .crcr-map-container {
        flex-direction: column !important;
        height: auto !important;
        border-radius: 8px;
    }

    /* Carte : hauteur fixe visible sur mobile */
    #crcr-map {
        width: 100% !important;
        height: 300px !important;
        min-height: 300px !important;
        flex: none !important;
    }

    /* Sidebar : pleine largeur sous la carte */
    .crcr-sidebar {
        width: 100% !important;
        min-width: unset !important;
        height: 280px !important;
        max-height: 280px !important;
        border-left: none !important;
        border-top: 1px solid #ddd;
        border-radius: 0 0 8px 8px;
    }

    .crcr-club-list {
        max-height: calc(280px - 50px) !important;
    }

    /* Cards plus compactes sur mobile */
    .crcr-club-card {
        padding: 10px;
    }

    .crcr-club-name {
        font-size: 13px;
    }

    .crcr-club-info {
        font-size: 11px;
    }
}

/* --- Très petit mobile (max 480px) --- */
@media (max-width: 480px) {

    .crcr-region-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Carte un peu plus haute pour compenser la largeur réduite */
    #crcr-map {
        height: 260px !important;
        min-height: 260px !important;
    }

    .crcr-sidebar {
        height: 260px !important;
        max-height: 260px !important;
    }

    .crcr-club-list {
        max-height: calc(260px - 50px) !important;
    }

    .crcr-filters {
        margin-bottom: 8px;
    }
}
