/*
 * spectrum.css — Spectrum platform stylesheet
 * Dunny seed override + Spectrum-specific components
 *
 * Copyright © 2026 Worth Considering Ltd
 * GPL v3 — see LICENSE
 *
 * HISTORY:
 *   2026-03-15  TCP/Claude  Initial. Dark green seed, SIG indicator,
 *               health bars, honeypot panel, keyword highlighting,
 *               full-screen event view.
 */

/* =================================================================
   DUNNY SEED OVERRIDE — dark green
   ================================================================= */
:root {
    --seed-h: 145;
    --seed-s: 45%;
    --seed-l: 30%;

    --accent:       hsl(145, 45%, 30%);
    --accent-light: hsl(145, 45%, 40%);
    --accent-dark:  hsl(145, 45%, 20%);

    --link-color:   hsl(145, 45%, 35%);
    --link-visited: hsl(205, 45%, 35%);
    --link-hover:   hsl(145, 45%, 20%);

    --bg-primary:   hsl(145,  5%, 96%);
    --bg-secondary: hsl(145,  5%, 92%);
    --bg-tertiary:  hsl(145,  5%, 88%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent:       hsl(145, 45%, 50%);
        --accent-light: hsl(145, 45%, 60%);
        --accent-dark:  hsl(145, 45%, 40%);
        --link-color:   hsl(145, 45%, 55%);
        --link-hover:   hsl(145, 45%, 65%);
        --bg-primary:   hsl(145,  5%, 10%);
        --bg-secondary: hsl(145,  5%, 15%);
        --bg-tertiary:  hsl(145,  5%, 19%);
    }
}

[data-theme="dark"] {
    --accent:       hsl(145, 45%, 50%);
    --accent-light: hsl(145, 45%, 60%);
    --accent-dark:  hsl(145, 45%, 40%);
    --link-color:   hsl(145, 45%, 55%);
    --link-hover:   hsl(145, 45%, 65%);
    --bg-primary:   hsl(145,  5%, 10%);
    --bg-secondary: hsl(145,  5%, 15%);
    --bg-tertiary:  hsl(145,  5%, 19%);
}

/* =================================================================
   SIG STATUS INDICATOR
   ================================================================= */
.sig-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: var(--font-size-small);
    letter-spacing: 0.05em;
}

.sig-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    display: inline-block;
}

.sig-green  .sig-dot { background: var(--color-success); }
.sig-amber  .sig-dot { background: var(--color-warning); }
.sig-red    .sig-dot { background: var(--color-error); }

.sig-green  .sig-label { color: var(--color-success); }
.sig-amber  .sig-label { color: var(--color-warning); }
.sig-red    .sig-label { color: var(--color-error); }

/* =================================================================
   FLEET TABLE
   ================================================================= */
.fleet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-small);
    font-family: var(--font-mono);
}

.fleet-table th {
    text-align: left;
    padding: var(--space-1) var(--space-2);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: var(--border-width) solid var(--border-color);
}

.fleet-table td {
    padding: var(--space-1) var(--space-2);
    border-bottom: var(--border-width) solid var(--bg-tertiary);
}

.fleet-table tr:last-child td {
    border-bottom: none;
}

.status-running { color: var(--color-success); }
.status-stopped { color: var(--color-error); }
.status-other   { color: var(--text-muted); }

/* =================================================================
   HEALTH BARS
   ================================================================= */
.health-host {
    margin-bottom: var(--space-4);
}

.health-host:last-child {
    margin-bottom: 0;
}

.health-host-name {
    font-weight: 600;
    font-size: var(--font-size-small);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    font-family: var(--font-mono);
}

.health-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-1);
    font-size: var(--font-size-small);
}

.health-label {
    width: 3.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.health-bar-track {
    flex: 1;
    height: 0.5rem;
    background: var(--bg-tertiary);
    position: relative;
}

.health-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.health-bar-fill.bar-ok      { background: var(--color-success); }
.health-bar-fill.bar-warning { background: var(--color-warning); }
.health-bar-fill.bar-critical{ background: var(--color-error); }

.health-value {
    width: 7rem;
    text-align: right;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--font-size-small);
    flex-shrink: 0;
}

.health-load {
    font-family: var(--font-mono);
    font-size: var(--font-size-small);
    color: var(--text-secondary);
}

.health-unavailable {
    color: var(--text-muted);
    font-style: italic;
    font-size: var(--font-size-small);
}

/* =================================================================
   HONEYPOT EVENTS PANEL
   ================================================================= */
.events-panel {
    font-family: var(--font-mono);
    font-size: var(--font-size-small);
    background: var(--bg-secondary);
    border: var(--border-width) solid var(--border-color);
    padding: var(--space-2);
    height: 14rem;
    overflow-y: auto;
    line-height: 1.6;
}

.event-line {
    display: flex;
    gap: var(--space-3);
    padding: 0.1rem 0;
    border-bottom: 1px solid var(--bg-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-line:last-child {
    border-bottom: none;
}

.ev-time     { color: var(--text-muted); flex-shrink: 0; width: 6rem; }
.ev-host     { color: var(--text-muted); flex-shrink: 0; width: 5rem; }
.ev-service  { flex-shrink: 0; width: 6rem; }
.ev-ip       { flex-shrink: 0; width: 14rem; }
.ev-detail   { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }

/* Keyword highlighting */
.hl-critical   { color: var(--accent); font-weight: 700; }
.hl-ssh        { color: var(--text-primary); }
.hl-http       { color: var(--text-secondary); }
.hl-redis      { color: var(--color-warning); }
.hl-credential { color: var(--color-error); }
.hl-ip         { color: var(--text-primary); }

/* =================================================================
   FULL-SCREEN EVENT VIEW
   ================================================================= */
.fullscreen-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: var(--bg-primary);
    flex-direction: column;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border-bottom: var(--border-width) solid var(--border-color);
    flex-shrink: 0;
}

.fullscreen-header h2 {
    margin: 0;
    font-size: 1rem;
}

.fullscreen-controls {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.fullscreen-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.fullscreen-page {
    font-family: var(--font-mono);
    font-size: var(--font-size-small);
    padding: var(--space-4);
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.7;
}

.fullscreen-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-secondary);
    border-top: var(--border-width) solid var(--border-color);
    flex-shrink: 0;
    font-size: var(--font-size-small);
    color: var(--text-muted);
}

/* =================================================================
   UPDATED TIMESTAMP
   ================================================================= */
.updated-ts {
    font-family: var(--font-mono);
    font-size: var(--font-size-small);
    color: var(--text-muted);
}
