/* Map container with responsive height */
.club-map-canvas {
    height: 400px;
    width: 100%;
    background-color: #111;
}

.club-map-canvas.homepage-map{
    height: 536px;
}

@media (max-width: 768px) {
    .club-map-canvas {
        height: 300px;
    }
}

/* --- Desktop Filters --- */
.city-filter-container,
.club-filter-container {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.city-filter-container {
    background: linear-gradient(to bottom, #020A0A 0%, #706F6F 100%);
    padding: 24px 0;
}

.city-filter-container>.city-btn {
    font-family: 'Countach', sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: 32px;
    text-transform: uppercase;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease-in-out;
}

.city-btn:hover,
.city-btn.active {
    color: #FFCC00;
}

.club-filter-container .club-btn {
    font-family: 'Countach', sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: 20px;
    line-height: 115%;
    text-transform: uppercase;
    text-align: center;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    transition: color 0.2s ease-in-out;
    text-decoration: none;
}

.club-filter-container .club-btn:hover,
.club-filter-container .club-btn.active {
    color: #FFCC00;
}

@media (max-width: 1024px) {

    .city-filter-container,
    .club-filter-container {
        display: none !important;
    }
}

/* --- Mobile Filters --- */
.mobile-filter-container {
    display: none;
}

@media (max-width: 1024px) {
    .mobile-filter-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        background: linear-gradient(to bottom, #020A0A 0%, #706F6F 100%);
    }
}

.klubi-filter-dropdown {
    position: relative;
    font-family: 'Countach', sans-serif;
}

.klubi-filter-dropdown__nupp {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 15px 0;
    color: #ffffff;
    border: none;
    cursor: pointer;
    gap: 10px;
}

.klubi-filter-dropdown__nupp h3 {
    color: inherit;
    font-size: 32px;
    font-weight: 700;
    font-style: italic;
    text-transform: uppercase;
    margin: 0;
    margin-left: 22px;
}

.klubi-filter-dropdown.is-active .klubi-filter-dropdown__nupp,
.klubi-filter-dropdown.avatud .klubi-filter-dropdown__nupp,
.klubi-filter-dropdown.is-active .klubi-filter-dropdown__valitud-tekst {
    color: #FFCC00 !important;
}

.klubi-filter-dropdown__nool {
    margin-left: 5px;
    margin-top: 5px;
    transition: transform 0.3s ease;
}

.klubi-filter-dropdown__nool svg {
    width: 18px;
    height: auto;
    fill: currentColor;
}

.klubi-filter-dropdown.avatud .klubi-filter-dropdown__nool {
    transform: rotate(180deg);
    margin-top: -10px;
}

.klubi-filter-dropdown__menu {
    display: none;
    padding: 24px 0px;
    background-color: #020A0A;
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    position: relative;
}

.klubi-filter-dropdown.avatud .klubi-filter-dropdown__menu {
    display: block;
}

.klubi-filter-dropdown__menu a {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    font-weight: 700;
    font-size: 22px;
    font-style: italic;
    transition: color 0.2s, background-color 0.2s;
}

.klubi-filter-dropdown__menu a:hover,
.klubi-filter-dropdown__menu a.active {
    color: #FFCC00;
    background-color: rgba(255, 255, 255, 0.1);
}


/* --- InfoBox Styles --- */
.custom-infobox {
    position: absolute;
    background-color: #000;
    color: #fff;
    width: 235px;
    border-radius: 8px;
    padding: 24px;
    font-family: 'Countach', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, calc(-100% - 40px));
    margin-bottom: 20px;
    z-index: 100;
    box-sizing: border-box;
    text-align: center;
}

/* --- NEW: Pointer (triangle) for the info box --- */
.custom-infobox::after {
    content: '';
    position: absolute;
    bottom: -10px;
    /* Position the pointer below the box */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #000;
    /* Same color as the info box background */
}

.custom-infobox h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    font-style: italic;
    text-transform: uppercase;
    line-height: 100%;
    font-family: 'Countach', sans-serif;
}

/* --- NEW: Styles for two-color title --- */
.custom-infobox h3 .white {
    color: #ffffff;
}

.custom-infobox h3 .yellow {
    color: #FFCC00;
}

.custom-infobox p {
    margin: 4px 0 0 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 150%;
    color: #fff;
    font-family: 'Countach', sans-serif;
}

.custom-infobox .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background-color: #FFCC00;
    color: #000;
    border-radius: 100px;
    font-size: 14px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-infobox .close-btn:hover {
    background-color: #fff000;
}

/* --- LEAFLET OVERRIDES FOR BRAND THEME --- */

/* Remove default Leaflet popup styling */
.gym-map-popup .leaflet-popup-content-wrapper,
.gym-map-popup .leaflet-popup-tip {
    background: #000; /* Match brand black */
    color: #fff;
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

.gym-map-popup .leaflet-popup-content-wrapper {
    border-radius: 8px; /* Match your custom-infobox radius */
    padding: 0; /* Remove default padding so your inner div controls it */
}

.gym-map-popup .leaflet-popup-content {
    margin: 0; /* Reset margins */
    width: 235px !important; /* Force match your specific width */
}

/* Hide the default Leaflet close button because we use your custom yellow one */
.gym-map-popup .leaflet-popup-close-button {
    display: none;
}

/* Reuse your existing typography, but reset the absolute positioning 
   since Leaflet handles position automatically */
.gym-map-popup .custom-infobox {
    position: relative; /* Changed from absolute */
    transform: none;    /* Remove translation */
    margin: 0;
    width: 100%;
    /* The rest of .custom-infobox styles (font, color) inherit from your existing CSS */
}

/* Hide your manual triangle hack, Leaflet uses .leaflet-popup-tip */
.gym-map-popup .custom-infobox::after {
    display: none;
}

/* --- MAP VISUALS: Black Water & Sharpness --- */

/* 1. High Contrast Dark Mode 
   This pushes dark greys (water) to true black and brightens the labels.
*/
.club-map-canvas .leaflet-tile-pane {
    filter: brightness(2) contrast(1.05);
}

/* 2. Fix Blurriness on Text/Icons 
   Ensures browser uses crisp edges for rendering.
*/
.club-map-canvas img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 3. Popup Styling (Keep existing, just ensuring contrast) */
.gym-map-popup .leaflet-popup-content-wrapper,
.gym-map-popup .leaflet-popup-tip {
    background: #000;
    border: 1px solid #333; /* Subtle border to pop against black map */
}