/* terrorgram – style.css */

:root {
  --bg:        #0d0d0d;
  --bg2:       #141414;
  --bg3:       #1a1a1a;
  --border:    #2a2a2a;
  --accent:    #e63946;
  --accent2:   #ff6b6b;
  --text:      #e8e8e8;
  --text2:     #999;
  --text3:     #666;
  --green:     #2ecc71;
  --yellow:    #f39c12;
  --red:       #e74c3c;
  --blue:      #3498db;
  --mono:      'Space Mono', 'Courier New', monospace;
  --sans:      'DM Sans', system-ui, sans-serif;
  --radius:    6px;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ── */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 52px;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand span { color: var(--text2); font-size: 0.8rem; font-weight: 400; }

nav a {
  color: var(--text2);
  font-size: 0.875rem;
  transition: color 0.15s;
}
nav a:hover, nav a.active { color: var(--text); text-decoration: none; }

.nav-spacer { flex: 1; }

/* ── LAYOUT ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* ── STATUS CARDS ── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--text);
}

.stat-card .sub {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 0.25rem;
}

/* ── LISTENER STATUS ── */
.listener-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}
.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.dot.red   { background: var(--red); }
.dot.yellow{ background: var(--yellow); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.listener-bar .info { font-size: 0.85rem; color: var(--text2); }
.listener-bar .info strong { color: var(--text); }

/* ── ANALYSE SECTION ── */
.analyse-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.analyse-box h2 {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="date"],
input[type="password"],
select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus { border-color: var(--accent); }

input.wide { width: 340px; }
input[type="date"] { width: 150px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn:hover { background: var(--accent2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-green { background: var(--green); color: #000; }
.btn-green:hover { background: #27ae60; }

/* ── PROGRESS ── */
.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 1rem 0;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
}

.log-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text2);
  padding: 0.75rem 1rem;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  background: var(--bg3);
  color: var(--text3);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
tbody tr:hover { background: var(--bg3); }

td {
  padding: 0.65rem 0.9rem;
  vertical-align: top;
  color: var(--text);
}

td.mono { font-family: var(--mono); font-size: 0.8rem; }
td.dim  { color: var(--text2); }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
}
.badge-high   { background: rgba(231,76,60,0.2);  color: var(--red); }
.badge-medium { background: rgba(243,156,18,0.2); color: var(--yellow); }
.badge-low    { background: rgba(52,152,219,0.2); color: var(--blue); }
.badge-para   { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }

/* ── FILTERS ── */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
}

.filter-bar input,
.filter-bar select { font-size: 0.82rem; }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text2);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.pagination a:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-header .count {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text3);
}

/* ── FOOTER ── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text3);
}

footer a { color: var(--text3); }
footer a:hover { color: var(--text2); }

/* ── ALERT ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.alert-info    { background: rgba(52,152,219,0.1); border: 1px solid rgba(52,152,219,0.3); color: var(--blue); }
.alert-success { background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.3); color: var(--green); }
.alert-warn    { background: rgba(243,156,18,0.1); border: 1px solid rgba(243,156,18,0.3); color: var(--yellow); }
.alert-error   { background: rgba(231,76,60,0.1);  border: 1px solid rgba(231,76,60,0.3);  color: var(--red); }

/* ── MSG TEXT ── */
.msg-text {
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}
.msg-text.truncated { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.reasoning {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .status-grid { grid-template-columns: 1fr 1fr; }
  input.wide { width: 100%; }
  .form-row { flex-direction: column; }
  nav { gap: 1rem; }
}
