* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

.header {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.map-section {
    display: flex;
    flex-direction: row;
    background: linear-gradient(135deg, #e8f4f8 0%, #d4e8f0 100%);
}

.map-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 700px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8f4f8 0%, #d4e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-ratio-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.france-map-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

.france-map-svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.france-map-svg object,
.france-map-svg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Légende */
.legend {
    width: 280px;
    padding: 25px;
    background: white;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.legend h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.legend-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 12px;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.legend-dot.referent {
    background: #f1c40f;
}

.legend-dot.operationnel {
    background: #2ecc71;
}

.legend-dot.non-operationnel {
    background: #e74c3c;
}

.legend-text {
    font-size: 0.95em;
    color: #444;
    line-height: 1.3;
}

.city-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.city-btn {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    pointer-events: all;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.city-btn:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.btn-dot {
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

/* Couleurs selon le statut */
.city-btn[data-status="referent"] .btn-dot {
    background: #f1c40f;
}

.city-btn[data-status="operationnel"] .btn-dot {
    background: #2ecc71;
}

.city-btn[data-status="non-operationnel"] .btn-dot {
    background: #e74c3c;
}

.btn-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: rgba(231, 76, 60, 0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Couleurs de l'animation selon le statut */
.city-btn[data-status="referent"] .btn-dot::before {
    background: rgba(241, 196, 15, 0.3);
}

.city-btn[data-status="operationnel"] .btn-dot::before {
    background: rgba(46, 204, 113, 0.3);
}

.city-btn[data-status="non-operationnel"] .btn-dot::before {
    background: rgba(231, 76, 60, 0.3);
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.city-btn:hover .btn-dot {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-label {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.city-btn:hover .btn-label {
    opacity: 1;
    transform: translateY(0);
}

.city-btn.editable {
    cursor: move !important;
}

.city-btn.editable .btn-label {
    opacity: 1;
    transform: translateY(0);
}

.edit-mode-btn {
    margin-top: 15px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.edit-mode-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
}

/* Responsive */
@media (max-width: 900px) {
    .map-section {
        flex-direction: column;
    }
    
    .legend {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        padding: 15px;
    }
    
    .legend h3 {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .legend-item {
        margin: 5px 15px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .map-container {
        height: 500px;
    }
    
    .btn-dot {
        width: 16px;
        height: 16px;
    }
    
    .btn-label {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .legend-text {
        font-size: 0.85em;
    }
}

