/* courthouse.stream - Dashboard Analytics Dark */
/* Palette: #111827, #1f2937, #10b981, #f59e0b, #ef4444, #f3f4f6, #9ca3af, #3b82f6 */

:root {
    --bg: #111827;
    --panel: #1f2937;
    --green: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --text: #f3f4f6;
    --text-sec: #9ca3af;
    --blue: #3b82f6;
    --gray-border: #4b5563;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    min-height: 400vh;
    overflow-x: hidden;
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.012) 0px,
        transparent 1px,
        transparent 3px
    );
}

/* Stream Bar (top progress) */
.stream-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 200;
}

.stream-fill {
    height: 100%;
    width: 0;
    background: var(--green);
    transition: width 0.08s linear;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* ============================
   HERO ZONE (Connection Sequence)
   ============================ */
.hero-zone {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 10;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.connect-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-sec);
    letter-spacing: 0.15em;
    min-height: 1.4em;
    position: relative;
}

.connect-text::after {
    content: '|';
    animation: cursorBlink 0.6s step-end infinite;
    color: var(--green);
    margin-left: 2px;
}

.connect-text.done::after {
    display: none;
}

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

.hero-brand-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-brand-area.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    color: var(--text);
    border-bottom: 2px solid var(--text-sec);
    padding-bottom: 4px;
    letter-spacing: -0.01em;
}

.hero-status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}

.hero-status-bar.visible {
    opacity: 1;
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transition: opacity 0.6s ease;
    animation: scrollFloat 2s ease-in-out infinite;
}

.scroll-hint.visible {
    opacity: 1;
}

.scroll-hint-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--text-sec);
    letter-spacing: 0.2em;
}

.scroll-arrow {
    color: var(--text-sec);
}

@keyframes scrollFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============================
   HEADER (Sticky)
   ============================ */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 2px;
    background: var(--bg);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.site-header.visible {
    opacity: 1;
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    border-bottom: 1px solid var(--text-sec);
    padding-bottom: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stream-count {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--text-sec);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    animation: livePulse 1.5s ease infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--red);
    letter-spacing: 0.1em;
}

/* Archive state for live indicator */
.live-badge.archived .live-dot {
    background: var(--gray-border);
    animation: none;
}

.live-badge.archived .live-text {
    color: var(--gray-border);
}

/* ============================
   DASHBOARD
   ============================ */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.5rem;
}

.panels-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================
   STREAM PANELS
   ============================ */
.stream-panel {
    background: var(--panel);
    border-left: 3px solid;
    border-radius: 4px;
    padding: 16px 20px;
    transition: border-left-color 0.5s ease, opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.stream-panel:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.border-green { border-left-color: var(--green); }
.border-amber { border-left-color: var(--amber); }
.border-gray { border-left-color: var(--gray-border); }
.border-blue { border-left-color: var(--blue); }

/* Panel reveal animation */
.panel-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.panel-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green {
    background: var(--green);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.dot-amber {
    background: var(--amber);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.dot-gray { background: var(--gray-border); }

.dot-blue {
    background: var(--blue);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

.panel-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--text-sec);
    letter-spacing: 0.05em;
}

.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    margin-left: auto;
}

.bar {
    width: 3px;
    background: var(--green);
    border-radius: 1px;
}

.b1 { height: 4px; }
.b2 { height: 7px; }
.b3 { height: 10px; }
.bar.inactive { background: var(--gray-border); }

/* Deep monitor panels glow */
.deep-panel.visible {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.08);
}

/* Archive panels dimmed */
.archive-panel {
    opacity: 0;
}

.archive-panel.visible {
    opacity: 0.7;
}

.archive-panel:hover {
    opacity: 1;
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.panel-text {
    font-size: 0.85rem;
    color: var(--text-sec);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.panel-meta {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: rgba(156, 163, 175, 0.6);
}

/* Summary Panel */
.summary-panel {
    border-left-width: 3px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 1rem;
    padding: 12px 0;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.8rem;
}

.stat-green { color: var(--green); }
.stat-blue { color: var(--blue); }
.stat-amber { color: var(--amber); }
.stat-gray { color: var(--gray-border); }

.stat-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--text-sec);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================
   ACTIVITY FEED
   ============================ */
.activity-feed {
    background: var(--panel);
    border-radius: 4px;
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 60px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.activity-feed::-webkit-scrollbar {
    width: 4px;
}

.activity-feed::-webkit-scrollbar-track {
    background: transparent;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.feed-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feed-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: livePulse 2s ease infinite;
}

.feed-item {
    font-size: 0.75rem;
    color: var(--text-sec);
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    line-height: 1.5;
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-reveal {
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.feed-reveal.visible {
    opacity: 1;
    transform: translateX(0);
}

.feed-time {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: rgba(156, 163, 175, 0.5);
    margin-right: 0.5rem;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .hero-brand {
        font-size: 1.4rem;
    }

    .dashboard {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .activity-feed {
        position: static;
        max-height: none;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-header {
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 480px) {
    .hero-brand {
        font-size: 1.1rem;
    }

    .panel-head {
        flex-wrap: wrap;
    }

    .signal-bars {
        margin-left: 0;
    }
}
