﻿body
{
}
:root {
    --bg: #0f0f12;
    --bg-elevated: #18181b;
    --bg-soft: #1f1f23;
    --border: #27272f;
    --accent: #9146ff;
    --accent-soft: rgba(145, 70, 255, 0.15);
    --text: #f9f9fb;
    --text-muted: #a1a1aa;
    --danger: #e91916;
    --success: #46d369;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* APP LAYOUT */

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TOP BAR */

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
}

.top-nav {
    display: flex;
    gap: 12px;
}

.nav-item {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
}

    .nav-item.active,
    .nav-item:hover {
        color: var(--text);
        background: var(--bg-soft);
    }

.topbar-center {
    flex: 1;
    max-width: 420px;
    padding: 0 16px;
}

.search-input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #000;
    color: var(--text);
    font-size: 14px;
}

    .search-input::placeholder {
        color: var(--text-muted);
    }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-btn {
    border-radius: 999px;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
}

    .top-btn:hover {
        background: rgba(145, 70, 255, 0.25);
    }

.avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--success));
}

/* MAIN GRID */

.main {
    flex: 1;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 340px;
    min-height: 0;
}

/* LEFT SIDEBAR */

.sidebar-left {
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sidebar-avatar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #3f3f46;
    position: relative;
}

    .avatar-circle.online::after {
        content: "";
        position: absolute;
        bottom: 0;
        right: -2px;
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: var(--success);
        border: 2px solid var(--bg-elevated);
    }

/* CENTER CONTENT */

.content {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* PLAYER */

.player-wrapper {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.player {
    background: #000;
    position: relative;
    aspect-ratio: 16 / 9;
}

.player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #71717a;
    font-size: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
}

.viewer-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(24, 24, 27, 0.85);
    color: var(--text);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
}

/* STRIP DƯỚI VIDEO */

.stream-strip {
    margin-top: 4px;
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.strip-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strip-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--success));
}

.strip-text {
    display: flex;
    flex-direction: column;
}

.strip-title {
    font-weight: 600;
    font-size: 14px;
}

.strip-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.strip-right {
    display: flex;
    gap: 8px;
}

.pill-btn {
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 13px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
}

    .pill-btn.primary {
        background: var(--accent);
        border-color: var(--accent);
    }

    .pill-btn:hover {
        filter: brightness(1.05);
    }

/* CHANNEL INFO */

.channel-info {
    margin-top: 4px;
}

.channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.channel-name {
    margin: 0;
    font-size: 18px;
}

.channel-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.channel-panels {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
    gap: 12px;
}

.panel {
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 14px;
}

    .panel h2 {
        margin: 0 0 6px;
        font-size: 14px;
    }

    .panel p {
        margin: 0;
        color: var(--text-muted);
    }

.social-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .social-list li + li {
        margin-top: 4px;
    }

    .social-list a {
        color: var(--accent);
        text-decoration: none;
        font-size: 14px;
    }

/* CHAT PANEL */

.chat {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: var(--bg-elevated);
    min-width: 0;
}

.chat-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.chat-title {
    font-size: 14px;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 10px 10px 0;
    overflow-y: auto;
    font-size: 13px;
}

.chat-message {
    margin-bottom: 6px;
}

.chat-username {
    font-weight: 600;
    color: var(--accent);
    margin-right: 4px;
}

.chat-placeholder {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.chat-input-bar {
    padding: 8px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
}

.chat-input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #000;
    color: var(--text);
    font-size: 13px;
}

    .chat-input::placeholder {
        color: var(--text-muted);
    }

.chat-send-btn {
    padding: 6px 10px;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

/* RESPONSIVE */

@media (max-width: 1024px) {
    .main {
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) 260px;
        grid-template-areas:
            "sidebar content"
            "sidebar chat";
    }

    .sidebar-left {
        grid-area: sidebar;
    }

    .content {
        grid-area: content;
    }

    .chat {
        grid-area: chat;
        height: auto;
    }
}

@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) 220px;
    }

    .sidebar-left {
        display: none;
    }

    .channel-panels {
        grid-template-columns: 1fr;
    }
}
