/* ============================================
   rollup.report — Skeuomorphic Cockpit Theme
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --base: #0c0e14;
    --panel: #1a1c22;
    --panel-top: #1e2028;
    --frame: #2a2d36;
    --frame-light: #3a3d46;
    --green: #39ff14;
    --magenta: #ff2d6b;
    --cyan: #00e5ff;
    --amber: #ffb800;
    --text: #b8c4d0;
    --muted: #5a6270;
    --gap: 3px;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--base);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.6;
}

/* --- Hex Overlay --- */
.hex-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
}

/* --- Bento Grid --- */
.cockpit-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 1.6fr 1.2fr 1.2fr 36px;
    grid-template-areas:
        "sequencer  sequencer  batch-feed  batch-feed  batch-feed"
        "sequencer  sequencer  gas-meter   gas-meter   finality"
        "rollup-a   rollup-b   gas-meter   gas-meter   finality"
        "status-bar status-bar status-bar  status-bar  status-bar";
    gap: var(--gap);
    height: 100vh;
    padding: var(--gap);
}

/* --- Panel Base --- */
.panel {
    background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel) 100%);
    border: 1px solid var(--frame);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        inset 0 -2px 6px rgba(0,0,0,0.4),
        0 2px 8px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        inset 0 -2px 6px rgba(0,0,0,0.4),
        0 4px 16px rgba(0,0,0,0.7);
}

/* --- Panel Header --- */
.panel-header {
    height: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: linear-gradient(180deg, #16181e 0%, var(--panel) 100%);
    border-bottom: 1px solid var(--base);
}

.panel-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--green);
    text-shadow: 0 0 8px rgba(57,255,20,0.4);
}

/* --- Grid Area Assignments --- */
.sequencer  { grid-area: sequencer; }
.batch-feed { grid-area: batch-feed; }
.gas-meter  { grid-area: gas-meter; }
.finality   { grid-area: finality; }
.rollup-a   { grid-area: rollup-a; }
.rollup-b   { grid-area: rollup-b; }
.status-bar { grid-area: status-bar; }

/* --- LED Indicators --- */
.led {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ledPulse 2s infinite;
}
.led-green   { background: var(--green);   box-shadow: 0 0 6px var(--green); }
.led-cyan    { background: var(--cyan);    box-shadow: 0 0 6px var(--cyan); }
.led-magenta { background: var(--magenta); box-shadow: 0 0 6px var(--magenta); }
.led-amber   { background: var(--amber);   box-shadow: 0 0 6px var(--amber); }

@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* --- Panel Body --- */
.panel-body {
    flex: 1;
    padding: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================
   SEQUENCER (Hero)
   ============================ */
.sequencer-body {
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.lcd-housing {
    position: relative;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    padding: 10px 24px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.7);
    text-align: center;
}

.lcd-ghost, .lcd-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    display: block;
}

.lcd-ghost {
    color: #1a1c22;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    user-select: none;
}

.lcd-text {
    position: relative;
    color: var(--green);
    text-shadow:
        0 0 10px var(--green),
        0 0 30px rgba(57,255,20,0.3),
        0 0 60px rgba(57,255,20,0.1);
    animation: lcdFlicker 3s infinite;
}

@keyframes lcdFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.constellation-map {
    width: 100%;
    max-width: 400px;
    flex-shrink: 1;
    min-height: 0;
}

.sequencer-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.meta-item {
    text-align: center;
}

.meta-label {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.meta-value {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-green { color: var(--green); text-shadow: 0 0 8px rgba(57,255,20,0.4); }
.meta-cyan  { color: var(--cyan);  text-shadow: 0 0 8px rgba(0,229,255,0.4); }

/* ============================
   BATCH FEED
   ============================ */
.batch-feed-body {
    padding: 0;
}

.batch-list {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.batch-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #0c0e14;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    flex-shrink: 0;
    animation: slideIn 0.4s ease-out;
}

.batch-entry:nth-child(odd) {
    background: rgba(0,0,0,0.15);
}

.batch-num { color: var(--cyan); }
.batch-txns { color: var(--green); }
.batch-time { color: var(--muted); font-size: 0.65rem; }
.batch-status-ok { color: var(--green); }
.batch-status-pending { color: var(--amber); }

@keyframes slideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ============================
   GAUGE PANELS
   ============================ */
.gauge-body {
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.gauge-bezel {
    width: clamp(100px, 12vw, 160px);
    height: clamp(100px, 12vw, 160px);
    border-radius: 50%;
    background: radial-gradient(circle, var(--frame-light) 0%, var(--frame) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.gauge-container-sm .gauge-bezel {
    width: clamp(80px, 10vw, 130px);
    height: clamp(80px, 10vw, 130px);
}

.gauge-well {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--base);
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

.gauge-arc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    --gauge-current: 0deg;
    transition: --gauge-current 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gauge-green {
    background: conic-gradient(var(--green) var(--gauge-current), transparent var(--gauge-current));
    mask: radial-gradient(circle, transparent 60%, black 61%);
    -webkit-mask: radial-gradient(circle, transparent 60%, black 61%);
}

.gauge-cyan {
    background: conic-gradient(var(--cyan) var(--gauge-current), transparent var(--gauge-current));
    mask: radial-gradient(circle, transparent 60%, black 61%);
    -webkit-mask: radial-gradient(circle, transparent 60%, black 61%);
}

.gauge-amber {
    background: conic-gradient(var(--amber) var(--gauge-current), transparent var(--gauge-current));
    mask: radial-gradient(circle, transparent 60%, black 61%);
    -webkit-mask: radial-gradient(circle, transparent 60%, black 61%);
}

.gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-number {
    font-family: 'Space Mono', monospace;
    font-size: clamp(1.2rem, 2vw, 2rem);
    color: #fff;
    line-height: 1;
}

.gauge-unit {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.1em;
}

.gauge-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--muted);
}

.panel-narration {
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.5;
    text-align: center;
    max-width: 300px;
    padding: 0 8px;
}

/* ============================
   ROLLUP B — DATA READOUTS
   ============================ */
.data-readout {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
}

.readout-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.readout-value {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.readout-green  { color: var(--green);  text-shadow: 0 0 6px rgba(57,255,20,0.3); }
.readout-cyan   { color: var(--cyan);   text-shadow: 0 0 6px rgba(0,229,255,0.3); }
.readout-amber  { color: var(--amber);  text-shadow: 0 0 6px rgba(255,184,0,0.3); }

.embossed-divider {
    height: 2px;
    background: linear-gradient(180deg, var(--base) 0%, var(--frame) 100%);
}

/* ============================
   STATUS BAR
   ============================ */
.status-bar {
    border-radius: 4px;
    flex-direction: row;
    padding: 0;
}

.status-bar .panel-header { display: none; }

.status-bar-inner {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
}

.status-text, .status-text-clone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--green);
    text-shadow: 0 0 6px rgba(57,255,20,0.3);
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    padding: 0 8px;
}

.status-text-clone {
    animation: marquee2 30s linear infinite;
}

@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes marquee2 {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- Constellation star glow --- */
.star-node {
    animation: starPulse 3s infinite ease-in-out;
}

@keyframes starPulse {
    0%, 100% { r: attr(data-r); opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================
   MOBILE: Stack panels
   ============================ */
@media (max-width: 768px) {
    html, body { overflow: auto; }

    .cockpit-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "sequencer"
            "batch-feed"
            "gas-meter"
            "finality"
            "rollup-a"
            "rollup-b"
            "status-bar";
        height: auto;
        min-height: 100vh;
    }

    .sequencer     { min-height: 50vh; }
    .batch-feed    { min-height: 300px; }
    .gas-meter     { min-height: 350px; }
    .finality      { min-height: 350px; }
    .rollup-a      { min-height: 250px; }
    .rollup-b      { min-height: 250px; }
    .status-bar    { min-height: 36px; }
}
