/* ============================================================
   Airport Cyber Resilience Simulator — Kiosk Theme
   Dark industrial command-center. Fixed 1920x1080 stage,
   auto-scaled to any display via JS transform.
   ============================================================ */

:root{
  --bg:#040810;
  --panel:#0a1524;
  --panel-2:#0f1e33;
  --line:#173355;
  --text:#cfe4ff;
  --text-dim:#6f8bad;
  --green:#39ff9e;
  --green-soft:#12ffa0;
  --red:#ff3b52;
  --amber:#ffb03a;
  --cyan:#38e6ff;
  --violet:#a06bff;
  --shadow:0 0 40px rgba(0,0,0,.6);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;background:var(--bg);overflow:hidden;font-family:'Rajdhani',system-ui,sans-serif;color:var(--text);cursor:default;-webkit-user-select:none;user-select:none}

/* ---- Stage scaling ---- */
#stage-wrap{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 30%, #08131f, #020509 70%)}
#stage{width:1920px;height:1080px;transform-origin:center center;display:flex;position:relative;
  background:linear-gradient(135deg,#050b16,#020509);border:1px solid var(--line);overflow:hidden}

/* ============ SIDEBAR ============ */
#sidebar{width:460px;height:100%;flex:0 0 460px;background:linear-gradient(180deg,#08111f,#050b14);
  border-right:1px solid var(--line);display:flex;flex-direction:column;padding:22px;gap:16px}

#brand{display:flex;align-items:center;gap:14px}
.brand-mark{color:var(--green);filter:drop-shadow(0 0 8px rgba(57,255,158,.6))}
#brand h1{font-family:'Orbitron';font-weight:900;font-size:22px;letter-spacing:2px;color:#eaf6ff;line-height:1}
#brand h2{font-family:'Orbitron';font-weight:500;font-size:12.5px;letter-spacing:4px;color:var(--cyan)}

.panel{background:linear-gradient(180deg,rgba(15,30,51,.75),rgba(8,18,32,.55));border:1px solid var(--line);
  border-radius:12px;padding:14px;position:relative;box-shadow:inset 0 0 30px rgba(0,40,80,.15)}
.panel.grow{flex:1;min-height:0;display:flex;flex-direction:column}
.panel-title{display:flex;align-items:center;justify-content:space-between;font-family:'Orbitron';font-size:12px;
  letter-spacing:3px;color:var(--cyan);margin-bottom:12px;text-transform:uppercase}
.panel-title .dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 10px var(--green);animation:pulseDot 1.6s infinite}
@keyframes pulseDot{0%,100%{opacity:1}50%{opacity:.3}}

/* ---- playbook cards ---- */
#playbook-list{display:flex;flex-direction:column;gap:9px;max-height:250px;overflow:auto}
.pb-card{position:relative;display:flex;gap:11px;align-items:center;padding:11px 12px;border:1px solid var(--line);
  border-radius:10px;background:rgba(10,22,38,.6);cursor:pointer;transition:.18s;overflow:hidden}
.pb-card:hover{border-color:var(--cyan);background:rgba(18,40,66,.8);transform:translateX(3px)}
.pb-card.active{border-color:var(--red);box-shadow:0 0 22px rgba(255,59,82,.35)}
.pb-card .pb-idx{font-family:'Orbitron';font-size:15px;font-weight:700;color:var(--violet);width:26px;text-align:center}
.pb-card .pb-meta b{display:block;font-size:15px;font-weight:600;color:#eaf6ff;letter-spacing:.3px}
.pb-card .pb-meta span{font-size:12px;color:var(--text-dim)}
.pb-card.active .pb-idx{color:var(--red)}

/* ---- metrics ---- */
.metric{margin-bottom:12px}
.metric:last-child{margin-bottom:0}
.metric-head{display:flex;justify-content:space-between;font-size:13.5px;color:var(--text-dim);margin-bottom:5px;font-weight:600}
.metric-val{font-family:'Orbitron';font-size:15px;color:var(--green)}
.metric-val.loss{color:var(--amber)}
.bar{height:9px;border-radius:6px;background:#0a1826;border:1px solid #12283f;overflow:hidden}
.bar-fill{height:100%;width:100%;border-radius:6px;transition:width .5s cubic-bezier(.2,.8,.2,1)}
.bar-fill.sec{background:linear-gradient(90deg,var(--green-soft),var(--green));box-shadow:0 0 12px rgba(57,255,158,.6)}
.bar-fill.cap{background:linear-gradient(90deg,#2aa8ff,var(--cyan));box-shadow:0 0 12px rgba(56,230,255,.5)}
.bar-fill.fin{width:0;background:linear-gradient(90deg,var(--amber),var(--red));box-shadow:0 0 12px rgba(255,80,60,.5)}

/* ---- event log ---- */
#event-log{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:6px;padding-right:4px}
.log-item{font-size:13px;line-height:1.35;padding:7px 10px;border-left:3px solid var(--line);background:rgba(10,22,38,.5);border-radius:0 8px 8px 0;color:var(--text)}
.log-item .t{font-family:'Orbitron';font-size:11px;color:var(--text-dim);margin-right:6px}
.log-item.ingress{border-left-color:var(--violet)}
.log-item.compromise{border-left-color:var(--red);color:#ffd0d6}
.log-item.spread{border-left-color:var(--amber)}
.log-item.mit{border-left-color:var(--cyan)}
.log-item.good{border-left-color:var(--green)}

/* ---- reset button ---- */
#reset-btn{display:flex;align-items:center;justify-content:center;gap:12px;padding:20px;border:none;border-radius:14px;
  font-family:'Orbitron';font-size:19px;font-weight:700;letter-spacing:3px;color:#04121a;cursor:pointer;
  background:linear-gradient(180deg,#40ffa8,#12c877);box-shadow:0 0 30px rgba(57,255,158,.45);transition:.15s}
#reset-btn:hover{transform:translateY(-2px);box-shadow:0 0 44px rgba(57,255,158,.7)}
#reset-btn:active{transform:translateY(1px)}

#conn-status{display:flex;align-items:center;gap:8px;font-size:11.5px;letter-spacing:2px;color:var(--text-dim);font-family:'Orbitron'}
#conn-status i{width:9px;height:9px;border-radius:50%;background:var(--amber);box-shadow:0 0 8px var(--amber)}
#conn-status.ok i{background:var(--green);box-shadow:0 0 8px var(--green)}
#conn-status.down i{background:var(--red);box-shadow:0 0 8px var(--red)}

/* ============ MAP AREA ============ */
#map-area{flex:1;position:relative;display:flex;flex-direction:column}
#map-header{position:absolute;top:0;left:0;right:0;z-index:5;padding:20px 34px;display:flex;align-items:baseline;gap:18px;
  background:linear-gradient(180deg,rgba(4,10,20,.85),rgba(4,10,20,0));pointer-events:none}
#scenario-title{font-family:'Orbitron';font-size:24px;font-weight:700;letter-spacing:2px;color:#eaf6ff;text-shadow:0 0 18px rgba(56,230,255,.4)}
#scenario-sub{font-size:14px;color:var(--text-dim);flex:1}
#sim-clock{font-family:'Orbitron';font-size:22px;color:var(--green);letter-spacing:2px;min-width:130px;text-align:right;text-shadow:0 0 14px rgba(57,255,158,.5)}
#map{width:100%;height:100%;display:block}

/* nodes */
.node{cursor:pointer}
.node .halo{fill:none;stroke:var(--green);stroke-width:2.5;opacity:.9;filter:url(#glow-green)}
.node .core{fill:#081a2b;stroke:#2f6f8f;stroke-width:2}
.node .ico{color:var(--green)}
.node .label{font-family:'Rajdhani';font-weight:600;font-size:16px;fill:var(--text);text-anchor:middle;letter-spacing:.5px}
.node .cap{font-family:'Orbitron';font-size:11px;fill:var(--text-dim);text-anchor:middle}

.node.compromised .halo{stroke:var(--red);filter:url(#glow-red)}
.node.compromised .core{stroke:var(--red);fill:#2a0810}
.node.compromised .ico{color:var(--red)}
.node.isolated .halo{stroke:#5a6a80;filter:none;stroke-dasharray:6 6;opacity:.6}
.node.isolated .ico{color:#7f8ea3}
.node.isolated .core{stroke:#5a6a80;fill:#10161f}
.node.reduced .halo{stroke:var(--amber);filter:url(#glow-red)}
.node.reduced .ico{color:var(--amber)}
.node.reduced .core{stroke:var(--amber)}
.node.patched .halo{stroke:var(--green);filter:url(#glow-green)}
.node.patched .core{stroke:var(--green);fill:#062015}
.node.patched .ico{color:var(--green)}

/* links & particles */
.link{stroke:#1c3d5f;stroke-width:2;stroke-dasharray:2 8;stroke-linecap:round;fill:none;opacity:.7}
.link.hot{stroke:var(--red);opacity:.9;stroke-dasharray:4 6}
.particle{r:3.5}
.particle.g{fill:var(--green);filter:url(#glow-green)}
.particle.r{fill:var(--red);filter:url(#glow-red)}

/* ingress floating indicator */
.ingress-marker .halo{fill:rgba(160,107,255,.12);stroke:var(--violet);stroke-width:2.5;filter:url(#glow-red)}
.ingress-marker .ico{color:var(--violet)}
.ingress-label{fill:#eaf6ff;font-family:'Rajdhani';font-weight:600;font-size:15px;text-anchor:middle}

/* ============ OVERLAY ============ */
.overlay{position:absolute;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;
  background:rgba(2,6,12,.72);backdrop-filter:blur(4px)}
.overlay.hidden,.hidden{display:none!important}
.overlay-card{width:560px;max-height:82%;overflow:auto;background:linear-gradient(180deg,#0c1a2c,#081320);
  border:1px solid var(--cyan);border-radius:18px;padding:26px;box-shadow:0 0 60px rgba(56,230,255,.3);position:relative}
.overlay-close{position:absolute;top:16px;right:20px;background:none;border:none;color:var(--text-dim);font-size:30px;cursor:pointer;line-height:1}
.overlay-close:hover{color:var(--red)}
.overlay-head{display:flex;align-items:center;gap:16px;margin-bottom:20px}
.overlay-icon{width:66px;height:66px;border-radius:14px;background:#0a1a2b;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;color:var(--green)}
.overlay-name{font-family:'Orbitron';font-size:22px;font-weight:700;color:#eaf6ff}
.overlay-status{display:inline-block;font-family:'Orbitron';font-size:12px;letter-spacing:2px;padding:3px 10px;border-radius:20px;margin-top:4px;
  background:rgba(57,255,158,.15);color:var(--green);border:1px solid var(--green)}
.overlay-status.bad{background:rgba(255,59,82,.15);color:var(--red);border-color:var(--red)}
.overlay-status.warn{background:rgba(255,176,58,.15);color:var(--amber);border-color:var(--amber)}

.overlay-tabs{display:flex;gap:6px;margin-bottom:18px;border-bottom:1px solid var(--line)}
.tab{background:none;border:none;color:var(--text-dim);font-family:'Rajdhani';font-weight:600;font-size:15px;padding:9px 14px;cursor:pointer;border-bottom:2px solid transparent}
.tab.active{color:var(--cyan);border-bottom-color:var(--cyan)}

.kv{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid rgba(23,51,85,.5);font-size:15px}
.kv span{color:var(--text-dim)}
.kv b{color:#eaf6ff;font-weight:600}
.kv.col{flex-direction:column;gap:5px}
.kv.col p{color:var(--text);font-size:14px;line-height:1.4;font-weight:400}
.overlay-desc{margin-top:14px;font-size:14.5px;line-height:1.5;color:var(--text-dim)}

.mit-help{font-size:14px;color:var(--text-dim);margin-bottom:14px}
.mit-btn{display:block;width:100%;text-align:left;border-radius:12px;border:1px solid var(--line);background:rgba(10,22,38,.7);
  padding:14px 16px;margin-bottom:11px;cursor:pointer;transition:.15s}
.mit-btn b{display:block;font-family:'Orbitron';font-size:15px;margin-bottom:4px}
.mit-btn span{font-size:13.5px;color:var(--text-dim);line-height:1.35}
.mit-btn.iso b{color:var(--red)} .mit-btn.iso:hover{border-color:var(--red);box-shadow:0 0 22px rgba(255,59,82,.3)}
.mit-btn.red b{color:var(--amber)} .mit-btn.red:hover{border-color:var(--amber);box-shadow:0 0 22px rgba(255,176,58,.3)}
.mit-btn.stop b{color:var(--cyan)} .mit-btn.stop:hover{border-color:var(--cyan);box-shadow:0 0 22px rgba(56,230,255,.3)}
.mit-btn:disabled{opacity:.35;cursor:not-allowed}

.reg-badge{margin-bottom:14px}
.reg-badge span{font-family:'Orbitron';font-size:16px;letter-spacing:1px;color:var(--violet);border:1px solid var(--violet);
  padding:8px 16px;border-radius:24px;background:rgba(160,107,255,.12)}

/* ============ ATTRACT LOOP ============ */
#attract{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(circle at 50% 40%,#0a1c30,#020509 75%);overflow:hidden}
#attract::before{content:"";position:absolute;inset:0;background-image:
  linear-gradient(rgba(56,230,255,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(56,230,255,.06) 1px,transparent 1px);
  background-size:50px 50px;animation:drift 18s linear infinite}
@keyframes drift{to{background-position:50px 50px}}
.attract-inner{position:relative;text-align:center;max-width:900px;padding:20px}
.attract-shield{color:var(--green);filter:drop-shadow(0 0 20px rgba(57,255,158,.7));animation:floaty 4s ease-in-out infinite}
@keyframes floaty{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}
.attract-inner h1{font-family:'Orbitron';font-weight:900;font-size:46px;letter-spacing:5px;color:#eaf6ff;margin:22px 0 14px;
  text-shadow:0 0 30px rgba(56,230,255,.5)}
.attract-inner p{font-size:19px;color:var(--text-dim);line-height:1.6;margin-bottom:34px}
#attract-start{font-family:'Orbitron';font-size:22px;font-weight:700;letter-spacing:4px;color:#04121a;padding:20px 56px;border:none;border-radius:16px;
  background:linear-gradient(180deg,#40ffa8,#12c877);box-shadow:0 0 40px rgba(57,255,158,.6);cursor:pointer;animation:breathe 2.4s ease-in-out infinite}
@keyframes breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}
.attract-scroll{display:flex;gap:30px;justify-content:center;margin-top:44px;font-family:'Orbitron';font-size:14px;letter-spacing:3px;color:var(--text-dim)}
.attract-scroll span{opacity:.6}

/* scrollbars */
::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-thumb{background:#1c3d5f;border-radius:8px}
::-webkit-scrollbar-track{background:transparent}
