/* Design tokens */
:root {
    --bg: #0d0d0d;           /* main background (black-ish) */
    --surface: #161616;      /* panels/cards */
    --text: #f2f2f2;         /* primary text */
    --muted: #a0a0a0;        /* secondary text */
    --primary: #ff6b00;      /* orange */
    --primary-contrast: #0b0b0b;
    --border: #2a2a2a;       /* subtle borders */
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
/* Header (YouTube-like) */
.yt-header { position: sticky; top: 0; z-index: 30; background: #111111; border-bottom: 1px solid #1f1f1f; color: #ffffff; }
.yt-header-inner { height: 60px; display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 12px; padding: 0 16px; }
.yt-header .left, .yt-header .center, .yt-header .right { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 700; color: #ffffff; }
.icon-button { background: transparent; border: none; cursor: pointer; font-size: 18px; padding: 8px; border-radius: 8px; color: #ffffff; }
.icon-button:hover { background: #1a1a1a; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); display: grid; place-items: center; font-weight: 700; }

.search { display: flex; width: 100%; }
.search input { flex: 1; border: 1px solid #2a2a2a; border-right: none; padding: 10px 12px; border-radius: 999px 0 0 999px; background: #0a0a0a; color: #fff; }
.search button { border-radius: 0 999px 999px 0; }

/* Buttons */
.button {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
    background: var(--primary); color: var(--primary-contrast); font-weight: 600;
    box-shadow: var(--shadow); cursor: pointer;
}
.button:hover { filter: brightness(1.05); }
.button:active { transform: translateY(1px); }
.button-outline { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; }
.button-outline:hover { border-color: var(--text); }

/* Shell layout */
.yt-shell { display: grid; grid-template-columns: 240px 1fr; align-items: start; }
@media (max-width: 900px) { .yt-shell { grid-template-columns: 1fr; } }

.yt-sidebar { position: sticky; top: 60px; height: calc(100dvh - 60px); overflow: auto; border-right: 1px solid #1f1f1f; background: #111111; }
.yt-sidebar::-webkit-scrollbar { width: 10px; }
.yt-sidebar::-webkit-scrollbar-thumb { background: #222; border-radius: 8px; }
.side-nav { display: grid; padding: 8px; gap: 4px; }
.side-link { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: #eeeeee; }
.side-link:hover { background: #1a1a1a; }
.side-link.active { background: rgba(255, 107, 0, 0.18); border-color: rgba(255, 107, 0, 0.35); }

.yt-content { min-height: 60dvh; background: var(--bg); }
.content-inner { padding: 16px; }

/* Grid like YouTube */
.video-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }

.video-card { display: grid; gap: 8px; grid-column: auto !important; }

.thumb { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duration { position: absolute; right: 8px; bottom: 8px; font-size: 12px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,0.7); color: #fff; }

.meta { display: grid; grid-template-columns: 40px 1fr; gap: 10px; }
.meta .poster { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.meta .poster img { width: 100%; height: 100%; object-fit: cover; }
.title { font-weight: 600; line-height: 1.3; margin: 0; }
.subtitle { color: var(--muted); font-size: 14px; margin: 2px 0 0; }

/* Remove old card/grid styles */

/* Form */
/* Form (search only now) */

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); background: #0f0f0f; }

/* Sidebar collapse toggle */
/* Desktop collapse: hide sidebar column, keep content full width */
@media (min-width: 901px) {
    body.collapsed .yt-shell { grid-template-columns: 0 1fr; }
    body.collapsed .yt-sidebar { display: none; }
}

/* Mobile overlay behavior */
@media (max-width: 900px) {
    .yt-sidebar { position: fixed; left: 0; top: 60px; width: 260px; max-width: 85vw; height: calc(100dvh - 60px); transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 8px 0 24px rgba(0,0,0,0.5); }
    body.sidebar-open .yt-sidebar { transform: translateX(0); }
    /* Optional dim backdrop effect via pseudo element */
    body.sidebar-open::after {
        content: ""; position: fixed; inset: 60px 0 0 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); z-index: 25;
    }
}


