/*
Red/Black theme for Direwolf APRS Web Dashboard
*/

:root {
  --bg: #15151f;
  --bg-2: #1e1e2b;
  --panel: #232334;
  --panel-2: #2b2b40;
  --border: rgba(255,255,255,0.14);
  --border-2: rgba(255, 31, 31, 0.70);
  --text: #fbfbff;
  --muted: #c3c3d4;
  --red: #ff1f1f;
  --red-2: #d40000;
  --red-3: #ff4d4d;
  --green: #35d07f;
  --yellow: #ffcc00;
  --shadow: 0 12px 34px rgba(0,0,0,0.45);
}

html, body {
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(255,31,31,0.22), transparent 62%),
    radial-gradient(900px 380px at 20% 120px, rgba(255,31,31,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.menu {
  overflow: hidden;
  position: fixed;
  background: linear-gradient(180deg, rgba(22,22,32,0.98), rgba(13,13,19,0.98));
  top: 0;
  width: 100%;
  font-size: 12px;
  z-index: 1;
  border-bottom: 1px solid var(--border-2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.menu-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Title stays far left, nav stays far right */
.menu-title { margin-right: auto; }

.menu-title {
  font-weight: 900;
  letter-spacing: 0.3px;
  color: var(--text);
  text-transform: uppercase;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,31,31,0.20), rgba(255,31,31,0.05));
  border: 1px solid rgba(255,31,31,0.35);
}

.menu-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.page {
  margin-top: 84px;
  font-size: 13px;
  padding: 0 16px 24px;
}

/* make the actual content feel like a card instead of floating in empty black */
.page center {
  display: block;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,31,31,0.25);
  border-radius: 16px;
  padding: 18px 14px 24px;
  box-shadow: var(--shadow);
}

.page img {
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.55));
}

/* Map containers sometimes render as objects; give them a cleaner frame */
object, iframe {
  border-radius: 12px;
}

.normaltable {
  margin-top: 12px;
}

.normaltable {
  border-collapse: collapse;
  background: linear-gradient(180deg, var(--panel), rgba(23,23,38,0.92));
  box-shadow: var(--shadow);
  border-radius: 12px;
  overflow: hidden;
}

th {
  background: linear-gradient(180deg, rgba(255,31,31,0.28), rgba(255,31,31,0.10));
  vertical-align: top;
  border: 1px solid var(--border-2);
  color: var(--text);
  text-transform: none;
}

td {
  text-align: center;
  vertical-align: top;
  border: 1px solid var(--border);
  color: var(--text);
  background-color: rgba(255,255,255,0.03);
}

/* zebra rows for readability */
tr:nth-child(even) td {
  background-color: rgba(255,255,255,0.06);
}

.framestable { width: 100%; }
.indextable { width: 100%; }
.igatetable { width: 60%; }
.systemtable { width: 60%; font-size: 15px; }

.systemtable td, .systemtable th {
  padding: 10px 12px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

/* iGate page: keep both panes full height */
body .dash-grid .card-tight { min-height: 600px; }

.dash-left .card, .dash-right .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dash-left .card object,
.dash-right .card object,
.dash-left .card img,
.dash-right .card img,
.dash-left .card .map,
.dash-right .card .map {
  flex: 1;
}

.btn {
  display: inline-block;
  background: linear-gradient(180deg, rgba(255,31,31,0.28), rgba(255,31,31,0.10));
  border: 1px solid rgba(255,31,31,0.55);
  color: var(--text) !important;
  text-decoration: none;
  font-weight: 900;
  padding: 8px 12px;
  border-radius: 12px;
}

.btn:hover {
  background: linear-gradient(180deg, rgba(255,31,31,0.36), rgba(255,31,31,0.14));
  border-color: rgba(255,31,31,0.80);
}

.dash-left .card-tight {
  padding: 10px;
}

:root {
  --pane-h: 460px;
}

.map {
  width: 100%;
  height: var(--pane-h);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,31,31,0.25);
  background: #000;
}

.prop-img {
  width: 100%;
  height: var(--pane-h);
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,31,31,0.25);
  background: #000;
}

/* Ensure OpenLayers fills map container */
#map { width: 100% !important; height: var(--pane-h) !important; }
#map .ol-viewport { width: 100% !important; height: 100% !important; }
.map { width: 100% !important; height: var(--pane-h) !important; }

.card {
  background: linear-gradient(180deg, var(--panel), rgba(23,23,38,0.92));
  border: 1px solid rgba(255,31,31,0.22);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.card-title {
  font-weight: 900;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.card-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.card-body { font-size: 13px; }

.kv {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 8px;
}
.kv .k { color: var(--muted); font-weight: 800; margin-right: 6px; }
.kv .v { font-weight: 900; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.minihead { font-weight: 900; margin-bottom: 6px; color: var(--text); }
.line { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.lbl { color: var(--muted); font-weight: 800; }

.badge { display:inline-block; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); font-weight: 900; font-size: 12px; }
.badge-soft { background: rgba(255,255,255,0.06); }
.badge-good { background: rgba(53,208,127,0.14); border-color: rgba(53,208,127,0.35); color: #b7ffd7; }
.badge-fair { background: rgba(255,204,0,0.12); border-color: rgba(255,204,0,0.35); color: #fff2b3; }
.badge-poor { background: rgba(255,31,31,0.12); border-color: rgba(255,31,31,0.40); color: #ffd0d0; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.03); }
.li-title { font-weight: 900; }
.li-main { display:flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.li-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.muted { color: var(--muted); }

.toolbar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  width: 100%;
  max-width: 1200px;
}

.toolbar-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}

.toolbar-days a {
  color: var(--red-3);
  font-weight: 900;
  text-decoration: none;
}

.toolbar-days a:hover {
  text-decoration: underline;
}

.toolbar-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.toolbar-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.toolbar input[type="submit"],
.toolbar select {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,31,31,0.25);
  border-radius: 10px;
  padding: 4px 10px;
}

.toolbar input[type="checkbox"] {
  accent-color: var(--red);
}

@media (max-width: 980px) {
  .dash-grid { grid-template-columns: 1fr; }
  .map { height: 420px; }
}

.traffic {
  margin-left: auto;
  margin-right: auto;
}

.menu a:link, .menu a:visited {
  background: linear-gradient(180deg, rgba(18,18,26,0.95), rgba(10,10,16,0.95));
  color: var(--text);
  padding: 7px 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  border-radius: 8px;
  margin: 3px 3px;
  border: 1px solid rgba(255, 31, 31, 0.22);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.menu a:hover, .menu a:active {
  background: linear-gradient(180deg, rgba(255,31,31,0.28), rgba(255,31,31,0.10));
  border-color: rgba(255, 31, 31, 0.65);
  box-shadow: 0 10px 28px rgba(255,31,31,0.10), 0 10px 30px rgba(0,0,0,0.45);
  color: var(--text);
}

a:link, a:visited {
  text-decoration: underline;
  color: var(--red-3);
}

a:hover, a:active {
  text-decoration: underline;
  color: var(--text);
  background-color: rgba(255, 31, 31, 0.10);
}

.station a:link,
.frames a:link {
  font-weight: 800;
  color: var(--text);
}

/* Status colors */
.notrunning { font-weight: 900; color: var(--red); text-shadow: 0 0 10px rgba(255,31,31,0.25); }
.running { font-weight: 900; color: var(--green); }

/* Packet classification colors (keep but modernize) */
.static { color: #c084fc; }
.moving { color: var(--yellow); }
.digidirect { color: #60a5fa; }
.direct { color: var(--red); }
.digi { color: #22c55e; }

.fileshrinked { background-color: var(--red-2); color: #fff; font-weight: 900; }
.fileupdated { background-color: #0f8f4a; color: #fff; font-weight: 900; }
.startedlogging { background-color: #2563eb; color: #fff; font-weight: 900; }

.checkboxline {
  background-color: rgba(7,7,11,0.92);
  position: fixed;
  width: 100%;
  left: 50%;
  transform: translate(-50%);
  text-align: center;
  top: 150px;
  color: var(--muted);
}

.aprspath { font-weight: 900; color: #60a5fa; }

.aprsisobject {
  border: 1px solid rgba(255, 31, 31, 0.25);
  width: 75%;
  height: calc(100vh - 275px);
  background: #000;
}

.aprsmapobject {
  border: 1px solid rgba(255, 31, 31, 0.25);
  width: 100%;
  height: 520px;
  background: #000;
  border-radius: 12px;
}

.console {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre;
  color: var(--text);
}

/* Viewer Control Panel Styles */
.control-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(22, 22, 32, 0.9);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 8px 16px;
  margin: -10px auto 15px auto;
  max-width: 800px;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.control-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-item input[type="checkbox"] {
  accent-color: var(--red);
  margin: 0;
  cursor: pointer;
}

.control-item label {
  cursor: pointer;
}

.control-info {
  border-left: 1px solid var(--border);
  padding-left: 20px;
  font-family: ui-monospace, monospace;
  opacity: 0.8;
}

/* Hide the old checkboxline */
.checkboxline {
  display: none !important;
}

.startedlogging {
  display: none;
}

.viewer-container{display:flex;flex-direction:column;height:80vh;border:1px solid var(--border-2,#2a2a2a);border-radius:12px;background:#050508;overflow:hidden;margin:20px auto;box-shadow:0 4px 12px rgba(0,0,0,0.4);} 
.log-controls{display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;align-items:center;padding:10px 16px;background:rgba(10,10,14,0.9);border-bottom:1px solid var(--border-2,#2a2a2a);}
.control-group{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.log-title{font-weight:900;text-transform:uppercase;font-size:11px;letter-spacing:1px;color:#b5b5b5;}
.modern-log{flex:1;overflow-y:auto;padding:15px;font-family:'Fira Code','Cascadia Code',monospace;line-height:1.5;font-size:14px;scroll-behavior:smooth;}
.modern-log .console{padding:0;margin:0;}
.modern-log div{padding:2px 0;border-bottom:1px solid rgba(255,255,255,0.03);} 
.modern-log div:hover{background:rgba(255,31,31,0.05);} 
.btn-sm{background:rgba(255,255,255,0.05);border:1px solid #3a3a3a;color:#eee;padding:4px 10px;border-radius:6px;cursor:pointer;font-size:12px;}
.btn-danger{border-color:#ff3b3b;color:#ff3b3b;}
.status-indicator{font-size:10px;font-weight:900;padding:2px 6px;border-radius:4px;margin-right:6px;}
.status-indicator.live{background:#0f532d;color:#35d07f;border:1px solid #35d07f;}
.status-indicator.paused{background:#533b0f;color:#ffcc00;border:1px solid #ffcc00;}
.toggle{display:flex;align-items:center;gap:6px;color:#eee;font-size:12px;}
.toggle-label{opacity:0.9;}
.control-info{font-size:11px;color:#9aa0a6;}

/* Tag color grouping */
.modern-log .log-line{border-left:3px solid transparent;padding:2px 6px 2px 8px;border-radius:4px;display:flex;gap:8px;align-items:flex-start;width:100%;box-sizing:border-box;}
.modern-log .log-line.has-tag{border-left-color:var(--tag-color,#6c757d);background-color:var(--tag-bg,rgba(255,255,255,0.14));}
.modern-log .log-tag{display:inline-block;min-width:70px;font-weight:700;opacity:0.9;}
.modern-log .log-line.tag-ig{--tag-color:#3ddc97;--tag-bg:rgba(61,220,151,0.12);}
.modern-log .log-line.tag-ig-tx{--tag-color:#4dabf7;--tag-bg:rgba(77,171,247,0.12);}

.log-sep{height:10px;margin:6px 0;background:transparent;}
.modern-log .log-line{display:block;}