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

body {
    background: #0f0f0f;
    color: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0a0a0a;
    border-bottom: 1px solid #222;
    padding: 0 1rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ff4444;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.nav-links a {
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}
.nav-links a:hover { color: #fff; }

/* Hamburger — pure CSS */
.nav-toggle { display: none; }
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: 0.2s;
}

@media (max-width: 640px) {
    .hamburger { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #0a0a0a;
        border-bottom: 1px solid #222;
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
    }
    .nav-links a { font-size: 1rem; }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-toggle:checked ~ .hamburger span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .hamburger span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* ── Layout ──────────────────────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #222;
}
.page-title .count {
    color: #666;
    font-size: 0.75em;
    font-weight: 400;
}

/* ── Category pills (horizontal scroll) ──────────────────────────── */
.cat-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 0 1rem;
    margin-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cat-pills::-webkit-scrollbar { display: none; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #ccc;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.pill:hover {
    background: #252525;
    border-color: #ff4444;
    color: #fff;
}
.pill .pill-count {
    color: #666;
    font-size: 0.75rem;
}
.pill-inactive {
    opacity: 0.35;
    pointer-events: none;
}

/* ── Video Grid ──────────────────────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (min-width: 1024px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1400px) {
    .grid { grid-template-columns: repeat(6, 1fr); }
}

/* ── Video Card ──────────────────────────────────────────────────── */
.card {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.card-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #111;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.15s;
}
.card:hover .card-thumb img { opacity: 0.8; }

.card-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.02em;
}

.card-body { padding: 0.5rem 0.6rem 0.6rem; }

.card-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: #eee;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    display: inline-block;
    background: #252525;
    color: #888;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    font-size: 0.68rem;
}

/* ── Video Page ──────────────────────────────────────────────────── */
.video-page {
    max-width: 900px;
}

.breadcrumb {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.75rem;
}
.breadcrumb a { color: #888; }
.breadcrumb a:hover { color: #ff4444; }
.breadcrumb .sep { color: #444; }

.player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.player-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #1a1a1a;
}
.video-meta .dot { color: #333; }

.video-cats, .video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.video-cats .pill, .video-tags .pill {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}
.video-meta a { color: #ff4444; }
.video-meta a:hover { color: #ff6666; }

.thumbs-scroll {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.75rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.thumbs-scroll::-webkit-scrollbar { display: none; }
.thumbs-scroll img {
    height: 64px;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
    cursor: pointer;
}
.thumbs-scroll img:hover { opacity: 1; }

@media (min-width: 640px) {
    .thumbs-scroll img { height: 80px; }
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ff4444;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin: 0.75rem 0 1.5rem;
    transition: background 0.15s;
}
.btn-download:hover { background: #ff5555; color: #fff; }
.btn-download svg { width: 18px; height: 18px; fill: currentColor; }

.video-description {
    color: #999;
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #141414;
    border-radius: 8px;
}

/* ── Related ─────────────────────────────────────────────────────── */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #ccc;
}

/* ── Categories page ─────────────────────────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}
@media (min-width: 640px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

.cat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    border: 1px solid #222;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.cat-card:hover {
    border-color: #ff4444;
    background: #1f1f1f;
}
.cat-card .cat-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ddd;
}
.cat-card .cat-count {
    font-size: 0.8rem;
    color: #555;
    background: #222;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid #1a1a1a;
}
.pagination a, .pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}
.pagination a {
    background: #1a1a1a;
    color: #aaa;
    transition: background 0.15s, color 0.15s;
}
.pagination a:hover { background: #252525; color: #fff; }
.pagination .current {
    background: #ff4444;
    color: #fff;
}
.pagination .dots { color: #444; }

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
    margin-top: 3rem;
    padding: 1.5rem 1rem;
    border-top: 1px solid #1a1a1a;
    text-align: center;
    color: #444;
    font-size: 0.8rem;
}
.footer-cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.footer-cats a {
    color: #555;
    font-size: 0.75rem;
    transition: color 0.15s;
}
.footer-cats a:hover { color: #ff4444; }
