/* ========================================
   STYLES CARTE ACTIFS RÉSIDENTS
   ======================================== */

#carte-actifs-residents {
    height: 600px;
    background: #f8f9fa;
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.carte-actifs-residents-map {
    height: 600px;
    background: #f8f9fa;
    position: relative;
}

/* Bloc parent de la carte */
.carte-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: 600px;
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.carte-map,
.ol-viewport {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px;
    box-shadow: none;
}

/* Supprimer tout style Leaflet hérité */
.leaflet-container {
    all: unset;
}

/* Masquer les contrôles de zoom Leaflet */
.leaflet-control-zoom {
    display: none !important;
}

/* Bouton fullscreen */
.map-controls-actifs {
    position: absolute;
    bottom: 18px;
    right: 18px;
    z-index: 1001;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carte-control-button {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--audiar-blue, #316D7B);
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border-left: 2px solid var(--audiar-yellow, #DAB300);
    min-width: 140px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carte-control-button:hover {
    background: var(--audiar-blue, #316D7B);
    color: var(--audiar-white, #FFFFFF);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carte-control-button.fullscreen {
    border-left-color: #e67e22;
}

.carte-control-button i {
    font-size: 14px;
    width: 14px;
    text-align: center;
}

/* ========================================
   NOUVEAUX BOUTONS DE MODE VISUELS
   ======================================== */

.map-mode-toggle-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1001;
    pointer-events: auto;
    border-radius: 10px;
}

.mode-toggle-group {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    padding: 2px;
    border-radius: 10px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-width: 180px;
}

.mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-condensed, 'Arial', sans-serif);
    color: #64748b;
    min-width: 80px;
    position: relative;
    overflow: hidden;
    flex: 1;
    font-size: 0.85rem;
}

.mode-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #316D7B, #4A90A4);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: -1;
    border-radius: 12px;
}

.mode-toggle-btn:hover::before {
    opacity: 0.08;
}

.mode-toggle-btn.active::before {
    opacity: 1;
}

.mode-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(49, 109, 123, 0.2);
}

.mode-toggle-btn.active {
    color: white;
    transform: translateY(-1px);
    box-shadow: 
        0 4px 16px rgba(49, 109, 123, 0.25),
        0 2px 4px rgba(49, 109, 123, 0.1);
}

.mode-toggle-btn.active:focus {
    box-shadow: 
        0 4px 16px rgba(49, 109, 123, 0.25),
        0 2px 4px rgba(49, 109, 123, 0.1),
        0 0 0 3px rgba(255, 255, 255, 0.3);
}

.btn-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(49, 109, 123, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.mode-toggle-btn:hover .btn-icon {
    background: rgba(49, 109, 123, 0.12);
    transform: scale(1.05);
}

.mode-toggle-btn.active .btn-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

.btn-icon i {
    font-size: 0.95rem;
    color: #316D7B;
    transition: all 0.25s ease;
}

.mode-toggle-btn.active .btn-icon i {
    color: white;
    transform: scale(1.1);
}

.btn-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-title {
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.3;
    margin-bottom: 0;
    letter-spacing: 0.025em;
}

.btn-subtitle {
    font-size: 0.62rem;
    opacity: 0.75;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.mode-toggle-btn.active .btn-subtitle {
    opacity: 0.95;
}

/* Animation au clic */
.mode-toggle-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Responsive */
@media (max-width: 1000px) {
    .carte-container {
        max-width: 100vw;
        height: 60vw;
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .map-mode-toggle-controls {
        top: 4px;
        right: 4px;
        left: 4px;
    }
    
    .mode-toggle-group {
        padding: 1px;
        gap: 2px;
        min-width: 120px;
    }
    
    .mode-toggle-btn {
        min-width: 60px;
        flex: 1;
        padding: 4px 6px;
        gap: 6px;
        font-size: 0.75rem;
    }
    
    .btn-icon {
        width: 16px;
        height: 16px;
    }
    
    .btn-icon i {
        font-size: 0.8rem;
    }
    
    .btn-title {
        font-size: 0.7rem;
    }
    
    .btn-subtitle {
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .mode-toggle-btn {
        flex-direction: column;
        gap: 6px;
        padding: 8px 10px;
        text-align: center;
    }
    
    .btn-label {
        align-items: center;
    }
    
    .btn-title {
        font-size: 0.8rem;
    }
    
    .btn-subtitle {
        font-size: 0.65rem;
    }
    
    .map-controls-actifs {
        top: auto;
        bottom: 16px;
        right: 12px;
    }
}

@media (max-width: 768px) {
    .map-controls-actifs {
        top: auto;
        bottom: 12px;
        right: 12px;
    }
}

/* Styles pour le mode fullscreen */
.fullscreen-carte-wrapper-actifs {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: white;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* ========================================
   SÉLECTEUR D'ANNÉE 2007 / 2022
   ======================================== */
.map-year-toggle-controls {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1002;
    pointer-events: auto;
}

.year-toggle-group {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    padding: 2px;
    border-radius: 10px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.year-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-condensed, 'Arial', sans-serif);
    color: #64748b;
    min-width: 56px;
    position: relative;
}

.year-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #316D7B, #4A90A4);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: -1;
    border-radius: 10px;
}

.year-toggle-btn:hover::before { opacity: 0.08; }
.year-toggle-btn.active::before { opacity: 1; }
.year-toggle-btn.active { color: #ffffff; box-shadow: 0 4px 12px rgba(49, 109, 123, 0.25); }

.year-toggle-btn .btn-title {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

@media (max-width: 768px) {
    .map-year-toggle-controls { top: 4px; left: 4px; }
    .year-toggle-btn { padding: 4px 8px; min-width: 48px; }
}

.fullscreen-carte-wrapper-actifs .carte-container {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    max-width: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.fullscreen-carte-wrapper-actifs .carte-map {
    width: 100vw !important;
    height: 100vh !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* S'assurer qu'OpenLayers prend toute la place en fullscreen */
.fullscreen-carte-wrapper-actifs .carte-map .ol-viewport {
    width: 100vw !important;
    height: 100vh !important;
}

.fullscreen-carte-wrapper-actifs .carte-map canvas {
    width: 100vw !important;
    height: 100vh !important;
}

/* Responsive pour le bouton fullscreen */
@media (max-width: 768px) {
    .map-controls-bottom {
        bottom: 10px;
        right: 10px;
    }
    
    .carte-control-button {
        min-width: 50px;
        padding: 10px;
    }
    
    .carte-control-button span {
        display: none; /* Cacher le texte sur mobile */
    }
} 