/* Variables CSS */
:root {
    --primary-color: #4a90e2;
    --header-color: #e68b42;
    --sidebar-width: 320px;
    --header-height: 70px;
    --sidebar-bg: #ffffff;
    --border-color: #dee2e6;
    --header-title-color: #2471b4;
    
    /* Couleurs des filtres */
    --rue-color: #28a745;
    --avenues-color: #007bff;
    --boulevards-color: #ffc107;
    --places-color: #dc3545;
    --quartiers-color: #6f42c1;
    --arrondissements-color: #fd7e14;
}

/* Reset et base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    overflow: hidden;
    height: 100vh;
}

/* Layout principal */
.main-content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-hidden {
    margin-left: 0;
}

/* Header */
.header {
    height: var(--header-height);
    background-color: var(--header-color);
    color: var(--header-title-color);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.header-content {
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    flex: 1;
}

.header .btn {
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    transition: background-color 0.3s ease;
}

.header .btn:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Sidebar adaptée à la nouvelle taille du logo */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-content {
    padding: 15px;
    height: 100%;
}

/* Logo section mise à jour - fond blanc sans bordure */
.logo-section {
    padding: 20px 10px;
    background: #ffffff; /* Fond blanc uni */
    border-radius: 0; /* Pas de bordure arrondie */
    border: none; /* Pas de bordure */
}

/* Container du logo - plus grand et sans padding */
.logo-container {
    width: 280px; /* Plus large */
    height: 220px; /* Plus haut */
    background: white;
    border-radius: 0; /* Pas de bordure arrondie */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    box-shadow: none; /* Pas d'ombre */
    padding: 0; /* Pas de padding */
    overflow: hidden;
}

/* Logo lui-même - utilise tout l'espace disponible */
.logo-amv {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Texte sous le logo - plus grand */
.logo-section strong {
    font-size: 1rem; /* Augmenté de 0.85rem à 1rem */
    font-weight: 600;
}

.logo-section small {
    font-size: 0.85rem; /* Augmenté de 0.7rem à 0.85rem */
    opacity: 0.8;
}

/* Ajustement pour l'espace du texte */
.logo-section .mt-2 {
    margin-top: 1rem !important; /* Un peu plus d'espace */
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Barre de recherche avec bouton clear */
.search-section {
    position: relative;
}

.search-section .form-control {
    border-radius: 25px;
    padding: 12px 20px;
    padding-right: 80px; /* Espace pour les boutons */
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.search-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.search-section .btn {
    border-radius: 25px;
    border: 2px solid #e9ecef;
    border-left: none;
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
}

.search-section .clear-search-btn {
    right: 38px;
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0 10px;
}

.search-section .clear-search-btn:hover {
    color: #dc3545;
}

.search-section #searchBtn {
    border-radius: 0 25px 25px 0;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 5px;
}

.search-results .search-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.search-results .search-item:hover {
    background-color: #f8f9fa;
}

.search-results .search-item:last-child {
    border-bottom: none;
}

/* Sections */
.base-layers-section,
.filters-section,
.tools-section,
.stats-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filters-section h6,
.tools-section h6,
.stats-section h6,
.section-header h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Section headers pour collapse */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
}

.collapse-icon {
    transition: transform 0.3s ease;
}

.section-header[aria-expanded="false"] .collapse-icon {
    transform: rotate(180deg);
}

/* Filtres avec indicateurs de couleur */
.filter-category {
    border-left: 3px solid #e9ecef;
    padding-left: 10px;
}

.form-check {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    margin-left: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-color-indicator {
    display: inline-block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.filter-color-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.filter-color-polygon {
    width: 16px;
    height: 12px;
    border: 2px dashed;
    border-radius: 2px;
}

/* Section statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-item i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    display: block;
}

.stat-item span {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.stat-item small {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Description avec logo GéoMinds */
.description-section {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.developer-info {
    margin-top: 10px;
}

.developer-info a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.developer-info a:hover {
    color: #357abd;
}

.logo-geominds {
    height: 30px;
    width: auto;
}

/* Carte */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
    background: #f0f8ff;
}

/* Indicateur de chargement */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
}

.loading-indicator p {
    margin-bottom: 0;
    color: #6c757d;
}

/* Contrôles personnalisés */
.custom-controls-container {
    position: absolute !important;
    top: 20px !important;
    right: 10px !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: auto !important;
}

.custom-control-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important;
}

.custom-control-btn:hover {
    background: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

.custom-control-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
}

.custom-control-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.5) !important;
}

/* Indicateur d'outil actif */
.tool-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: none;
}

.tool-indicator.show {
    display: block;
}

.tool-indicator-content {
    background: rgba(74, 144, 226, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.tool-indicator-content .btn {
    padding: 2px 6px;
    font-size: 0.8rem;
    border-radius: 50%;
}

/* Styles pour les mesures */
.measure-tooltip {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    opacity: 0.7;
    white-space: nowrap;
    font-size: 12px;
}

.measure-tooltip-measure {
    opacity: 1;
    font-weight: bold;
}

.measure-tooltip-static {
    background-color: #ffcc33;
    color: black;
    border: 1px solid white;
}

.measure-tooltip-measure:before,
.measure-tooltip-static:before {
    border-top: 6px solid rgba(0, 0, 0, 0.8);
    border-right: 6px solid transparent;
    border-left: 6px solid transparent;
    content: "";
    position: absolute;
    bottom: -6px;
    margin-left: -7px;
    left: 50%;
}

.measure-tooltip-static:before {
    border-top-color: #ffcc33;
}

/* Notification container */
.notification-container {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
}

/* Styles pour la géolocalisation et notifications */
.location-notification {
    position: relative;
    background: rgba(40, 167, 69, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 200;
    display: none;
    animation: slideUp 0.3s ease;
    margin-bottom: 10px;
    pointer-events: auto;
}

.location-notification.error {
    background: rgba(220, 53, 69, 0.95);
}

.location-notification.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Styles pour les features info */
.feature-info {
    max-height: 400px;
    overflow-y: auto;
}

.feature-info .row {
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
}

.feature-info .row:last-child {
    border-bottom: none;
}

/* Responsive Design avec breakpoints standards */

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
    :root {
        --sidebar-width: 100%;
        --header-height: 60px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* Masquer le bouton burger desktop */
    #toggleSidebar {
        display: none !important;
    }
    
    /* Sidebar en mode tiroir */
    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-radius: 20px 20px 0 0;
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateY(0);
    }

    .sidebar-handle {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }
    
    .header-title {
        font-size: 1rem;
    }
    
    /* Statistiques en grille 2x2 sur mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Éléments centrés en bas et empilés verticalement */
    .map-legend {
        position: fixed;
        bottom: 120px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 280px;
        width: 90%;
    }

    .legend-content {
        height: 0;
        padding: 0 15px;
        overflow: hidden;
    }

    .legend-content.show {
        height: auto;
        padding: 10px 15px;
    }

    .scale-bar {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
    }

    .developer-credit {
        position: fixed;
        bottom: 35px;
        right: 10px;
        font-size: 9px;
        padding: 3px 6px;
    }

    /* Bouton mobile pour ouvrir la sidebar - Position garantie */
    .mobile-sidebar-toggle {
        position: fixed !important;
        bottom: 10px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
        background: var(--primary-color) !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        z-index: 1070 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 18px !important;
        transition: all 0.3s ease !important;
    }

    .mobile-sidebar-toggle:hover {
        transform: scale(1.1) !important;
    }
    
    /* Overlay pour mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) and (max-width: 767px) {
    :root {
        --sidebar-width: 100%;
        --header-height: 70px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* Masquer le bouton burger desktop */
    #toggleSidebar {
        display: none !important;
    }
    
    /* Sidebar en mode tiroir */
    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-radius: 20px 20px 0 0;
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateY(0);
    }

    .sidebar-handle {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }
    
    /* Éléments centrés en bas et empilés verticalement */
    .map-legend {
        position: fixed;
        bottom: 130px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 300px;
        width: 85%;
    }

    .legend-content {
        height: 0;
        padding: 0 15px;
        overflow: hidden;
    }

    .legend-content.show {
        height: auto;
        padding: 10px 15px;
    }

    .scale-bar {
        position: fixed;
        bottom: 90px;
        left: 50%;
        transform: translateX(-50%);
    }

    .developer-credit {
        position: fixed;
        bottom: 40px;
        right: 15px;
        font-size: 10px;
        padding: 4px 8px;
    }

    /* Bouton mobile pour ouvrir la sidebar - Position garantie */
    .mobile-sidebar-toggle {
        position: fixed !important;
        bottom: 15px !important;
        right: 20px !important;
        width: 50px !important;
        height: 50px !important;
        background: var(--primary-color) !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        z-index: 1070 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 18px !important;
        transition: all 0.3s ease !important;
    }

    .mobile-sidebar-toggle:hover {
        transform: scale(1.1) !important;
    }
    
    /* Overlay pour mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}
/* Assurer que l'élément principal est cliquable */
.legend-item[data-layer="places"] {
    cursor: pointer !important;
    border-left: 3px solid #dc3545;
    padding-left: 8px;
    margin-left: -3px;
    border-radius: 0 4px 4px 0;
}

.legend-item[data-layer="places"]:hover {
    background-color: rgba(220, 53, 69, 0.1);
}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* Masquer le bouton burger desktop */
    #toggleSidebar {
        display: none !important;
    }
    
    /* Sidebar en mode tiroir */
    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-radius: 20px 20px 0 0;
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateY(0);
    }

    .sidebar-handle {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }
    
    /* Éléments centrés en bas et empilés verticalement */
    .map-legend {
        position: fixed;
        bottom: 140px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 320px;
        width: 80%;
    }

    .legend-content {
        height: 0;
        padding: 0 15px;
        overflow: hidden;
    }

    .legend-content.show {
        height: auto;
        padding: 10px 15px;
    }

    .scale-bar {
        position: fixed;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%);
    }

    .developer-credit {
        position: fixed;
        bottom: 45px;
        right: 20px;
        font-size: 10px;
    }

    /* Bouton mobile pour ouvrir la sidebar - Position garantie */
    .mobile-sidebar-toggle {
        position: fixed !important;
        bottom: 20px !important;
        right: 25px !important;
        width: 50px !important;
        height: 50px !important;
        background: var(--primary-color) !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        z-index: 1070 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 18px !important;
        transition: all 0.3s ease !important;
    }

    .mobile-sidebar-toggle:hover {
        transform: scale(1.1) !important;
    }
    
    /* Overlay pour mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {
    :root {
        --sidebar-width: 320px;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    /* Afficher le bouton burger desktop */
    #toggleSidebar {
        display: inline-flex !important;
    }
    
    /* Sidebar normale desktop */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: var(--sidebar-width);
        height: 100vh;
        transform: none;
        transition: transform 0.3s ease;
        border-radius: 0;
        z-index: 1001;
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    .sidebar-handle {
        display: none;
    }
    
    /* Éléments en disposition desktop */
    .map-legend {
        bottom: 20px;
        left: 20px;
        max-width: 200px;
    }

    .legend-content {
        height: auto;
        padding: 10px 15px;
        overflow: visible;
    }

    .scale-bar {
        bottom: 20px;
        left: 230px;
    }

    .developer-credit {
        bottom: 8px;
        right: 80px;
        position: absolute;
    }

    /* Masquer le bouton mobile */
    .mobile-sidebar-toggle {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

/* Animations */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* OpenLayers custom styles */
.ol-control {
    background: rgba(255,255,255,0.9) !important;
    border-radius: 4px !important;
}

.ol-zoom {
    display: none !important;
}

.ol-attribution {
    bottom: 5px !important;
    right: 5px !important;
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
}

/* Styles pour les overlays OpenLayers */
.ol-overlay-container {
    pointer-events: none;
}

.ol-overlay-container .measure-tooltip {
    pointer-events: auto;
}

/* Styles pour les interactions */
.ol-interaction-drawing .ol-viewport {
    cursor: crosshair;
}

/* Styles pour les couches de mesure */
.measure-layer {
    pointer-events: none;
}

/* Styles pour les collapse */
.collapse {
    transition: height 0.35s ease;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Légende dynamique */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 200;
    min-width: 200px;
    max-width: 250px;
    backdrop-filter: blur(10px);
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 8px 8px 0 0;
}

.legend-header h6 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.legend-toggle {
    padding: 2px 6px;
    font-size: 12px;
    border: none;
    background: transparent;
    color: var(--primary-color);
}

.legend-toggle:hover {
    background: rgba(74, 144, 226, 0.1);
}

.legend-content {
    padding: 10px 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.legend-content.collapsed {
    height: 0;
    padding: 0 15px;
    overflow: hidden;
}

/* Pour mobile/tablette - utiliser .show pour override .collapsed */
@media only screen and (max-width: 991px) {
    .legend-content.show {
        height: auto;
        padding: 10px 15px;
        overflow: visible;
    }
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.legend-item:hover {
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 4px;
    padding: 4px 6px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-item.disabled {
    opacity: 0.5;
}

.legend-symbol {
    width: 20px;
    height: 16px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-line {
    width: 18px;
    height: 3px;
    border-radius: 2px;
}

.legend-item[data-layer="places"] .legend-point {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #dc3545;
    border-radius: 0;
    position: relative;
}

.legend-item[data-layer="places"] .legend-point::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    top: -12px;
    left: -4px;
}

.legend-polygon {
    width: 16px;
    height: 12px;
    border-radius: 2px;
}

.legend-item span {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

/* Échelle graphique */
.scale-bar {
    position: absolute;
    bottom: 20px;
    left: 230px;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 200;
    backdrop-filter: blur(10px);
}

.scale-line {
    height: 8px;
    border: 2px solid #333;
    border-top: none;
    position: relative;
    margin-bottom: 4px;
    min-width: 100px;
}

.scale-segments {
    height: 100%;
    border-right: 2px solid #333;
    width: 50%;
    background: repeating-linear-gradient(
        to right,
        #333 0px,
        #333 2px,
        transparent 2px,
        transparent 12px,
        #333 12px,
        #333 14px,
        transparent 14px,
        transparent 24px
    );
}

.scale-text {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Crédit développeur - MODIFIÉ SELON VOS DEMANDES */
.developer-credit {
    position: absolute;
    bottom: 8px;  /* Positionné en bas */
    right: 80px;  /* À droite, juste à côté de l'attribution */
    background: transparent;  /* Suppression du fond noir */
    color: #333;  /* Texte en gris foncé */
    padding: 4px 8px;
    border-radius: 0;
    font-size: 10px;  /* Taille réduite */
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: none;  /* Suppression du blur */
    z-index: 200;
    opacity: 0.8;
}

.developer-logo {
    display: none;  /* Masqué car non utilisé */
}

.developer-logo-img {
    height: 18px;  /* Taille réduite du logo */
    width: auto;
    filter: none;  /* Suppression du filtre d'inversion */
    opacity: 0.8;
}

.developer-credit span {
    font-weight: 400;
    font-size: 10px;
}

.developer-credit a {
    color: #4a90e2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.developer-credit a:hover {
    color: #357abd;
    text-decoration: underline;
}

.developer-credit strong {
    color: inherit;
    font-weight: 600;
}

/* Amélioration des boutons d'outils */
.tools-section .btn i {
    width: 16px;
    text-align: center;
}

.tools-section .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tools-section .btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
    :root {
        --sidebar-width: 340px;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    /* Afficher le bouton burger desktop */
    #toggleSidebar {
        display: inline-flex !important;
    }
    
    /* Sidebar normale desktop */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: var(--sidebar-width);
        height: 100vh;
        transform: none;
        transition: transform 0.3s ease;
        border-radius: 0;
        z-index: 1001;
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    .sidebar-handle {
        display: none;
    }
    
    /* Éléments en disposition desktop large */
    .map-legend {
        bottom: 20px;
        left: 20px;
        max-width: 220px;
    }

    .legend-content {
        height: auto;
        padding: 10px 15px;
        overflow: visible;
    }

    .scale-bar {
        bottom: 20px;
        left: 250px;
    }

    .developer-credit {
        bottom: 8px;
        right: 80px;
        position: absolute;
    }
}