/* ═══════════════════════════════════════════════════════════════════
   qPONTUS STREAM — Dark Premium Theme
   Bloomberg meets Twitch — professional financial streaming
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Backgrounds */
    --bg-primary:       #0D1117;
    --bg-secondary:     #161B22;
    --bg-tertiary:      #1C2333;
    --bg-surface:       #21283B;
    --bg-hover:         #2A3347;

    /* Brand */
    --accent:           #4A90A4;
    --accent-bright:    #5EAFC3;
    --accent-glow:      rgba(74, 144, 164, 0.15);

    /* Semantic */
    --success:          #27AE60;
    --warning:          #FFC107;
    --danger:           #E74C3C;
    --vip-gold:         #F0B90B;
    --vip-gold-dark:    #C49A08;

    /* Text */
    --text-primary:     #E6EDF3;
    --text-secondary:   #8B949E;
    --text-muted:       #484F58;

    /* Borders */
    --border:           #30363D;
    --border-subtle:    #21262D;
    --border-active:    #4A90A4;

    /* Spacing */
    --navbar-h:         56px;
    --radius:           12px;
    --radius-sm:        8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════════ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-h);
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

/* Logo */
.logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
    flex-shrink: 0;
}

.logo-main {
    display: flex;
    align-items: baseline;
}

.logo-q {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.logo-pontus {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.logo-subtitle {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 1px;
}

/* Asset Tabs */
.asset-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.asset-tabs::-webkit-scrollbar {
    display: none;
}

.asset-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
    font-family: inherit;
}

.asset-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border-active);
    color: var(--text-primary);
}

.asset-tab.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--text-primary);
    font-weight: 700;
    box-shadow: 0 0 12px var(--accent-glow);
}

.tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.asset-tab.online .tab-dot {
    background: var(--success);
}

.asset-tab.offline .tab-dot {
    background: var(--danger);
}

/* Live Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: live-pulse 2s ease-in-out infinite;
}

.live-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

.main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    padding-top: calc(var(--navbar-h) + 16px);
    padding-bottom: 24px;
    min-height: calc(100vh - 160px);
}

/* ═══════════════════════════════════════════════════════════════════
   PLAYER
   ═══════════════════════════════════════════════════════════════════ */

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

.main-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.main-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Player Overlay */
.player-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.player-overlay-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 16px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-asset-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    letter-spacing: 1px;
}

.player-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.badge-delayed {
    background: var(--danger);
}

.badge-realtime {
    background: var(--success);
}

.player-quality {
    padding: 3px 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

/* Player Loading */
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #000;
    z-index: 3;
}

.loading-logo {
    animation: pulse-logo 1.5s ease-in-out infinite;
}

.loading-logo .logo-q {
    font-size: 40px;
}

.loading-logo .logo-pontus {
    font-size: 40px;
}

.loading-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Player Error */
.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #000;
    z-index: 3;
}

.error-icon {
    font-size: 36px;
    color: var(--danger);
}

.error-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-retry {
    padding: 8px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-retry:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   THUMBNAILS
   ═══════════════════════════════════════════════════════════════════ */

.thumbnail-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.thumbnail-strip::-webkit-scrollbar {
    display: none;
}

.thumb {
    position: relative;
    flex: 1 1 0;
    min-width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 200ms ease;
    background: #000;
}

.thumb:hover {
    border-color: var(--accent);
    transform: scale(1.03);
    filter: brightness(1.1);
}

.thumb.active {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.thumb-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.thumb-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 8px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    pointer-events: none;
}

.thumb-name {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR (Chat + Voice)
   ═══════════════════════════════════════════════════════════════════ */

.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* ── Chat Panel ── */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-online {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-msg {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background 150ms ease;
    animation: slideUp 200ms ease-out;
}

.chat-msg:hover {
    background: var(--bg-surface);
}

.chat-msg-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2px;
}

.chat-msg-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.chat-msg-time {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-msg-text {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

/* System message */
.chat-msg-system {
    text-align: center;
    padding: 8px;
}

.chat-msg-system .chat-msg-text {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 200ms ease;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:focus {
    border-color: var(--accent);
}

.chat-send {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.chat-send:hover {
    background: var(--accent-bright);
    transform: scale(1.05);
}

/* ── Voice Panel ── */
.voice-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    flex-shrink: 0;
}

.voice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.voice-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.voice-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Disconnected */
.voice-disconnected {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-join-voice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--accent);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-join-voice:hover {
    background: var(--accent-bright);
    transform: scale(1.03);
    box-shadow: 0 0 16px var(--accent-glow);
}

.voice-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Connected */
.voice-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    justify-content: center;
}

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

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: box-shadow 200ms ease;
}

.participant-avatar.speaking {
    animation: speaking-ring 1s ease-in-out infinite;
}

.participant-name {
    font-size: 11px;
    color: var(--text-secondary);
    max-width: 60px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 200ms ease;
    color: #fff;
}

.btn-mute {
    background: var(--bg-surface);
}

.btn-mute:hover {
    background: var(--bg-hover);
}

.btn-mute.muted {
    background: var(--danger);
}

.btn-leave {
    background: var(--danger);
}

.btn-leave:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════
   VIP CTA BANNER
   ═══════════════════════════════════════════════════════════════════ */

.vip-banner {
    margin-bottom: 24px;
}

.vip-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(240, 185, 11, 0.08) 0%, rgba(231, 76, 60, 0.08) 100%);
    border: 1px solid rgba(240, 185, 11, 0.25);
}

.vip-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vip-headline {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.vip-sub {
    font-size: 14px;
    color: var(--text-secondary);
}

.vip-badge-beta {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 14px;
    background: var(--vip-gold);
    color: #0D1117;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 4px;
}

.btn-vip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #F0B90B, #E8A500);
    color: #0D1117;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-vip:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 24px rgba(240, 185, 11, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */

.footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-brand .logo-q {
    font-size: 16px;
}

.footer-brand .logo-pontus {
    font-size: 16px;
}

.footer-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   NICKNAME MODAL
   ═══════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    width: 340px;
    max-width: 90vw;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    margin-bottom: 16px;
    transition: border-color 200ms ease;
}

.modal-input:focus {
    border-color: var(--accent);
}

.btn-modal-confirm {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-modal-confirm:hover {
    background: var(--accent-bright);
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

@keyframes live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); }
}

@keyframes pulse-logo {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

@keyframes speaking-ring {
    0%, 100% { box-shadow: 0 0 0 2px var(--success); }
    50% { box-shadow: 0 0 0 5px rgba(39, 174, 96, 0.3); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered load animations */
.navbar        { animation: fadeInUp 400ms ease-out; }
.player-column { animation: fadeInUp 400ms ease-out 100ms both; }
.sidebar-column{ animation: fadeInUp 400ms ease-out 200ms both; }
.vip-banner    { animation: fadeInUp 400ms ease-out 300ms both; }
.footer        { animation: fadeInUp 400ms ease-out 400ms both; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (<=1024px)
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-column {
        flex-direction: row;
        gap: 12px;
    }

    .chat-panel {
        flex: 1;
        max-height: 400px;
    }

    .voice-panel {
        width: 280px;
        flex-shrink: 0;
    }

    .vip-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (<=768px)
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .nav-container {
        gap: 12px;
    }

    .logo-subtitle {
        display: none;
    }

    .asset-tabs {
        gap: 4px;
    }

    .asset-tab {
        padding: 5px 10px;
        font-size: 11px;
    }

    .live-indicator {
        display: none;
    }

    .main-layout {
        grid-template-columns: 1fr;
        padding-top: calc(var(--navbar-h) + 8px);
        padding-bottom: 12px;
        gap: 8px;
    }

    .main-player {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0 -12px;
        width: calc(100% + 24px);
    }

    .thumbnail-strip {
        gap: 6px;
    }

    .thumb {
        min-width: 120px;
        flex: 0 0 120px;
    }

    .sidebar-column {
        flex-direction: column;
    }

    .chat-panel {
        max-height: 350px;
    }

    .voice-panel {
        width: 100%;
    }

    .vip-content {
        padding: 16px 20px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .vip-headline {
        font-size: 17px;
    }

    .vip-price {
        font-size: 24px;
    }

    .btn-vip {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }

    .footer-container {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}
