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

:root {
    --bg: #0f0f0f;
    --panel: #181818;
    --panel2: #222;
    --text: #f1f1f1;
    --muted: #aaa;
    --border: #303030;
    --red: #ff0033;
    --red2: #cc0029;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #0b0b0b;
    border-right: 1px solid var(--border);
    padding: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.logo {
    width: 42px;
    height: 30px;
    border-radius: 9px;
    background: var(--red);
    display: grid;
    place-items: center;
    font-weight: 900;
}

.brand h1 {
    font-size: 1.45rem;
}

.nav-btn {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 8px;
    border: none;
    border-radius: 12px;
    text-align: left;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--panel2);
}

.sidebar-note {
    margin-top: 30px;
    padding: 15px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.sidebar-note p {
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.4;
}

.main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 70px;
    padding: 12px 24px;
    background: rgba(15,15,15,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
}

.menu {
    display: none;
    border: none;
    background: var(--panel2);
    color: white;
    border-radius: 10px;
    padding: 10px 13px;
    cursor: pointer;
}

.search-box {
    max-width: 720px;
    margin: auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
}

.search-box input {
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 999px 0 0 999px;
    background: #121212;
    color: white;
    outline: none;
    font-size: 1rem;
}

.search-box button {
    padding: 0 20px;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 999px 999px 0;
    background: var(--panel2);
    color: white;
    cursor: pointer;
}

.upload-shortcut,
#refreshBtn,
#refreshLibraryBtn,
.back-btn,
#uploadBtn,
.actions button,
#commentForm button {
    border: none;
    border-radius: 999px;
    background: var(--red);
    color: white;
    padding: 12px 18px;
    font-weight: 900;
    cursor: pointer;
    transition: .2s;
}

.upload-shortcut:hover,
#refreshBtn:hover,
#refreshLibraryBtn:hover,
.back-btn:hover,
#uploadBtn:hover,
.actions button:hover,
#commentForm button:hover {
    background: var(--red2);
    transform: translateY(-2px);
}

.page {
    display: none;
    padding: 28px;
}

.active-page {
    display: block;
}

.hero {
    margin-bottom: 28px;
    padding: 38px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top left, rgba(255,0,51,.25), transparent 35%),
        linear-gradient(135deg, #181818, #111);
    border: 1px solid var(--border);
}

.hero h2 {
    font-size: clamp(2.6rem, 6vw, 5rem);
    margin-bottom: 10px;
}

.hero p {
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.5;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 14px;
}

.section-head h3 {
    font-size: 1.8rem;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}

.video-card {
    cursor: pointer;
    transition: .22s;
}

.video-card:hover {
    transform: translateY(-6px);
}

.thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    background:
        linear-gradient(135deg, #272727, #111),
        radial-gradient(circle, rgba(255,0,51,.25), transparent 45%);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.72);
    font-size: .85rem;
    font-weight: 900;
}

.video-info {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    margin-top: 12px;
}

.channel-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), #7c3aed);
    display: grid;
    place-items: center;
    font-weight: 900;
}

.video-title {
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 5px;
}

.video-meta {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.35;
}

.upload-panel {
    width: min(780px, 100%);
    margin: 20px auto;
    padding: 32px;
    border-radius: 26px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.upload-panel h2 {
    font-size: 2.3rem;
    margin-bottom: 10px;
}

.upload-panel p {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 22px;
}

#uploadForm {
    display: grid;
    gap: 13px;
}

#uploadForm label {
    font-weight: 900;
}

#uploadForm input,
#uploadForm textarea {
    width: 100%;
    padding: 14px 15px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: #101010;
    color: white;
    outline: none;
    font-size: 1rem;
}

#uploadForm textarea {
    min-height: 120px;
    resize: vertical;
}

#uploadStatus {
    margin-top: 18px;
    font-weight: 900;
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

.watch-main video {
    width: 100%;
    max-height: 70vh;
    background: black;
    border-radius: 18px;
}

#watchTitle {
    margin-top: 18px;
    font-size: 2rem;
}

#watchMeta,
#watchDescription {
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.5;
}

.actions {
    display: flex;
    gap: 12px;
    margin: 18px 0;
}

.comments {
    margin-top: 28px;
    padding: 22px;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.comments h3 {
    margin-bottom: 16px;
}

#commentForm {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 18px;
}

#commentForm input {
    padding: 13px 15px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #101010;
    color: white;
    outline: none;
}

.comment {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.comment strong {
    display: block;
    margin-bottom: 5px;
}

.comment p {
    color: #ddd;
}

.recommended {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    height: fit-content;
}

.recommended h3 {
    margin-bottom: 14px;
}

.reco-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    margin-bottom: 14px;
    cursor: pointer;
}

.reco-thumb {
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #252525;
    overflow: hidden;
}

.reco-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reco-card strong {
    font-size: .95rem;
    line-height: 1.3;
}

.empty {
    padding: 28px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--muted);
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 250px;
        z-index: 200;
        transform: translateX(-100%);
        transition: .25s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu {
        display: block;
    }

    .watch-layout {
        grid-template-columns: 1fr;
    }

    .recommended {
        display: none;
    }
}

@media (max-width: 650px) {
    .topbar {
        grid-template-columns: auto 1fr;
    }

    .upload-shortcut {
        display: none;
    }

    .page {
        padding: 18px;
    }

    #commentForm {
        grid-template-columns: 1fr;
    }
}
