/* modemStatus — LCD-style modem status panel */

/* ── Bezel — simulates a physical screen frame ── */
.lcd-bezel {
    background: linear-gradient(145deg, #4a4a4a 0%, #2a2a2a 50%, #3a3a3a 100%);
    border-radius: 12px;
    padding: 8px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ── LCD screen — the green-grey display ── */
.lcd-screen {
    background: var(--lcd-bg, #9ea88c);
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
    /* The printed legends in Oxanium (base.css); readouts below in
       seven-segment and dot-matrix faces. The slashed zero keeps 0 and
       O apart. */
    font-family: var(--ps-font-lcd);
    font-feature-settings: "zero";
    font-weight: 500;
    color: var(--lcd-ink, #2a3318);
    letter-spacing: 0.3px;
}

/* ── LCD text shadow — drop shadow mimicking text floating above the LCD surface ── */
.lcd-callsign,
.lcd-row-status .lcd-status,
.lcd-freq,
.lcd-value,
#si-hostname,
#si-temp,
#si-uptime {
    text-shadow: 2px 2px 1px color-mix(in srgb, var(--lcd-ink, #2a3318) 35%, transparent);
}

/* LCD colours: --lcd-bg and --lcd-ink, the green LCD unless a theme
   sets its own (Halloween: orange) */

/* Labels keep a lighter shadow */
.lcd-label {
    text-shadow: 2px 2px 1px color-mix(in srgb, var(--lcd-ink, #2a3318) 25%, transparent);
}

/* ── Display faces ── */
/* Dot-matrix for what the display spells out: Matrix Mono Screen, 5x7
   dots in cells 0.6em wide, its line box exactly 1.3em (ascent 1, descent
   0.3). Behind each cell, its unlit dots (5 by 9, the descender rows
   too), as a character LCD shows them: a mask of one cell
   (/static/img/lcd-cell.svg, a file as the CSP allows no data: images),
   repeated */
.lcd-callsign,
.lcd-row-status .lcd-status {
    position: relative;
    isolation: isolate;
    display: inline-block;
    font-family: var(--ps-font-lcd-dot);
    font-weight: 400;
    font-synthesis: none;
    /* Its zero is already slashed; its "zero" feature (Oxanium's slashed
       zero, set on the screen) would swap in a plain O */
    font-feature-settings: normal;
    line-height: 1.3;
    letter-spacing: 0;
}
.lcd-callsign::before,
.lcd-row-status .lcd-status::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--lcd-ink, #2a3318);
    opacity: 0.09;
    -webkit-mask: url('../../static/img/lcd-cell.svg') 0 0 / 0.6em 1.3em repeat;
    mask: url('../../static/img/lcd-cell.svg') 0 0 / 0.6em 1.3em repeat;
}
.lcd-unit {
    font-family: var(--ps-font-lcd-dot);
    font-weight: 400;
    font-synthesis: none;
    font-feature-settings: normal;
}

/* Seven-segment digits (PiStar.lcdText), each over its unlit segments:
   the lit digits and the unlit "8"s share one grid cell, so they line up */
.lcd-seg {
    display: inline-grid;
    font-family: var(--ps-font-lcd-seg);
    font-weight: 700;
    font-variant-numeric: normal;
    letter-spacing: 0;
}
.lcd-seg-off,
.lcd-seg-on {
    grid-area: 1 / 1;
}
.lcd-seg-off {
    opacity: 0.1;
    text-shadow: none;
    pointer-events: none;
}
/* The decimal point, larger than the font's speck and in a gap of its
   own (the unlit "8"s have the same gaps, so they still line up) */
.lcd-dp {
    font-size: 1.5em;
    line-height: 0;
    margin: 0 0.09em;
}
.lcd-freq,
.lcd-value {
    white-space: nowrap;
}
.lcd-unit {
    font-size: 0.85em;
    letter-spacing: 0.5px;
}
.lcd-seg + .lcd-unit { margin-left: 0.15em; }

/* ── Row layout ── */
.lcd-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}

.lcd-row + .lcd-row {
    border-top: 1px solid color-mix(in srgb, var(--lcd-ink, #2a3318) 15%, transparent);
    margin-top: 2px;
    padding-top: 4px;
}

.lcd-label {
    font-size: 0.7em;
    text-transform: uppercase;
    /* Readable on the LCD (4.5:1); smaller and upper-case keep them labels */
    opacity: 0.92;
    flex-shrink: 0;
    min-width: 3.5em;
}

/* ── Top row: callsign + TX/RX indicators ── */
.lcd-row-top {
    justify-content: space-between;
}

.lcd-callsign {
    font-size: 1.3em;
}

.lcd-indicators {
    display: flex;
    gap: 6px;
}

.lcd-indicator {
    font-size: 0.8em;
    font-weight: 700;
    padding: 1px 6px;
    border: 1px solid color-mix(in srgb, var(--lcd-ink, #2a3318) 30%, transparent);
    border-radius: 3px;
    opacity: 0.25;
    transition: opacity 0.15s, background 0.15s;
}

.lcd-indicator.active {
    opacity: 1;
    background: color-mix(in srgb, var(--lcd-ink, #2a3318) 15%, transparent);
}

/* ── Status row ── */
.lcd-row-status .lcd-status {
    font-size: 1.1em;
}

/* ── Frequency row ── */
.lcd-row-freq {
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 2px;
}

.lcd-freq-pair {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lcd-freq {
    font-size: 0.95em;
    font-variant-numeric: tabular-nums;
}

/* ── Modes row ── */
.lcd-row-modes {
    font-size: 0.8em;
}

#ms-modes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lcd-mode {
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: color-mix(in srgb, var(--lcd-ink, #2a3318) 25%, transparent);
    transition: color 0.2s;
}

.lcd-mode.enabled {
    color: var(--lcd-ink, #2a3318);
}

/* ── Responsive ── */
/* Phones: the same screen, tighter: smaller text and padding, TX and RX
   on one line, and no "Modes" label (the modes say what they are) */
@media (max-width: 575px) {
    .lcd-bezel { padding: 5px; border-radius: 10px; }
    .lcd-screen { padding: 7px 10px; font-size: 0.9rem; }
    .lcd-row { padding: 1px 0; gap: 6px; }
    .lcd-row + .lcd-row { margin-top: 1px; padding-top: 3px; }
    .lcd-label { min-width: 0; }
    .lcd-callsign { font-size: 1.15em; }
    #modem-panel .lcd-row-status .lcd-status { font-size: 1em; }
    .lcd-row-freq { flex-direction: row; flex-wrap: wrap; gap: 2px 10px; }
    .lcd-freq { font-size: 0.85em; }
    .lcd-row-modes .lcd-label { display: none; }
    #ms-modes { gap: 2px 7px; }
}
