:root {
    --bg-color: #050309; --panel-bg: rgba(11, 6, 18, 0.95);
    --border-color: #2a0a33; --text-main: #F3ECFF;
    --neon-purple: #8B2BE2; --neon-magenta: #D946EF; --neon-cyan: #22D3EE;
    --terminal-green: #7CFF8A; --alert-red: #FF4058;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Courier New', Courier, monospace; }

/* A correção do scroll: body não rola, a desktop rola */
body { background-color: var(--bg-color); color: var(--text-main); height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
#matrix-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; opacity: 0.2; }
.crt-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%); background-size: 100% 4px; z-index: 9999; pointer-events: none; opacity: 0.3; }

/* Navegador Falso - Fixo no topo */
.fake-browser { background: #1a1a1a; border-bottom: 1px solid #333; display: flex; align-items: center; padding: 8px 10px; font-size: 11px; z-index: 1000; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.browser-controls { display: flex; gap: 6px; margin-right: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f56; } .dot-yellow { background: #ffbd2e; } .dot-green { background: #27c93f; }
.browser-url { background: #000; border: 1px solid #222; border-radius: 4px; flex: 1; display: flex; align-items: center; padding: 4px 10px; color: #ccc; overflow: hidden; white-space: nowrap; }
.lock { color: var(--terminal-green); margin-right: 5px; font-size: 10px; } 
.url-text { font-size: 11px; text-overflow: ellipsis; overflow: hidden; width: 100%; }
.browser-actions { margin-left: 15px; color: #777; display: flex; gap: 15px; font-size: 14px;}

/* Área de Trabalho */
.desktop { flex: 1; position: relative; overflow-y: auto; padding: 8px; }

/* Janelas Base */
.window { 
    background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 3px; 
    display: flex; flex-direction: column; box-shadow: 0 4px 15px rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px); overflow: hidden; 
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.hidden { opacity: 0; transform: scale(0.95); pointer-events: none; position: absolute; }
.visible { opacity: 1; transform: scale(1); position: relative; pointer-events: auto; }

.win-header { background: rgba(139, 43, 226, 0.2); padding: 4px 8px; font-size: 10px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--border-color); color: #ddd; cursor: grab; text-transform: uppercase; }
.win-header:active { cursor: grabbing; }
.win-btns span { color: #888; cursor: pointer; padding: 0 5px; font-weight: bold; }
.win-btns span:hover { color: var(--alert-red); background: rgba(255,0,0,0.2); }
.win-body { padding: 8px; font-size: 10px; line-height: 1.3; overflow-y: auto; }

/* Cores */
.text-green { color: var(--terminal-green); } .text-red { color: var(--alert-red); }
.text-cyan { color: var(--neon-cyan); } .text-magenta { color: var(--neon-magenta); }
.text-center { text-align: center; }

/* Painel Central */
#win-alert { border: 2px solid var(--alert-red); }
.alert-header { background: var(--alert-red); color: #000; border: none; cursor: default; }
.glitch { font-size: 18px; color: var(--alert-red); margin-bottom: 10px; text-shadow: 0 0 8px var(--alert-red); }
.skull { color: var(--alert-red); font-size: 10px; line-height: 1.1; margin: 10px 0; text-align: center;}
.manifesto { background: rgba(139, 43, 226, 0.1); border-left: 2px solid var(--neon-purple); padding: 8px; text-align: left; font-size: 10px; margin: 10px 0; font-style: italic; }
.manifesto-sub { font-size: 9px; color: #aaa; margin-top: 5px; }
.signature { color: var(--neon-magenta); font-weight: bold; font-size: 12px; }
.live-time { color: #888; font-size: 9px; margin-top: 5px; }

/* Gráficos */
.sys-stats { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.stat { display: flex; align-items: center; gap: 5px; }
progress { flex: 1; height: 4px; -webkit-appearance: none; border: none; background: #222; }
progress::-webkit-progress-value { background: var(--neon-purple); box-shadow: 0 0 5px var(--neon-purple); }
.graph-container { display: flex; align-items: flex-end; height: 30px; gap: 2px; }
.bar { flex: 1; background: var(--neon-cyan); opacity: 0.7; }
.progress-bar-container { width: 100%; height: 6px; background: #222; border-radius: 4px; margin: 8px 0; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--neon-magenta); transition: width 0.1s; }
.green-fill { background: var(--terminal-green); }

/* Mapa de Ameaças */
.map-container { background: url('https://upload.wikimedia.org/wikipedia/commons/8/80/World_map_-_low_resolution.svg') no-repeat center center; background-size: cover; height: 100px; position: relative; opacity: 0.8; filter: invert(1) hue-rotate(180deg); }
.map-dot { position: absolute; width: 4px; height: 4px; background: var(--alert-red); border-radius: 50%; box-shadow: 0 0 8px var(--alert-red); animation: ping 1.5s infinite; }

/* CCTV */
.cctv-text { color: #555; font-size: 8px; line-height: 1; white-space: pre; letter-spacing: 1px; }

/* Código */
pre { font-size: 9px; color: var(--text-main); white-space: pre-wrap; }

/* Search */
.search-bar-container { width: 100%; }
.search-box { display: flex; gap: 5px; background: #000; border: 1px solid var(--border-color); padding: 5px; border-radius: 3px; }
.search-box input { flex: 1; background: transparent; border: none; color: var(--terminal-green); outline: none; font-size: 11px; }
.search-box button { background: var(--neon-purple); border: none; color: #fff; padding: 4px 8px; border-radius: 2px; font-size: 10px; cursor: pointer; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { background: var(--panel-bg); border: 2px solid var(--alert-red); box-shadow: 0 0 30px rgba(255, 64, 88, 0.4); padding: 20px; width: 90%; max-width: 400px; text-align: center; border-radius: 4px; transform: scale(0.9); transition: transform 0.2s; }
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-header h2 { color: var(--alert-red); font-size: 18px; margin-bottom: 10px; }
.error-code { color: var(--neon-magenta); font-size: 14px; font-weight: bold; margin-bottom: 10px; }
.error-text { color: var(--text-main); font-size: 11px; line-height: 1.5; margin-bottom: 20px; }
.modal-close { background: transparent; border: 1px solid var(--alert-red); color: var(--alert-red); padding: 8px 16px; cursor: pointer; font-weight: bold; width: 100%; }

@keyframes ping { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(3); opacity: 0; } }

/* ---------------------------------------------------- */
/* MOBILE DASHBOARD (DENSIDADE MÁXIMA)                 */
/* ---------------------------------------------------- */
@media (max-width: 768px) {
    .desktop { 
        display: grid; 
        grid-template-columns: 1fr 1fr; /* 2 colunas */
        gap: 4px; 
        padding: 4px; 
        align-content: start;
    }
    .window { width: 100% !important; margin: 0; max-height: 160px; }
    .win-body { max-height: 120px; padding: 4px; font-size: 8px; }
    
    /* Ocupar largura total */
    #win-alert, #win-cctv, #win-search, #win-map { grid-column: 1 / -1; }
    #win-alert { max-height: none; }
    
    .glitch { font-size: 14px; }
    .manifesto { font-size: 8px; padding: 4px; }
    .win-header { font-size: 8px; padding: 2px 4px;}
    
    /* Esconder texto de URL longo no mobile para não quebrar */
    .url-text { font-size: 9px; max-width: 200px; }
}

/* ---------------------------------------------------- */
/* DESKTOP DASHBOARD (SOBREPOSIÇÃO)                    */
/* ---------------------------------------------------- */
@media (min-width: 769px) {
    .desktop { display: block; overflow: hidden; height: calc(100vh - 40px); }
    .window { position: absolute; width: 320px; z-index: 10; margin: 0; }
    .visible { position: absolute; }
    
    #win-alert { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 420px; z-index: 100; }
    #win-nmap { top: 20px; left: 20px; }
    #win-map { top: 20px; left: 50%; transform: translateX(-50%); width: 400px; }
    #win-htop { top: 20px; right: 20px; }
    #win-msf { bottom: 20px; left: 20px; }
    #win-cctv { bottom: 20px; right: 20px; }
    #win-siem { top: 200px; left: 20px; }
    #win-hydra { top: 200px; right: 20px; }
    #win-hashcat { bottom: 200px; left: 20px; }
    #win-tcpdump { bottom: 200px; right: 20px; }
    #win-code { top: 400px; left: 20px; }
    #win-gobuster { top: 400px; right: 20px; }
    #win-sniffer { top: 200px; left: 50%; transform: translateX(-50%); }
    #win-crypto { bottom: 250px; left: 50%; transform: translateX(-50%); }
    #win-search { bottom: 20px; left: 50%; transform: translateX(-50%); width: 400px; }
}
