/*
 * Theme Name:        Vlog Child — CyberMonitor
 * Theme URI:         https://cybermonitor.mooc-science.eu
 * Description:       Thème enfant de Vlog — Dashboard de monitoring cyberdéfense temps réel (v3)
 * Author:            hub.mooc-science.eu
 * Author URI:        https://hub.mooc-science.eu
 * Template:          vlog
 * Version:           3.3.0
 * License:           GNU General Public License v2 or later
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       vlog-child
 */

/* ─────────────────────────────────────────────────────────
   RESET & BASE — écrase les styles du thème parent Vlog
   ───────────────────────────────────────────────────────── */
body.page-template-page-cybermonitor {
    background: #0a0c10 !important;
    color: #c8d0e0 !important;
    font-family: 'Consolas', 'Monaco', monospace !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Masque header/footer/sidebar du thème parent sur la page dashboard */
body.page-template-page-cybermonitor #header,
body.page-template-page-cybermonitor #masthead,
body.page-template-page-cybermonitor .site-header,
body.page-template-page-cybermonitor header.site-header,
body.page-template-page-cybermonitor #footer,
body.page-template-page-cybermonitor .site-footer,
body.page-template-page-cybermonitor footer,
body.page-template-page-cybermonitor #sidebar,
body.page-template-page-cybermonitor .widget-area,
body.page-template-page-cybermonitor .wp-block-template-part,
body.page-template-page-cybermonitor #wpadminbar + * > *:not(#page),
body.page-template-page-cybermonitor .navigation,
body.page-template-page-cybermonitor nav {
    display: none !important;
}

body.page-template-page-cybermonitor #page,
body.page-template-page-cybermonitor #content,
body.page-template-page-cybermonitor .site-content,
body.page-template-page-cybermonitor main,
body.page-template-page-cybermonitor #main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* ─────────────────────────────────────────────────────────
   ADMIN BAR — compense la barre d'admin WordPress
   ───────────────────────────────────────────────────────── */
body.admin-bar.page-template-page-cybermonitor #cybermonitor-app {
    height: calc(100vh - 32px);
    margin-top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar.page-template-page-cybermonitor #cybermonitor-app {
        height: calc(100vh - 46px);
        margin-top: 46px;
    }
}

/* ─────────────────────────────────────────────────────────
   ANIMATIONS D3 ET COUCHES LEAFLET
   ───────────────────────────────────────────────────────── */
@keyframes cm-arc-pulse {
    0% { opacity: 0.3; stroke-width: 1.5px; }
    50% { opacity: 0.7; stroke-width: 2.5px; }
    100% { opacity: 0.3; stroke-width: 1.5px; }
}

svg path.arc {
    animation: cm-arc-pulse 2s ease-in-out infinite !important;
    filter: drop-shadow(0 0 4px rgba(255, 59, 59, 0.4));
}

svg path.arc-critical {
    filter: drop-shadow(0 0 6px rgba(255, 59, 59, 0.6)) !important;
}

svg path.arc-high {
    filter: drop-shadow(0 0 4px rgba(255, 140, 0, 0.4)) !important;
}

/* ─────────────────────────────────────────────────────────
   MARQUEURS LEAFLET — amélioration personnalisée
   ───────────────────────────────────────────────────────── */
.leaflet-marker-pane {
    z-index: 600;
}

.custom-icon {
    filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.6));
}

/* Cercles de rayonnement intelligences */
.leaflet-circle {
    transition: opacity 0.3s ease;
}

.leaflet-circle:hover {
    opacity: 0.4 !important;
    stroke-width: 2 !important;
}

/* Câbles sous-marins */
.leaflet-interactive[data-cable] {
    transition: stroke-width 0.2s, stroke 0.2s;
}

.leaflet-interactive[data-cable]:hover {
    stroke-width: 3px !important;
    filter: brightness(1.2);
}

/* Popups personnalisées */
.leaflet-popup-content {
    background: #111621 !important;
    border: 1px solid #1e2535 !important;
    border-radius: 4px !important;
    color: #c8d0e0 !important;
    font-family: 'Consolas', 'Monaco', monospace !important;
    padding: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-tip {
    background: #111621 !important;
    border: 1px solid #1e2535 !important;
}

/* ─────────────────────────────────────────────────────────
   PANNEAUX DÉTAIL AMÉLIORÉS
   ───────────────────────────────────────────────────────── */
#cm-detail {
    animation: cm-slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cm-slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#cm-detail::-webkit-scrollbar {
    width: 6px;
}

#cm-detail::-webkit-scrollbar-track {
    background: #0f1218;
    border-radius: 3px;
}

#cm-detail::-webkit-scrollbar-thumb {
    background: #1e2535;
    border-radius: 3px;
}

#cm-detail::-webkit-scrollbar-thumb:hover {
    background: #2a3a55;
}

/* ─────────────────────────────────────────────────────────
   COUCHES TOGGLES — retouches d'état
   ───────────────────────────────────────────────────────── */
.cm-layer.active {
    background: rgba(124, 58, 237, 0.1);
    border-left: 2px solid #7c3aed;
    padding-left: 10px;
}

.cm-chk.on {
    background: linear-gradient(135deg, #7c3aed, #00e5ff);
    box-shadow: 0 0 6px rgba(124, 58, 237, 0.4);
}

/* ─────────────────────────────────────────────────────────
   ZONES INTELLIGENCES — indicateurs visuels
   ───────────────────────────────────────────────────────── */
.intelligence-hotspot {
    animation: intelligence-pulse 2s ease-in-out infinite;
}

@keyframes intelligence-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ─────────────────────────────────────────────────────────
   LÉGENDE CARTE — meilleure lisibilité
   ───────────────────────────────────────────────────────── */
#cm-map-legend {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.75) !important;
}

.cm-mleg {
    min-width: 120px;
}

/* ─────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS — meilleure visibilité
   ───────────────────────────────────────────────────────── */
#cm-toast {
    animation: cm-toast-in 0.3s ease, cm-toast-out 0.3s ease 2s;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
    border-left: 3px solid #7c3aed;
}

@keyframes cm-toast-in {
    from { transform: translateX(-100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes cm-toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100px); opacity: 0; }
}

/* ─────────────────────────────────────────────────────────
   ALERTE BADGES — codes couleur renforcés
   ───────────────────────────────────────────────────────── */
.cm-badge {
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.b-critical {
    background: rgba(255, 59, 59, 0.2) !important;
    border: 1px solid #ff3b3b !important;
    box-shadow: 0 0 6px rgba(255, 59, 59, 0.3);
}

.b-high {
    background: rgba(255, 140, 0, 0.2) !important;
    border: 1px solid #ff8c00 !important;
    box-shadow: 0 0 4px rgba(255, 140, 0, 0.2);
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE — ajustements petits écrans
   ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    #cm-left {
        width: 200px !important;
    }
    
    #cm-right {
        width: 240px !important;
    }
    
    #cm-detail {
        width: 240px !important;
        right: 252px !important;
    }
}

@media (max-width: 768px) {
    #cm-left,
    #cm-right {
        display: none;
    }
    
    #cm-map-wrap {
        flex: 1;
    }
    
    .cm-map-controls {
        right: 8px !important;
        top: 8px !important;
    }
}

/* ─────────────────────────────────────────────────────────
   SOMBRE MODE — respect du thème global
   ───────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0c10;
        --bg2: #0f1218;
        --bg3: #141820;
        --border: #1e2535;
        --accent: #00e5ff;
        --accent2: #7c3aed;
        --red: #ff3b3b;
        --orange: #ff8c00;
        --yellow: #ffd700;
        --green: #00e676;
        --text: #c8d0e0;
        --textdim: #5a6a80;
        --panel: #111621;
    }
}
/* Genuine globe 3D (v3.1.0) */
#cm-map-wrap{transform:none!important;perspective:none!important}
#cm-actual-globe{position:absolute;inset:0;background:radial-gradient(circle at 48% 43%,#173451,#07111e 65%);z-index:2;overflow:hidden}
#cm-actual-globe canvas{display:block;touch-action:none;cursor:grab}
#cm-actual-globe canvas:active{cursor:grabbing}
.cm-globe-disclaimer{position:absolute;left:16px;bottom:15px;right:16px;color:#9dbcd4;pointer-events:none;font:11px/1.5 system-ui, sans-serif;text-align:center}
#cm-map-time,.cm-map-controls,#cm-map-legend,.cm-fab-group{z-index:1010}

/* CyberMonitor 3.3 — all research menus expanded by default and permanently. */
.cm-cat-body,.cm-cat-body.collapsed,.cm-cat-body[hidden]{display:block!important;visibility:visible!important;height:auto!important;max-height:none!important;overflow:visible!important}
.cm-cat-arrow{transform:rotate(90deg)!important}
.cm-cat-header{cursor:default!important}
#cm-globe-info{max-width:min(400px,calc(100% - 32px))!important;max-height:55vh;overflow:auto;box-shadow:0 10px 40px rgba(0,0,0,.6)}
#cm-globe-info a{color:#72d8ff!important;text-decoration:underline!important;display:inline-block;margin-top:7px}
#cm-globe-info .cm-info-action{border:1px solid #31678a;padding:5px 8px;border-radius:5px;margin-right:5px}
