/* Layout principal */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    z-index: 1001; /* pour passer au dessus des cotroles (zoom) de la map */
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Bouton toggle mobile */
.sidebar-mobile-toggle {
    position: fixed;
    top: 8px;
    right: 12px;
    z-index: 1001;
    display: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

/* Bouton toggle desktop (quand sidebar est cachée) */
.sidebar-desktop-toggle {
    position: fixed;
    top: 20px;
    left: 55px;
    z-index: 1001;
    display: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-desktop-toggle.show {
    display: block;
}

/* Container de la carte */
.map-container {
    margin-left: 320px;
    width: calc(100vw - 320px);
    height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.map-container.expanded {
    margin-left: 0;
    width: 100vw;
}

/* Carte */
#map {
    width: 100%;
    height: 100%;
}

/* Tuiles en niveaux de gris (appliqué via className sur le TileLayer) */
.grayscale-tiles {
    filter: grayscale(100%);
}

/* Icônes de bière */
.beer-icon {
    background: none !important;
    border: none !important;
    font-size: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Clusters personnalisés */
.marker-cluster-small {
    background-color: rgba(255, 193, 7, 0.8);
    /* border: 2px solid #ffc107; */
}

.marker-cluster-medium {
    background-color: rgba(255, 152, 0, 0.8);
    /* border: 2px solid #ff9800; */
}

.marker-cluster-large {
    background-color: rgba(255, 111, 0, 0.8);
    /* border: 2px solid #ff6f00; */
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* Liste des bières dans la sidebar */
.beer-list {
    max-height: 300px;
    overflow-y: auto;
}

.beer-item {
    padding: 8px;
    margin-bottom: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9em;
}

.beer-item:hover {
    background-color: rgba(255, 193, 7, 0.3);
}

.beer-item.hidden {
    display: none;
}

/* Responsive - Tablettes */
@media (max-width: 992px) {
    .sidebar {
        width: 280px;
    }

    .map-container {
        margin-left: 280px;
        width: calc(100vw - 280px);
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .sidebar {
        width: 100vw;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .map-container {
        margin-left: 0;
        width: 100vw;
    }

    .sidebar-mobile-toggle {
        display: block;
    }
}

/* Scrollbar personnalisée pour la sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.7);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 193, 7, 0.9);
}

/* Popups Leaflet personnalisées */
.leaflet-popup-content {
    text-align: center;
}

.leaflet-popup-content img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Animation pour les boutons */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Effet niveaux de gris pour les tuiles de carte */
.grayscale-tiles {
    filter: grayscale(100%) contrast(1.1) brightness(0.9);
    transition: filter 0.3s ease;
}

/* Assurer la transition fluide */
.leaflet-tile-container {
    transition: filter 0.3s ease;
}
