/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

/* En-tête */
#header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #e0e0e0;
}

#header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

#header p {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 400;
}

/* Conteneur de la carte */
#map {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
}

/* Menu de gestion des couches */
.menu {
    position: absolute;
    top: 100px;
    left: 20px;
    width: 280px;
    max-height: calc(100vh - 140px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 900;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.menu:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}

.menu h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
}

.menu hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #bdc3c7, transparent);
    margin: 15px 0;
}

.categoryLabel {
    color: #34495e;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.layer-group, .tool-group {
    margin-bottom: 10px;
}

.layer-group label, .tool-group label {
    color: #555;
    font-weight: 400;
    margin-left: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.layer-group label:hover {
    color: #3498db;
}

.layer-group input[type="checkbox"],
.layer-group input[type="radio"] {
    margin-right: 8px;
    accent-color: #3498db;
    transform: scale(1.1);
}

.tool-group button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 3px 5px 3px 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tool-group button:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Contrôles 3D */
.slider-group {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider-group label {
    display: block;
    color: #2c3e50;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 5px;
    margin-top: 10px;
}

.slider-group label:first-child {
    margin-top: 0;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #bdc3c7, #3498db);
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-bottom: 5px;
}

.slider-group input[type="range"]:hover {
    opacity: 1;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

/* Préréglages de vue 3D */
.preset-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 8px;
}

.preset-btn {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    border: none;
    padding: 6px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(142, 68, 173, 0.3);
    text-align: center;
}

.preset-btn:hover {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(142, 68, 173, 0.4);
}

.preset-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(142, 68, 173, 0.3);
}

.preset-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

#btn-3d.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}

#btn-terrain.active {
    background: linear-gradient(135deg, #27ae60, #229954) !important;
}

/* Panneau d'informations */
.info-panel {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 320px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 950;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.info-content {
    padding: 20px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #e74c3c;
}

#info-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    margin-top: 10px;
}

#info-body {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

/* Contrôles personnalisés */
.custom-controls {
    position: absolute;
    bottom: 30px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 900;
}

.control-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* Popup personnalisée */
.maplibregl-popup .maplibregl-popup-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    font-family: inherit;
    max-width: 300px;
}

.maplibregl-popup-content h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.maplibregl-popup-content p {
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 14px;
}

/* Styles responsives */
@media (max-width: 768px) {
    #header {
        padding: 12px 15px;
    }
    
    #header h1 {
        font-size: 20px;
    }
    
    #header p {
        font-size: 12px;
    }
    
    .menu {
        width: 260px;
        left: 10px;
        top: 90px;
        padding: 15px;
    }
    
    .info-panel {
        width: 280px;
        right: 10px;
    }
    
    .custom-controls {
        right: 15px;
        bottom: 20px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Responsive pour multi-cartes */
    #maps-container.layout-3,
    #maps-container.layout-4 {
        grid-template-columns: 1fr !important;
        grid-template-rows: repeat(auto, 1fr) !important;
    }
}

@media (max-width: 480px) {
    #map {
        top: 70px;
    }
    
    .menu {
        width: calc(100vw - 20px);
        left: 10px;
        top: 80px;
        max-height: 200px;
    }
    
    .info-panel {
        width: calc(100vw - 20px);
        right: 10px;
        top: auto;
        bottom: 80px;
        transform: none;
    }
    
    /* Forcer une seule colonne sur mobile */
    #maps-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: repeat(auto, 1fr) !important;
    }
}

/* ========== STYLES MULTI-CARTES ========== */

/* Conteneur principal des cartes */
#maps-container {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    gap: 2px;
    background: #2c3e50;
    transition: all 0.3s ease;
}

/* Layouts pour les cartes */
#maps-container.layout-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

#maps-container.layout-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

#maps-container.layout-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

#maps-container.layout-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* Style des vues de cartes individuelles */
.map-view {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.map-view.active {
    border-color: #3498db;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
}

.map-view:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Indicateur de carte active */
.map-view::before {
    content: attr(data-map-label);
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-view:hover::before,
.map-view.active::before {
    opacity: 1;
}

/* Styles pour les boutons de layout */
.layout-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 10px;
}

.layout-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 8px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
    text-align: center;
}

.layout-btn:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
}

.layout-btn.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.layout-btn.active:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
}

/* Contrôles de synchronisation */
.sync-controls {
    margin: 10px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sync-controls label {
    display: flex;
    align-items: center;
    color: #2c3e50;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.sync-controls input[type="checkbox"] {
    margin-right: 6px;
    accent-color: #3498db;
}

/* Corrections pour la vue unique */
.map-view.single-map {
    border: none;
    border-radius: 0;
}

.map-view.single-map::before {
    display: none;
}

/* Indicateur de synchronisation */
.sync-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-view.synced .sync-indicator {
    opacity: 1;
}

/* Animation de transition entre layouts */
@keyframes mapLayoutChange {
    0% {
        opacity: 0.7;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.map-view.transitioning {
    animation: mapLayoutChange 0.3s ease;
}

/* Styles pour les contrôles spécifiques aux cartes multiples */
.multi-map-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-view:hover .multi-map-controls,
.map-view.active .multi-map-controls {
    opacity: 1;
}

.mini-control-btn {
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Animations et transitions globales */
* {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Style pour les couches actives */
.layer-active {
    opacity: 1;
}

.layer-inactive {
    opacity: 0.5;
}

/* ========== STYLES ASTERIX SIMULATION ========== */

/* Marqueurs de pistes ASTERIX */
.asterix-track-marker {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.asterix-track-marker:hover .track-icon {
    transform: scale(1.4);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5) !important;
    z-index: 1000;
}

.asterix-track-marker .track-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation d'apparition des marqueurs */
@keyframes trackAppear {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.asterix-track-marker {
    animation: trackAppear 0.4s ease-out;
}

/* Pulse pour les marqueurs actifs */
@keyframes trackPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.asterix-track-marker.active .track-icon {
    animation: trackPulse 2s infinite;
}

/* Popups des pistes ASTERIX */
.asterix-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    min-width: 320px;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.asterix-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2980b9, #27ae60, #16a085);
    z-index: 1;
}

.asterix-popup h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.asterix-popup .track-info {
    display: grid;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.asterix-popup .track-info div {
    color: #34495e;
    display: flex;
    align-items: center;
    padding: 4px 0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.asterix-popup .track-info div:hover {
    background: rgba(52, 152, 219, 0.05);
    padding-left: 8px;
}

.asterix-popup .track-info div:last-child {
    border-bottom: none;
}

.asterix-popup .track-info strong {
    color: #2c3e50;
    font-weight: 600;
    min-width: 100px;
    display: inline-block;
}

/* Animation d'apparition des nouvelles pistes */
@keyframes trackPulse {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

.asterix-track-marker.new-track .track-icon {
    animation: trackPulse 1.5s ease-in-out;
}

/* Panneau de contrôle ASTERIX intégré dans le menu principal */
.asterix-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(142, 68, 173, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(142, 68, 173, 0.2);
}

.asterix-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    max-width: 350px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.asterix-controls h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #34495e;
    cursor: pointer;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-special {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.btn-special:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.speed-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
}

.stats-display {
    background: rgba(52, 73, 94, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
}

.stats-label {
    color: #7f8c8d;
}

.stats-value {
    color: #2c3e50;
    font-weight: 600;
}

/* Styles pour les pistes ASTERIX */
.track-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.track-marker:hover {
    transform: scale(1.2);
}

.track-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 280px;
}

.track-popup h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.track-popup .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.track-popup .info-label {
    color: #7f8c8d;
    font-weight: 500;
}

.track-popup .info-value {
    color: #2c3e50;
    font-weight: 600;
}

/* Responsive pour les contrôles ASTERIX */
@media (max-width: 768px) {
    .asterix-section {
        padding: 12px;
        margin-top: 10px;
    }
    
    .asterix-controls .control-buttons {
        flex-direction: column;
    }
    
    .asterix-controls button {
        width: 100%;
    }
} 