/* ===== VARIABLES CSS ===== */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--secondary-color);
    line-height: 1.6;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "header"
        "main"
        "footer";
}

/* ===== HEADER ===== */
.app-header {
    grid-area: header;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ===== BOUTONS ===== */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--success-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ===== MAIN - CONTENEUR CARTE ===== */
.map-container {
    grid-area: main;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ===== PANEL D'INFORMATIONS ===== */
.info-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 280px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    z-index: 500;
    max-height: 400px;
    overflow-y: auto;
}

.info-panel h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 0.5rem;
}

.info-panel h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.info-panel p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-panel strong {
    color: var(--secondary-color);
}

.info-panel hr {
    border: none;
    border-top: 1px solid var(--light-color);
    margin: 1rem 0;
}

/* ===== FOOTER ===== */
.app-footer {
    grid-area: footer;
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.75rem 2rem;
    font-size: 0.85rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
}

.separator {
    color: var(--light-color);
}

/* ===== STYLES POUR LES DRONES ===== */
.drone-marker {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border: 3px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.drone-marker:hover {
    transform: scale(1.2);
    background: var(--success-color);
}

.drone-marker.active {
    background: var(--warning-color);
    animation: none;
    transform: scale(1.1);
}

.drone-marker.selected {
    background: var(--danger-color);
    transform: scale(1.3);
    animation: bounce 1s infinite;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1.3);
    }
    40% {
        transform: translateY(-5px) scale(1.3);
    }
    60% {
        transform: translateY(-3px) scale(1.3);
    }
}

/* ===== POPUP DRONE ===== */
.drone-popup {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    min-width: 200px;
    font-size: 0.9rem;
}

.drone-popup h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.drone-popup .status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--white);
}

.status.active { background: var(--success-color); }
.status.warning { background: var(--warning-color); }
.status.danger { background: var(--danger-color); }

/* ===== LOADER ===== */
.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.loader::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .info-panel {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .app-footer .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .info-panel {
        font-size: 0.85rem;
        padding: 1rem;
    }
}

/* ===== STYLES POUR OL ET CESIUM ===== */
.ol-control {
    background: var(--white) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow) !important;
}

.ol-control button {
    background: var(--white) !important;
    color: var(--dark-color) !important;
    border-radius: var(--border-radius) !important;
    transition: var(--transition) !important;
}

.ol-control button:hover {
    background: var(--primary-color) !important;
    color: var(--white) !important;
}

/* Styles pour les contrôles Cesium */
.cesium-viewer-toolbar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: var(--border-radius) !important;
}

.cesium-button {
    background: var(--white) !important;
    border-radius: var(--border-radius) !important;
    transition: var(--transition) !important;
}

.cesium-button:hover {
    background: var(--primary-color) !important;
}

/* ===== TRANSITIONS 2D/3D ===== */
.map-transition {
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.mode-indicator {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 500;
    box-shadow: var(--shadow);
}

.mode-indicator.mode-3d {
    background: var(--success-color);
} 