/* courthouse.stream -- Broadcast Dashboard Theme */
/* Palette:
   Broadcast Dark: #111114
   Surface: #1a1a1e
   Border: #333338
   Live Red: #e5383b
   Signal Blue: #4895ef
   Ticker Yellow: #ffd60a
   Text: #d4d4d8
   Muted: #71717a
   Green: #22c55e
*/

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

html {
    height: 100%;
    scrollbar-color: #333338 #1a1a1e;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 400;
    color: #d4d4d8;
    background: #111114;
    min-height: 100%;
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────── */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #111114;
    border-bottom: 1px solid #333338;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    color: #d4d4d8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-timecode {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #71717a;
}

.viewer-global {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #71717a;
}

/* ── LIVE Badge ───────────────────────────────────────── */
.live-badge {
    display: inline-block;
    background: #e5383b;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 0.05em;
    animation: live-pulse 2s ease-in-out infinite;
}

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

/* ── Online Dot ───────────────────────────────────────── */
.online-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: dot-glow 3s ease-in-out infinite;
}

@keyframes dot-glow {
    0%, 100% { box-shadow: 0 0 2px #22c55e; }
    50% { box-shadow: 0 0 8px #22c55e, 0 0 16px rgba(34, 197, 94, 0.3); }
}

/* ── Main Layout ──────────────────────────────────────── */
#main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: 1fr;
    flex: 1;
    min-height: 0;
}

#main-content {
    padding: 24px;
    overflow-y: auto;
}

/* ── Hero Broadcast ───────────────────────────────────── */
#hero-broadcast {
    margin-bottom: 16px;
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0a0a0c;
    border: 2px solid #333338;
    overflow: hidden;
}

.hero-frame {
    max-width: 800px;
    margin: 0 auto;
}

.frame-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* Corner registration marks */
.corner-mark {
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0.3;
}

.corner-mark.top-left {
    top: 8px;
    left: 8px;
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
}

.corner-mark.top-right {
    top: 8px;
    right: 8px;
    border-top: 1px solid #fff;
    border-right: 1px solid #fff;
}

.corner-mark.bottom-left {
    bottom: 8px;
    left: 8px;
    border-bottom: 1px solid #fff;
    border-left: 1px solid #fff;
}

.corner-mark.bottom-right {
    bottom: 8px;
    right: 8px;
    border-bottom: 1px solid #fff;
    border-right: 1px solid #fff;
}

.frame-live {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
}

.frame-timecode {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    color: #d4d4d8;
    background: rgba(17, 17, 20, 0.7);
    padding: 2px 6px;
    border-radius: 2px;
    z-index: 3;
}

.frame-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.court-icon {
    width: 120px;
    height: 80px;
    opacity: 0.15;
}

.gavel-icon,
.scales-icon,
.doc-icon {
    width: 60px;
    height: 60px;
    opacity: 0.15;
}

.frame-bottom-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(10, 10, 12, 0.9) 0%, transparent 100%);
    padding: 24px 14px 10px;
    z-index: 3;
}

.frame-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.case-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #d4d4d8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.frame-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    color: #71717a;
}

.separator {
    color: #333338;
}

.viewer-count {
    color: #d4d4d8;
}

.scheduled-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: inline-block;
    background: #4895ef;
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    padding: 2px 8px;
    border-radius: 2px;
}

.feed-scheduled {
    display: flex;
    align-items: center;
    justify-content: center;
}

.scheduled-label {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.scheduled-text {
    color: #4895ef;
}

/* ── Hero Ticker ──────────────────────────────────────── */
#hero-ticker {
    overflow: hidden;
    background: #1a1a1e;
    border: 1px solid #333338;
    border-radius: 2px;
    padding: 6px 0;
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: scroll-ticker 45s linear infinite;
}

.ticker-content {
    flex-shrink: 0;
    padding-right: 60px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    color: #d4d4d8;
}

.ticker-breaking {
    color: #e5383b;
    font-weight: 700;
}

.ticker-highlight {
    color: #ffd60a;
    font-weight: 700;
}

@keyframes scroll-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ── Multi-Feed Grid ──────────────────────────────────── */
#multi-feed {
    margin-top: 8px;
}

.section-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.feed-frame {
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.feed-frame:hover {
    border-color: #4895ef;
}

.feed-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Analysis Sidebar ─────────────────────────────────── */
#analysis-sidebar {
    background: #1a1a1e;
    border-left: 1px solid #333338;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #333338;
    flex-shrink: 0;
}

.sidebar-title {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #d4d4d8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.analysis-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 18px;
    scrollbar-color: #333338 #1a1a1e;
    scrollbar-width: thin;
}

.analysis-feed::-webkit-scrollbar {
    width: 6px;
}

.analysis-feed::-webkit-scrollbar-track {
    background: #1a1a1e;
}

.analysis-feed::-webkit-scrollbar-thumb {
    background: #333338;
    border-radius: 3px;
}

.analysis-entry {
    padding: 14px 0;
    border-bottom: 1px solid #333338;
}

.analysis-entry:last-child {
    border-bottom: none;
}

.analysis-time {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    color: #71717a;
    display: block;
    margin-bottom: 2px;
}

.analysis-author {
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    color: #4895ef;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.analysis-text {
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #d4d4d8;
}

/* ── Bottom News Ticker ───────────────────────────────── */
#news-ticker {
    display: flex;
    align-items: stretch;
    height: 36px;
    background: #111114;
    border-top: 1px solid #333338;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.ticker-label {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5383b;
    padding: 0 16px;
    flex-shrink: 0;
}

.ticker-label-text {
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker-scroll {
    display: flex;
    white-space: nowrap;
    animation: scroll-bottom-ticker 60s linear infinite;
}

.bottom-ticker-content {
    flex-shrink: 0;
    padding: 0 40px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    color: #d4d4d8;
}

@keyframes scroll-bottom-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Account for fixed ticker at bottom */
#app {
    padding-bottom: 36px;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    #main-layout {
        grid-template-columns: 1fr;
    }

    #analysis-sidebar {
        position: relative;
        height: auto;
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid #333338;
    }

    .hero-frame {
        max-width: 100%;
    }

    #hero-ticker {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .feed-grid {
        grid-template-columns: 1fr;
    }

    #header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }

    .header-right {
        gap: 12px;
    }

    #main-content {
        padding: 16px;
    }
}
