:root {
    --bg: #0b0b0c;
    --bg-raised: #121214;
    --bg-card: #18181b;
    --border: #2a2a30;
    --text: #ececec;
    --muted: #8c8c94;
    --accent: #ff3b1f;
    --accent-soft: rgba(255, 59, 31, 0.16);
    --header-h: 124px;
    --logo-h: 100px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    min-height: 100vh;
}

a { color: var(--accent); }
a:hover { color: #ff6a54; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    background: rgba(11, 11, 12, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.site-brand {
    display: flex;
    align-items: center;
    line-height: 0;
}

.site-logo-wrap {
    display: block;
    position: relative;
    height: var(--logo-h);
    width: calc(var(--logo-h) * 1.95);
    overflow: hidden;
}

.site-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    height: 191%;
    width: auto;
    max-width: none;
    transform: translate(-50%, -50%);
    display: block;
}

.site-header-actions {
    display: flex;
    align-items: center;
    min-width: 7rem;
    justify-content: flex-end;
}

.site-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.site-login:hover {
    color: var(--text);
    border-color: #3a3a42;
}

.site-shell {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - var(--header-h));
}

.sidebar {
    flex: 0 1 auto;
    width: max-content;
    min-width: 8.25rem;
    max-width: 16rem;
    background: var(--bg);
    border-right: 1px solid var(--border);
}

.sidebar-content { padding: 1.1rem 0.55rem 2rem 0.65rem; position: sticky; top: calc(var(--header-h) + 0.5rem); }

.sidebar-title {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
    padding: 0 0.55rem;
}

.category-item { margin-bottom: 0.15rem; }

.category-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.35rem 0.55rem;
    color: #b4b4bc;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.84rem;
}

.category-link .cat-name { min-width: 0; }
.category-link small { color: var(--muted); font-size: 0.72rem; flex: 0 0 auto; }
.category-link:hover { color: var(--text); background: var(--bg-raised); }
.category-link.active {
    color: var(--text);
    background: var(--accent-soft);
    font-weight: 500;
}
.category-link.active small { color: #ff8a78; }

.main-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.5rem 1.75rem 3rem;
    background: var(--bg);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 1.85rem 1.55rem;
}

.video-cell { min-width: 0; }

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.page-header h1 {
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}
.page-header .text-muted,
.text-muted { color: var(--muted) !important; }

.video-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.video-link:hover { color: inherit; text-decoration: none; }

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.video-card .card-body {
    background: var(--bg-card);
    padding: 0.55rem 0.65rem 0.7rem;
}

.video-card:hover {
    transform: translateY(-2px);
    border-color: #3d3d46;
}

.card-img-top-container {
    position: relative;
    overflow: hidden;
    background: #000;
    width: 100%;
    aspect-ratio: 16 / 9;
}
.card-img-top-container .card-img-top,
img.card-img-top {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 59, 31, 0.45);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.play-overlay i { color: white; font-size: 1.15rem; }
.video-card:hover .play-overlay { opacity: 1; }

.card-title {
    font-size: 0.8rem;
    margin: 0;
    color: var(--text);
    font-weight: 500;
    line-height: 1.35;
}

.video-channel { margin-bottom: 0.2rem; }
.video-channel-link {
    font-size: 0.72rem;
    color: var(--muted);
    text-decoration: none;
}
.video-channel-link:hover { color: var(--accent); }

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
}
.video-tag {
    font-size: 0.72rem;
    color: #9a9aa3;
    text-decoration: none;
}
.video-tag:hover { color: var(--accent); }

.alert {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text);
}

.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text);
}
.pagination .page-item.disabled .page-link {
    background: var(--bg-raised);
    border-color: var(--border);
    color: var(--muted);
}
.pagination .page-link:hover {
    background: var(--accent-soft);
    border-color: var(--border);
    color: var(--text);
}

@media (max-width: 767.98px) {
    :root {
        --header-h: 88px;
        --logo-h: 64px;
    }
    .site-shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        max-width: none;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-content { position: static; padding-bottom: 0.5rem; }
    .main-content { padding: 1rem; }
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 1.25rem 1rem;
    }
}
