
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --red: #cc2233;
  --red-bright: #ff2244;
  --bg: #1c1c1c;
  --bg-panel: #242424;
  --bg-dark: #141414;
  --border-red: #cc2233;
  --border-dim: #333;
  --text: #ffffff;
  --text-dim: #bbbbbb;
  --text-muted: #777777;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  height: 100%;
}

body {
  min-height: 100vh;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

/* SCANLINE */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.025) 3px, rgba(0,0,0,0.025) 6px);
  pointer-events: none;
  z-index: 9999;
}

/* HEADER */
header {
  background: var(--bg-dark);
  border-bottom: 3px solid var(--border-red);
  box-shadow: 0 2px 16px rgba(200,30,50,0.3);
  flex-shrink: 0;
}

.header-main {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  align-items: center;
  padding: 12px 28px;
  gap: 16px;
}

.logo-area { display: flex; align-items: center; gap: 12px; }

.logo-wings {
  width: 60px; height: 60px; flex-shrink: 0;
}
.logo-wings svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.4));
}

.logo-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 15px; font-weight: 900;
  color: var(--text); letter-spacing: 2px;
}
.logo-sub { font-size: 9px; color: var(--red-bright); letter-spacing: 1.5px; margin-top: 3px; }

.header-center { text-align: center; }

.site-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 42px; font-weight: 900;
  color: var(--text); letter-spacing: 8px;
  position: relative; display: inline-block;
}

.site-title::after {
  content: attr(data-text);
  position: absolute; left: 3px; top: 2px;
  color: var(--red); opacity: 0;
  clip-path: inset(100% 0 0 0);
  animation: glitch 5s infinite;
}

@keyframes glitch {
  0%,88%,100% { opacity: 0; clip-path: inset(100% 0 0 0); }
  90% { opacity: 0.4; clip-path: inset(15% 0 65% 0); left: -2px; }
  93% { opacity: 0.3; clip-path: inset(55% 0 15% 0); left: 3px; }
  96% { opacity: 0.25; clip-path: inset(35% 0 40% 0); left: -1px; }
}

.header-right {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 16px; font-size: 13px; color: var(--text-dim);
}

.user-badge { display: flex; align-items: center; gap: 7px; color: var(--text); font-size: 12px; letter-spacing: 1px; }
.search-icon { cursor: pointer; }

/* NAV */
nav {
  display: flex; justify-content: center;
  border-top: 1px solid var(--border-dim);
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px; letter-spacing: 1.5px;
  padding: 10px 24px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

nav a:hover { color: var(--text); border-bottom-color: rgba(204,34,51,0.4); }

nav a.active {
  color: var(--red-bright);
  border-bottom-color: var(--red-bright);
}

/* HERO BANNER */
.hero-banner {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dim);
  padding: 10px 28px;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}

.hero-headline {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--text); letter-spacing: 1px;
}
.hero-headline .sep { color: var(--text-muted); margin: 0 8px; }
.hero-headline .subtitle { font-family: 'Share Tech Mono', monospace; font-size: 13px; font-weight: 400; color: var(--text-dim); }

.ops-label {
  color: var(--text); font-size: 12px; letter-spacing: 2px;
  border: 1px solid var(--border-dim); padding: 4px 14px;
  background: rgba(255,255,255,0.03);
}

/* MAIN LAYOUT */
.main-wrap {
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 14px;
  padding: 14px 28px;
  flex: 1;
  min-height: 0;
}

.sidebar-left, .sidebar-right {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
}

/* stretch last fill-panel to take remaining space */
.fill-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.fill-panel .panel-body {
  display: flex; flex-direction: column; gap: 6px;
}

/* PANELS */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  display: flex; flex-direction: column;
}

.panel-hdr {
  color: var(--text); font-size: 12px; letter-spacing: 2px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

.panel-body { padding: 12px 14px; flex: 1; }

.sys-line { font-size: 12px; color: var(--text-dim); margin: 4px 0; }
.sys-line span { color: var(--text); }

.graph-area {
  background: var(--bg-panel); border: 1px solid var(--border-dim);
  padding: 10px; height: 90px; overflow: hidden; flex-shrink: 0;
}
.graph-area svg { width: 100%; height: 100%; }

.user-panel {
  background: var(--bg-panel); border: 1px solid var(--border-dim);
  padding: 14px; flex-shrink: 0;
}
.user-label { font-size: 11px; color: var(--text-muted); letter-spacing: 2px; margin-bottom: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; background: var(--border-dim);
  border: 1px solid var(--border-dim); border-radius: 2px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.user-name { color: var(--text); font-size: 13px; }
.user-status { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.intel-item {
  font-size: 11px; color: var(--text-dim);
  padding: 5px 0; border-bottom: 1px solid rgba(50,50,50,0.6);
}
.intel-item:last-child { border-bottom: none; }

/* CENTER */
.center-content { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.hero-card {
  background: var(--bg-panel);
  border: 2px solid var(--border-red);
  box-shadow: 0 0 18px rgba(204,34,51,0.2);
  overflow: hidden; flex-shrink: 0;
}

.hero-title-bar {
  padding: 10px 16px; border-bottom: 1px solid var(--border-dim); background: var(--bg-dark);
}
.hero-main-title {
  font-family: 'Orbitron', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text); letter-spacing: 1px;
}
.hero-sub-title { color: var(--text-dim); font-size: 12px; margin-top: 3px; }

.hero-img {
  width: 100%; height: 240px;
  background: linear-gradient(135deg, #1c1c1c 0%, #222 50%, #181818 100%);
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-img::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 60%, rgba(204,34,51,0.06) 0%, transparent 70%);
}
.hero-placeholder {
  font-family: 'Orbitron', sans-serif; font-size: 48px;
  color: rgba(255,255,255,0.06); letter-spacing: 10px;
}
.hero-overlay-tags {
  position: absolute; bottom: 12px; right: 12px; display: flex; gap: 8px;
}
.tag {
  font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 900;
  letter-spacing: 2px; padding: 3px 10px; color: var(--text);
  border: 1px solid rgba(255,255,255,0.25);
}

/* NEWS GRID */
.news-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; flex-shrink: 0;
}
.news-card {
  background: var(--bg-panel); border: 1px solid var(--border-red);
  padding: 10px; cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 6px;
}
.news-card:hover { background: #2a1a1c; box-shadow: 0 0 10px rgba(204,34,51,0.2); }
.news-thumb {
  width: 100%; height: 56px;
  background: linear-gradient(135deg, #2a1a1c, #221418);
  border: 1px solid var(--border-red);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.news-source { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; }
.news-headline { font-size: 11px; color: var(--text); line-height: 1.5; }
.news-time { font-size: 10px; color: var(--text-muted); margin-top: auto; }

/* ARTICLE LIST */
.article-list { flex: 1; display: flex; flex-direction: column; gap: 1px; min-height: 0; }
.article-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px;
  background: var(--bg-panel);
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--border-dim);
  cursor: pointer; transition: border-left-color 0.2s, background 0.2s;
  flex: 1;
}
.article-item:hover { border-left-color: var(--red); background: #262020; }
.article-dot { color: var(--red-bright); font-size: 13px; margin-top: 1px; flex-shrink: 0; }
.article-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.article-meta { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* RIGHT SIDEBAR */
.panel-item {
  font-size: 11px; color: var(--text-dim);
  padding: 7px 0; border-bottom: 1px solid rgba(55,55,55,0.5);
  cursor: pointer; transition: color 0.2s;
  line-height: 1.5;
}
.panel-item:hover { color: var(--text); }
.panel-item:last-child { border-bottom: none; }
.panel-item.hi { color: var(--text); }

.msg-item {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid rgba(55,55,55,0.5);
  font-size: 11px; cursor: pointer;
}
.msg-item:last-child { border-bottom: none; }
.msg-icon {
  width: 22px; height: 18px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; flex-shrink: 0; color: var(--text-dim);
}
.msg-title { color: var(--text); margin-bottom: 3px; }
.msg-preview { color: var(--text-muted); }

/* BOTTOM TICKER */
.bottom-ticker {
  background: var(--bg-dark);
  border-top: 3px solid var(--border-red);
  padding: 9px 0;
  overflow: hidden; white-space: nowrap;
  box-shadow: 0 -4px 16px rgba(204,34,51,0.2);
  flex-shrink: 0;
}
.ticker-track {
  display: inline-block;
  animation: scroll-left 40s linear infinite;
  font-size: 13px; color: var(--text); letter-spacing: 1.5px;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes scroll-left {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}
.ticker-label { color: var(--red-bright); font-weight: bold; margin-right: 8px; }
.ticker-sep { color: var(--text-muted); margin: 0 18px; }

/* Leaflet Map Fix */
#map {
  width: 100% !important;
  height: 600px !important;
  min-height: 600px !important;
  flex: none !important;
  display: block !important;
}

/* CHAT */
.chat-box { display:flex; flex-direction:column; height:200px; }
.chat-messages { flex:1; overflow-y:auto; font-size:11px; color:var(--text-dim); margin-bottom:8px; line-height:1.6; }
.chat-messages .cm { margin-bottom:3px; padding-bottom:3px; border-bottom:1px solid rgba(55,55,55,0.4); }
.chat-messages .cm:last-child { border-bottom:none; }
.chat-messages .cn { color:var(--red-bright); font-weight:bold; }
.chat-name-row { margin-bottom:6px; }
.chat-name-row input,
.chat-input-row input {
  background:var(--bg-dark);
  border:1px solid var(--border-dim);
  color:var(--text);
  padding:5px 8px;
  font-size:11px;
  font-family:'Share Tech Mono', monospace;
  width:100%;
  box-sizing:border-box;
}
.chat-name-row input:focus,
.chat-input-row input:focus { border-color:var(--red); outline:none; }
.chat-input-row { display:flex; gap:4px; }
.chat-input-row input { width:auto; flex:1; }
.chat-input-row button {
  background:none;
  border:1px solid var(--red);
  color:var(--red);
  padding:5px 10px;
  cursor:pointer;
  font-size:10px;
  letter-spacing:1px;
  font-family:'Share Tech Mono', monospace;
  transition:background 0.2s, color 0.2s;
}
.chat-input-row button:hover { background:var(--red); color:var(--text); }
