:root {
    --bg-base: #060609;
    --surface: rgba(255, 255, 255, 0.02);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --surface-elevated: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(255, 255, 255, 0.08);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --accent-solid: #8b5cf6;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 40px;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
}

/* ---------- Navbar ---------- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 24px;
    margin: 24px auto;
    max-width: 1400px;
    width: 94%;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: sticky;
    top: 16px;
    z-index: 100;
    border: 1px solid var(--border-glow);
    border-radius: 100px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.brand-logo {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.brand-logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; gap: 4px; flex-shrink: 0; }
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: var(--surface-hover); }

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 6px 16px;
    flex: 1;
    max-width: 320px;
    transition: all 0.3s ease;
}
.search-box:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-solid);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
.search-box input {
    background: transparent; border: none; color: #fff; outline: none;
    width: 100%; padding: 5px; font-size: 14px; font-family: inherit;
}
.search-box input::placeholder { color: #71717a; }
.search-box button { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding-left: 8px; }
.search-box button:hover { color: #fff; }

.nav-auth { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.auth-btn {
    background: var(--surface); color: #fff; font-size: 13.5px; font-weight: 600;
    padding: 8px 18px; border-radius: 30px; text-decoration: none;
    border: 1px solid var(--border-glow); transition: all 0.3s ease; white-space: nowrap;
}
.auth-btn:hover { background: var(--surface-hover); border-color: rgba(139, 92, 246, 0.4); }
.auth-btn.primary { background: var(--accent-gradient); border: none; }

.user-menu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 8px; background: var(--surface);
    border: 1px solid var(--border-glow); color: #fff; font-family: inherit;
    padding: 6px 14px 6px 6px; border-radius: 30px; cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.avatar {
    width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff;
}
.user-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + 10px);
    background: #101018; border: 1px solid var(--border-glow); border-radius: 14px;
    min-width: 170px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.6); z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
    display: block; padding: 12px 18px; color: var(--text-secondary);
    text-decoration: none; font-size: 14px; font-weight: 500;
}
.user-dropdown a:hover { background: var(--surface-hover); color: #fff; }

.mobile-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }

/* ---------- Layout ---------- */
.main-container { max-width: 1400px; margin: 0 auto; padding: 0 4%; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin: 36px 0 26px; }
.section-title {
    font-size: 24px; font-weight: 700; letter-spacing: -0.5px;
    display: flex; align-items: center; gap: 12px;
}
.section-title::before {
    content: ''; display: block; width: 4px; height: 24px;
    background: var(--accent-gradient); border-radius: 4px;
}
.see-all { color: var(--accent-solid); text-decoration: none; font-size: 14px; font-weight: 600; }

/* ---------- Hero ---------- */
.hero-banner {
    position: relative; border-radius: 28px; overflow: hidden; margin: 20px 0 40px;
    height: 520px; display: flex; align-items: flex-end;
    background-size: cover; background-position: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6); border: 1px solid var(--border-glow);
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,6,9,0) 0%, rgba(6,6,9,0.4) 40%, #060609 100%); }
.hero-content { position: relative; z-index: 2; padding: 50px; max-width: 700px; }
.badge {
    background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; padding: 6px 16px;
    font-size: 12px; font-weight: 700; border-radius: 30px; text-transform: uppercase;
    letter-spacing: 1px; display: inline-block; margin-bottom: 20px;
}
.hero-title { font-size: 42px; font-weight: 800; line-height: 1.1; margin-bottom: 16px; letter-spacing: -1px; text-shadow: 0 10px 30px rgba(0,0,0,0.8); }
.hero-desc {
    color: var(--text-secondary); font-size: 16px; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 28px; font-weight: 500;
}
.btn-watch {
    display: inline-flex; align-items: center; gap: 10px; background: var(--accent-gradient);
    color: #fff; padding: 14px 32px; border-radius: 50px; text-decoration: none;
    font-weight: 600; font-size: 16px; transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}
.btn-watch:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.5); }

/* ---------- Video Grid ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.video-card {
    background: var(--surface); border: 1px solid var(--border-glow); border-radius: 20px;
    padding: 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); position: relative;
}
.video-card:hover {
    background: var(--surface-hover); transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
}
.thumb-wrapper { position: relative; width: 100%; aspect-ratio: 16/9; background: #111; border-radius: 14px; overflow: hidden; }
.thumb-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.video-card:hover .thumb-wrapper img { transform: scale(1.08); }
.play-icon {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.2); opacity: 0; transition: opacity 0.4s ease;
}
.play-icon .glass-circle {
    width: 60px; height: 60px; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transform: scale(0.8); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.play-icon svg { width: 28px; height: 28px; fill: #fff; margin-left: 4px; }
.video-card:hover .play-icon { opacity: 1; }
.video-card:hover .play-icon .glass-circle { transform: scale(1); }
.card-details { padding: 16px 8px 6px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title {
    font-size: 15.5px; font-weight: 600; line-height: 1.5; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; letter-spacing: -0.2px;
}
.card-meta { margin-top: auto; font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; font-weight: 500; flex-wrap: wrap; }
.card-cat { position: absolute; top: 20px; left: 20px; z-index: 2; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 20px; }

/* ---------- Empty / Alerts ---------- */
.empty-state { text-align: center; padding: 100px 20px; background: var(--surface); border-radius: 24px; border: 1px dashed var(--border-glow); }
.empty-state h3 { font-size: 22px; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: 15px; }
.alert { padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; }
.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #34d399; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0 20px; flex-wrap: wrap; }
.pagination a {
    color: var(--text-secondary); text-decoration: none; padding: 10px 16px;
    border-radius: 12px; background: var(--surface); border: 1px solid var(--border-glow);
    font-size: 14px; font-weight: 600; transition: all 0.2s;
}
.pagination a:hover { color: #fff; border-color: rgba(139, 92, 246, 0.4); }
.pagination a.active { background: var(--accent-gradient); color: #fff; border: none; }

/* ---------- Auth Forms ---------- */
.auth-container { max-width: 440px; margin: 60px auto; }
.auth-card { background: var(--surface); border: 1px solid var(--border-glow); border-radius: 24px; padding: 40px; }
.auth-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.auth-card .sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--border-glow);
    color: #fff; padding: 13px 16px; border-radius: 12px; font-size: 14.5px;
    font-family: inherit; outline: none; transition: all 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent-solid); box-shadow: 0 0 15px rgba(139, 92, 246, 0.15); }
.btn-full {
    width: 100%; background: var(--accent-gradient); color: #fff; border: none;
    padding: 14px; border-radius: 50px; font-size: 15px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
}
.btn-full:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4); }
.auth-switch { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-secondary); }
.auth-switch a { color: var(--accent-solid); text-decoration: none; font-weight: 700; }

/* ---------- Watch Page ---------- */
.watch-container { max-width: 1400px; margin: 0 auto; width: 100%; }
.player-frame-container {
    width: 100%; background: #000; position: relative; aspect-ratio: 16/9;
    max-height: 75vh; border: 1px solid var(--border-glow);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6); border-radius: 20px; overflow: hidden; margin-bottom: 24px;
}
.player-frame-container iframe { width: 100%; height: 100%; border: none; position: absolute; inset: 0; }
.video-details { padding: 0 8px 20px 8px; }
.video-title { font-size: 22px; font-weight: 700; line-height: 1.4; color: #fff; margin-bottom: 12px; letter-spacing: -0.2px; }
.video-meta { font-size: 14px; color: var(--text-secondary); font-weight: 500; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.action-container {
    display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none;
    margin-bottom: 24px; border-bottom: 1px solid var(--border-glow); padding-bottom: 20px;
}
.action-container::-webkit-scrollbar { display: none; }
.pill-btn {
    background: var(--surface); border: 1px solid var(--border-glow); color: #fff;
    padding: 10px 20px; border-radius: 30px; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); flex-shrink: 0; font-family: inherit;
}
.pill-btn:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.15); }
.pill-btn:active { transform: scale(0.96); }
.pill-btn.liked { background: rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.4); color: var(--accent-solid); }
.pill-btn svg { width: 18px; height: 18px; fill: currentColor; }
.description-panel {
    background: var(--surface); border: 1px solid var(--border-glow);
    border-radius: 20px; padding: 20px; font-size: 14.5px; line-height: 1.6;
    color: #d4d4d8; margin-bottom: 32px; word-break: break-word;
}

/* ---------- Comments ---------- */
.comments-section { padding: 0 8px; }
.comments-section .section-header-sm { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 20px; }
.comment-input-box {
    background: var(--surface); border: 1px solid var(--border-glow);
    border-radius: 20px; padding: 18px; margin-bottom: 28px; transition: all 0.3s ease;
}
.comment-input-box:focus-within { border-color: rgba(139, 92, 246, 0.4); box-shadow: 0 0 20px rgba(139, 92, 246, 0.1); }
.c-textarea {
    width: 100%; background: transparent; border: none; color: #fff; font-family: inherit;
    font-size: 14.5px; outline: none; resize: none; min-height: 28px; line-height: 1.5;
}
.c-textarea::placeholder { color: var(--text-secondary); }
.c-form-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
.btn-submit {
    background: var(--text-primary); color: var(--bg-base); border: none; padding: 8px 20px;
    border-radius: 20px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-submit:hover { opacity: 0.9; }
.btn-submit:disabled { opacity: 0.3; cursor: not-allowed; }
.comment-list { display: flex; flex-direction: column; gap: 24px; }
.comment-card { display: flex; gap: 14px; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--surface-elevated);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
    font-size: 14px; flex-shrink: 0; border: 1px solid var(--border-glow);
}
.comment-content { flex-grow: 1; }
.comment-user-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-username { font-size: 14px; font-weight: 700; color: #fff; }
.comment-time { font-size: 12px; color: var(--text-secondary); }
.comment-text { font-size: 14.5px; color: #d4d4d8; line-height: 1.5; margin-bottom: 8px; }
.comment-like-btn {
    background: none; border: none; color: var(--text-secondary); display: inline-flex;
    align-items: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
    transition: color 0.2s; font-family: inherit;
}
.comment-like-btn:hover { color: #fff; }
.comment-like-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Recommendations ---------- */
.sidebar-recommendations { padding: 32px 8px 0 8px; }
.rec-grid { display: flex; flex-direction: column; gap: 16px; }
.rec-card { display: flex; gap: 14px; text-decoration: none; color: inherit; border-radius: 14px; transition: background 0.3s; padding: 8px; margin: -8px; }
.rec-card:hover { background: var(--surface); border-radius: 16px; }
.rec-thumb {
    width: 140px; aspect-ratio: 16/9; background: #111; border-radius: 12px;
    overflow: hidden; flex-shrink: 0; border: 1px solid var(--border-glow); position: relative;
}
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.rec-card:hover .rec-thumb img { transform: scale(1.08); }
.rec-info { display: flex; flex-direction: column; padding-top: 4px; }
.rec-title { font-size: 14.5px; font-weight: 600; color: #fff; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; letter-spacing: -0.2px; }
.rec-meta { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }

@media (min-width: 960px) {
    .watch-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; }
    .sidebar-recommendations { padding: 0; }
}

/* ---------- Category Pills ---------- */
.cat-pills { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin: 20px 0; }
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
    background: var(--surface); border: 1px solid var(--border-glow); color: var(--text-secondary);
    padding: 8px 18px; border-radius: 30px; font-size: 13.5px; font-weight: 600;
    text-decoration: none; white-space: nowrap; flex-shrink: 0; transition: all 0.2s;
}
.cat-pill:hover, .cat-pill.active { color: #fff; border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.12); }

/* ---------- Ads ---------- */
.ad-slot { display: flex; justify-content: center; margin: 20px auto; max-width: 100%; overflow: hidden; }
#vl-popup-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
#vl-popup-box {
    position: relative; background: #101018; border: 1px solid var(--border-glow);
    border-radius: 20px; padding: 32px 24px 24px; max-width: 560px; width: 100%; max-height: 85vh; overflow: auto;
}
#vl-popup-close {
    position: absolute; top: 10px; right: 14px; background: none; border: none;
    color: #fff; font-size: 26px; cursor: pointer; line-height: 1;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-glow); margin-top: 60px; padding: 40px 4% 20px; }
.footer-inner { max-width: 1400px; margin: 0 auto; text-align: center; }
.footer-brand { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.footer-tag { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.footer-links a:hover { color: #fff; }
.footer-copy { color: #52525b; font-size: 12.5px; }

/* ---------- Static Page ---------- */
.static-page { max-width: 800px; margin: 40px auto; background: var(--surface); border: 1px solid var(--border-glow); border-radius: 24px; padding: 40px; }
.static-page h1 { font-size: 30px; margin-bottom: 20px; letter-spacing: -0.5px; }
.static-page .page-content { color: #d4d4d8; line-height: 1.8; font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .nav-links { display: none; }
    .navbar.mobile-open .nav-links { display: flex; flex-direction: column; width: 100%; order: 5; }
    .navbar.mobile-open { flex-wrap: wrap; border-radius: 24px; }
    .mobile-toggle { display: block; }
}
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; gap: 12px; border-radius: 24px; padding: 14px 18px; top: 10px; width: 96%; }
    .search-box { order: 4; max-width: 100%; flex-basis: 100%; }
    .nav-auth { margin-left: auto; }
    .hero-banner { height: 400px; border-radius: 20px; margin-bottom: 30px; }
    .hero-title { font-size: 30px; }
    .hero-content { padding: 30px 20px; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
    .player-frame-container { border-radius: 12px; }
    .auth-card { padding: 28px 22px; }
}
