/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #222;
    --bg-hover: #2a2a2a;
    --bg-elevated: #2a2a2a;
    --text-primary: #f1f1f1;
    --text-secondary: #aaa;
    --text-muted: #717171;
    --accent: #ff0000;
    --accent-hover: #cc0000;
    --border: #303030;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --header-h: 60px;
    --sidebar-w: 240px;
    --sidebar-collapsed-w: 72px;
    --nav-h: 56px;
    font-size: 14px;
}
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select {
    font: inherit; color: inherit;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    width: 100%;
    outline: none;
    transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-weight: 500; font-size: 14px;
    transition: all .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }
.btn-warning { background: #f39c12; color: #000; }
.btn-upload {
    background: var(--bg-hover); color: var(--text-primary);
    border-radius: 20px; padding: 8px 16px;
    font-size: 14px;
}
.btn-upload:hover { background: var(--bg-elevated); }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(231,76,60,0.15); color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.alert-success { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.text-muted { color: var(--text-muted); }
.text-danger { color: #e74c3c; }
.badge-success { color: #2ecc71; }
.badge-danger { color: #e74c3c; }

/* ===== AUTH PAGES ===== */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-primary); }
.auth-container { width: 100%; max-width: 400px; padding: 20px; }
.auth-card {
    background: var(--bg-secondary); border-radius: var(--radius);
    padding: 40px 30px; text-align: center;
    border: 1px solid var(--border);
}
.auth-logo { margin-bottom: 8px; }
.auth-logo i { font-size: 48px; color: var(--accent); }
.auth-logo h1 { font-size: 28px; margin-top: 8px; }
.auth-tagline { color: var(--text-secondary); margin-bottom: 24px; }
.auth-form .form-group { margin-bottom: 14px; }
.auth-form .btn { margin-top: 8px; }
.auth-link { margin-top: 20px; color: var(--text-secondary); }
.auth-link a { color: var(--accent); }
.auth-link a:hover { text-decoration: underline; }

/* ===== HEADER ===== */
.main-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg-secondary);
    display: flex; align-items: center;
    padding: 0 16px;
    gap: 16px;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 160px; }
.sidebar-toggle {
    font-size: 20px; padding: 8px;
    border-radius: 50%; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-toggle:hover { background: var(--bg-hover); }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.logo i { color: var(--accent); font-size: 28px; }
.header-center { flex: 1; max-width: 600px; margin: 0 auto; }
.search-bar { position: relative; }
.search-bar .search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 14px;
}
.search-bar input {
    padding-left: 40px; padding-right: 36px;
    background: var(--bg-primary); border-radius: 20px;
    border: 1px solid var(--border);
    height: 40px;
}
.search-bar input:focus { border-color: #555; }
.search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; padding: 6px; color: var(--text-muted); }
.search-clear.show { display: block; }
.search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-elevated); border-radius: var(--radius-sm);
    border: 1px solid var(--border); margin-top: 4px;
    display: none; z-index: 100;
    max-height: 400px; overflow-y: auto;
}
.search-suggestions.show { display: block; }
.search-suggestion { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; }
.search-suggestion:hover { background: var(--bg-hover); }
.search-suggestion img { width: 40px; height: 28px; object-fit: cover; border-radius: 4px; }
.search-suggestion .suggestion-title { font-size: 13px; }
.search-suggestion .suggestion-views { font-size: 12px; color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-icon { position: relative; padding: 8px; border-radius: 50%; font-size: 20px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.header-icon:hover { background: var(--bg-hover); }
.header-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.notif-badge {
    position: absolute; top: 4px; right: 4px;
    background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; padding: 0 4px;
}

/* ===== DROPDOWNS ===== */
.notif-dropdown, .profile-dropdown {
    position: absolute; top: 100%; right: 0;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); width: 320px;
    display: none; z-index: 1001;
    box-shadow: var(--shadow);
}
.profile-dropdown { width: 220px; }
.notif-dropdown.show, .profile-dropdown.show { display: block; }
.notif-header { padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; align-items: flex-start; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(255,0,0,0.05); }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-body p { font-size: 13px; }
.notif-body small { font-size: 12px; color: var(--text-muted); }
.notif-empty { padding: 30px; text-align: center; color: var(--text-muted); }
.notif-mark-read { display: block; padding: 10px 16px; text-align: center; font-size: 13px; color: var(--accent); border-top: 1px solid var(--border); }
.dropdown-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 14px; }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    overflow-y: auto;
    z-index: 900;
    padding: 8px 0;
    border-right: 1px solid var(--border);
    transition: transform .3s;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-item {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 24px;
    font-size: 14px;
    transition: background .2s;
}
.sidebar-item:hover { background: var(--bg-hover); }
.sidebar-item.active { background: var(--bg-hover); font-weight: 600; }
.sidebar-item i { font-size: 20px; width: 24px; text-align: center; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 16px; }
.sidebar-label { padding: 8px 24px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.sidebar-footer { padding: 16px 24px; font-size: 12px; color: var(--text-muted); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 899; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-top: var(--header-h);
    margin-left: var(--sidebar-w);
    min-height: calc(100vh - var(--header-h));
    padding: 20px 24px;
    padding-bottom: calc(20px + var(--nav-h));
}
.main-content.no-sidebar { margin-left: 0; }

/* ===== HOMEPAGE ===== */
.hero-card { display: block; margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; position: relative; }
.hero-thumb { position: relative; aspect-ratio: 16/9; max-height: 400px; overflow: hidden; }
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 60px; height: 60px; background: rgba(0,0,0,0.7);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
}
.hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 40px 20px 16px;
}
.hero-overlay h2 { font-size: 22px; margin-bottom: 6px; }
.hero-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); }

.category-pills {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.pill {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: var(--bg-hover);
    border-radius: 20px; white-space: nowrap;
    font-size: 13px; transition: background .2s;
}
.pill:hover { background: var(--bg-elevated); }

.video-section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 4px; }
.section-header h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.section-subtitle { font-size: 13px; color: var(--text-muted); }
.section-link { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-link:hover { color: var(--accent); }

/* Category rows */
.category-row { margin-bottom: 24px; }
.category-row-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.category-row-header h3 {
    font-size: 16px; display: flex; align-items: center; gap: 6px;
}
.ad-category-gap { margin-bottom: 24px; margin-top: -8px; }
.ad-category-gap .ad-placeholder { margin-bottom: 0; }

/* Horizontal category row */
.horizontal-scroll {
    display: grid; grid-auto-flow: column; grid-auto-columns: 200px;
    gap: 14px; overflow-x: auto; padding-bottom: 4px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.horizontal-scroll::-webkit-scrollbar { height: 4px; }
.horizontal-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.card-scroll { scroll-snap-align: start; }

/* ===== VIDEO GRID ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.video-card {
    cursor: pointer; border-radius: var(--radius-sm);
    overflow: hidden; transition: transform .2s;
}
.video-card:hover { transform: translateY(-2px); }
.video-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-card); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-duration {
    position: absolute; bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.8); color: #fff;
    font-size: 12px; padding: 2px 6px; border-radius: 4px;
}
.video-status {
    position: absolute; top: 6px; right: 6px;
    font-size: 11px; padding: 2px 8px; border-radius: 4px;
    background: rgba(0,0,0,0.8);
}
.video-status.pending { color: #f39c12; }
.video-status.approved { color: #2ecc71; }
.video-status.rejected { color: #e74c3c; }
.video-info { padding: 10px 4px; }
.video-info h3 { font-size: 14px; font-weight: 500; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.video-author { color: var(--text-secondary); }

.load-more-wrap { text-align: center; margin-top: 20px; }

/* ===== WATCH PAGE ===== */
.watch-layout { display: flex; gap: 24px; }
.watch-main { flex: 1; min-width: 0; max-width: 100%; }
.watch-sidebar { width: 350px; flex-shrink: 0; }
.video-player-wrap {
    aspect-ratio: 16/9; background: #000;
    border-radius: var(--radius-sm); overflow: hidden;
    margin-bottom: 16px;
}
.video-player-wrap iframe { width: 100%; height: 100%; border: 0; }
.video-player-wrap.is-facebook {
    background: #000; border-radius: var(--radius-sm); margin-bottom: 16px;
    aspect-ratio: unset; overflow: visible; height: auto; min-height: 250px;
}
.video-player-wrap.is-facebook .fb-video { width: 100% !important; }

/* Ads */
.ad-label { font-size: 11px; color: var(--text-muted); text-align: center; padding: 4px 0; }
.ad-placeholder {
    background: var(--bg-hover); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 13px;
    margin-bottom: 16px;
}
.ad-728 { height: 90px; }
.ad-300 { height: 250px; }

/* Header Ad */
.ad-header { margin-bottom: 20px; }
.ad-desktop { height: 90px; margin-bottom: 0; }
.ad-mobile-header { height: 50px; margin-bottom: 0; display: none; }
.ad-header .ad-label { margin-bottom: 4px; }
.ad-mobile-320 { height: 50px; display: none; margin-bottom: 0; }
.ad-native-banner { height: 120px; }
.ad-infeed { margin-bottom: 24px; }
.ad-banner-top { margin-bottom: 16px; }
.ad-socialbar { display: none; margin-bottom: 16px; }
.ad-sidebar { margin-bottom: 16px; }

/* Video Info */
.video-info-section { margin-bottom: 24px; }
.video-title { font-size: 20px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.video-actions-row {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.video-stats-row { font-size: 14px; color: var(--text-secondary); display: flex; gap: 12px; }
.video-actions { display: flex; gap: 8px; }
.action-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 20px;
    background: var(--bg-hover); font-size: 14px;
    transition: background .2s;
}
.action-btn:hover { background: var(--bg-elevated); }
.action-btn.active { background: rgba(255,0,0,0.15); color: var(--accent); }

.creator-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-top: 1px solid var(--border);
    margin-bottom: 12px;
}
.creator-info { display: flex; align-items: center; gap: 12px; }
.creator-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.video-description {
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 12px 16px; font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ===== SIDEBAR ===== */
.sidebar-title { font-size: 16px; margin-bottom: 12px; }
.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-card { display: flex; gap: 8px; }
.related-thumb { width: 168px; height: 94px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info h4 { font-size: 13px; font-weight: 500; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-info span { display: block; font-size: 12px; color: var(--text-muted); }

/* ===== COMMENTS ===== */
.comments-section { margin-top: 24px; }
.comments-title { font-size: 18px; margin-bottom: 16px; }
.comment-form { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-input-wrap { flex: 1; }
.comment-input-wrap textarea {
    background: transparent; border: none; border-bottom: 1px solid var(--border);
    border-radius: 0; padding: 8px 0; min-height: auto; margin-bottom: 8px;
}
.comment-input-wrap textarea:focus { border-bottom-color: var(--accent); }
.comment-login-msg { padding: 20px 0; font-size: 14px; color: var(--text-muted); }
.comment-login-msg a { color: var(--accent); }
.comment { display: flex; gap: 12px; margin-bottom: 16px; }
.comment-body p { font-size: 14px; margin-bottom: 4px; }
.comment-actions { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--text-muted); }
.comment-reply-btn { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.comment-reply-btn:hover { color: var(--text-primary); }
.comment.reply { margin-left: 48px; }

/* ===== MOBILE COMMENTS SHEET ===== */
.desktop-only { display: block; }
.mobile-only { display: none; }
.comments-preview { cursor: pointer; }
.comments-preview .comments-list { max-height: none; }
.comments-preview .comments-list .comment:not(:first-child) { display: none; }
.view-all-btn { width: 100%; margin-top: 8px; }
.add-comment-btn { width: 100%; margin-top: 8px; }
.comments-sheet-overlay {
    display: none; position: fixed; inset: 0; z-index: 9998;
    background: rgba(0,0,0,0.5);
}
.comments-sheet {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: var(--bg-secondary); border-radius: 16px 16px 0 0;
    max-height: 90vh; display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform .3s ease;
}
.comments-sheet.open { transform: translateY(0); }
.comments-sheet.open + .comments-sheet-overlay { display: block; }
.sheet-header {
    display: flex; align-items: center; gap: 12px; padding: 16px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
    background: var(--bg-secondary); border-radius: 16px 16px 0 0;
}
.sheet-close-btn {
    background: none; border: none; color: var(--text-primary);
    font-size: 20px; cursor: pointer; padding: 4px;
}
.sheet-title { flex: 1; font-size: 16px; }
.sheet-sort { display: flex; gap: 4px; }
.sort-btn {
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    padding: 4px 14px; border-radius: 16px; font-size: 13px; cursor: pointer;
    transition: all .2s;
}
.sort-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sheet-body {
    flex: 1; overflow-y: auto; padding: 16px;
    -webkit-overflow-scrolling: touch;
}
.sheet-loading { text-align: center; color: var(--text-muted); padding: 40px 0; }
.sheet-footer {
    display: flex; gap: 12px; align-items: center;
    padding: 12px 16px; border-top: 1px solid var(--border);
    background: var(--bg-secondary); flex-shrink: 0;
}
.sheet-footer .comment-input-wrap { flex: 1; }
.sheet-footer .comment-input-wrap textarea { margin-bottom: 0; }

/* ===== MOBILE RELATED VIDEOS ===== */
.mobile-related-section h3 { font-size: 18px; margin-bottom: 12px; }
.mobile-related-scroll {
    display: flex; overflow-x: auto; gap: 12px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
.mobile-related-scroll::-webkit-scrollbar { height: 3px; }
.mobile-related-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.mobile-related-card {
    min-width: 85vw; max-width: 85vw; flex-shrink: 0;
    scroll-snap-align: start; text-decoration: none; color: inherit;
    display: flex; gap: 12px;
}
.mobile-related-thumb {
    width: 160px; height: 90px; flex-shrink: 0;
    border-radius: var(--radius-sm); overflow: hidden;
}
.mobile-related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mobile-related-info { flex: 1; min-width: 0; }
.mobile-related-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mobile-related-info span { display: block; font-size: 12px; color: var(--text-muted); }

/* ===== UPLOAD PAGE ===== */
.upload-page { max-width: 640px; margin: 0 auto; }
.upload-container { padding: 20px 0; }
.upload-title { font-size: 24px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.upload-subtitle { color: var(--text-muted); margin-bottom: 24px; }
.upload-form .form-group { margin-bottom: 18px; }
.upload-form label { display: block; font-weight: 500; margin-bottom: 6px; }
.video-preview {
    display: flex; gap: 16px; align-items: center;
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 16px; margin-bottom: 18px;
}
.video-preview img { width: 160px; height: 90px; object-fit: cover; border-radius: 6px; }
.preview-info strong { display: block; margin-bottom: 4px; }
.preview-info span { font-size: 13px; color: var(--text-muted); }

/* ===== SHORTS ===== */
.shorts-container {
    height: calc(100vh - var(--header-h) - var(--nav-h));
    overflow: hidden; position: relative;
    margin: -20px -24px;
}
.shorts-viewport {
    height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}
.short-card {
    height: 100%; scroll-snap-align: start;
    position: relative; display: flex; align-items: center; justify-content: center;
    background: #000;
}
.short-player {
    position: absolute; inset: 0;
}
.short-player iframe { width: 100%; height: 100%; }
.short-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 60px 16px 20px;
    display: flex; justify-content: space-between; align-items: flex-end;
}
.short-info { flex: 1; }
.short-title { font-size: 16px; font-weight: 600; display: block; margin-bottom: 4px; }
.short-creator { font-size: 13px; color: var(--text-secondary); }
.short-actions { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.short-action-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; font-size: 12px; color: #fff;
}
.short-action-btn i {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.short-sponsored {
    height: 100%; scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--bg-primary); gap: 12px;
}

/* ===== SEARCH ===== */
.search-header { margin-bottom: 20px; }
.search-header h1 { font-size: 20px; }
.search-header span { color: var(--text-muted); font-size: 14px; }

/* ===== CATEGORY PAGE ===== */
.category-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-left: 16px; }
.category-header i { font-size: 32px; }
.category-header h1 { font-size: 24px; }

/* ===== PROFILE PAGE ===== */
.profile-header { margin-bottom: 24px; }
.profile-cover {
    height: 200px; background: var(--bg-card);
    border-radius: var(--radius-sm);
    position: relative;
    background-size: cover; background-position: center;
    margin-bottom: -48px;
}
.profile-cover:not([style*="url"]) {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
}
.cover-edit-btn {
    position: absolute; bottom: 12px; right: 12px;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: background .2s;
}
.cover-edit-btn:hover { background: rgba(0,0,0,0.8); }
.profile-avatar-wrap {
    position: relative; width: 96px; height: 96px;
    margin-left: 24px; z-index: 1;
}
.profile-avatar {
    width: 96px; height: 96px; border-radius: 50%;
    border: 4px solid var(--bg-primary);
    object-fit: cover; display: block;
}
.avatar-edit-btn {
    position: absolute; bottom: 4px; right: 4px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent); color: #fff; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: background .2s; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.avatar-edit-btn:hover { background: var(--accent-hover); }
.profile-info { padding: 52px 16px 16px; }
.profile-info h1 { font-size: 24px; margin-bottom: 4px; }
.profile-bio { color: var(--text-secondary); margin-bottom: 12px; }
.profile-stats { display: flex; gap: 20px; margin-bottom: 12px; font-size: 14px; color: var(--text-secondary); }
.profile-stats strong { color: var(--text-primary); }
.profile-followers { margin-bottom: 24px; }
.profile-followers h3 { font-size: 16px; margin-bottom: 12px; }
.follower-avatars { display: flex; gap: 8px; }
.follower-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.profile-videos h3 { font-size: 18px; margin-bottom: 16px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: .5; }

/* ===== ERROR PAGE ===== */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.error-content { text-align: center; }
.error-content i { font-size: 64px; color: var(--text-muted); margin-bottom: 16px; }
.error-content h1 { font-size: 72px; font-weight: 800; }
.error-content p { font-size: 18px; color: var(--text-muted); margin-bottom: 24px; }

/* ===== ADMIN ===== */
.admin-page { max-width: 1200px; }
.admin-header {
    margin-bottom: 28px; padding: 24px 0 0;
    border-bottom: 1px solid var(--border); padding-bottom: 20px;
}
.admin-header h1 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.admin-header h1 i { color: var(--accent); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 20px; display: flex; align-items: center; gap: 16px;
    transition: transform .15s, box-shadow .15s;
    position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-card .stat-icon.users { background: rgba(52,152,219,0.15); color: #3498db; }
.stat-card .stat-icon.videos { background: rgba(46,204,113,0.15); color: #2ecc71; }
.stat-card .stat-icon.views { background: rgba(155,89,182,0.15); color: #9b59b6; }
.stat-card .stat-icon.pending { background: rgba(243,156,18,0.15); color: #f39c12; }
.stat-card .stat-body strong { display: block; font-size: 24px; line-height: 1.2; }
.stat-card .stat-body span { font-size: 13px; color: var(--text-muted); }
.admin-section {
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 20px; margin-bottom: 24px;
}
.admin-section h2 {
    font-size: 16px; margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.admin-section h2 .badge {
    margin-left: auto; background: var(--accent); color: #fff;
    font-size: 12px; padding: 2px 10px; border-radius: 12px;
    font-weight: 600;
}
.admin-table-wrap { overflow-x: auto; margin: 0 -20px 0; padding: 0 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border); }
.admin-table th { font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.admin-table tr:hover { background: var(--bg-hover); }
.admin-thumb { width: 80px; height: 45px; object-fit: cover; border-radius: 4px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-badge {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: 12px; font-weight: 600;
}
.admin-badge.active { background: rgba(46,204,113,0.15); color: #2ecc71; }
.admin-badge.banned { background: rgba(231,76,60,0.15); color: #e74c3c; }
.admin-badge.pending { background: rgba(243,156,18,0.15); color: #f39c12; }
.admin-badge.approved { background: rgba(46,204,113,0.15); color: #2ecc71; }
.admin-badge.rejected { background: rgba(231,76,60,0.15); color: #e74c3c; }
.admin-source { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.text-muted { color: var(--text-muted); }
@media(max-width:768px){
    .admin-stats { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 18px; }
    .stat-card .stat-body strong { font-size: 20px; }
    .admin-section { padding: 14px; }
    .admin-table th, .admin-table td { padding: 8px 8px; font-size: 13px; }
    .admin-thumb { width: 60px; height: 34px; }
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--nav-h); background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: none; align-items: center; justify-content: space-around;
    z-index: 1000;
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; font-size: 10px; color: var(--text-muted);
    padding: 4px 12px;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item.upload-nav i {
    font-size: 32px; color: var(--accent);
    margin-top: -8px;
}

/* ===== ADMIN REPORTS STAT ===== */
.stat-icon.reports { background: rgba(231,76,60,0.15); }
.stat-icon.reports i { color: #e74c3c; }

.admin-badge.approved { background: rgba(46,204,113,0.2); color: #2ecc71; }
.admin-badge.pending { background: rgba(243,156,18,0.2); color: #f39c12; }
.admin-badge.rejected { background: rgba(231,76,60,0.2); color: #e74c3c; }

/* ===== REPORT MODAL ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.7); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--card); border-radius: 12px; padding: 30px;
    max-width: 480px; width: 90%; position: relative;
}
.modal-close {
    position: absolute; top: 12px; right: 16px; background: none; border: none;
    color: var(--text-muted); font-size: 24px; cursor: pointer;
}
.modal-box h3 { margin: 0 0 8px; color: var(--text); }
.modal-desc { color: var(--text-muted); margin-bottom: 16px; font-size: 14px; }
.modal-box textarea {
    width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); resize: vertical; font-family: inherit;
    margin-bottom: 16px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
#reportFeedback { margin-top: 12px; }
.error-msg { color: #e74c3c; font-size: 13px; }
.success-msg { color: #2ecc71; font-size: 13px; }
.btn-outline {
    background: transparent; border: 1px solid var(--border); color: var(--text);
}
.btn-outline:hover { background: var(--border); }

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.form-group textarea {
    width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-secondary); color: var(--text-primary); resize: vertical; font-family: inherit;
    font-size: 14px;
}
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.char-count { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: block; }
.upload-preview { position: relative; border-radius: 6px; overflow: hidden; background: var(--bg-card); }
.upload-btn {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
    font-size: 13px; display: flex; align-items: center; gap: 6px;
    transition: background .2s;
}
.upload-btn:hover { background: rgba(0,0,0,0.8); }
.avatar-upload-preview {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.avatar-upload-preview img {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--border);
}
.btn-sm { padding: 6px 14px; font-size: 13px; }

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
    .watch-layout { flex-direction: column; }
    .watch-sidebar { width: 100%; }
    .related-list { flex-direction: row; overflow-x: auto; }
    .related-card { flex-direction: column; min-width: 180px; }
    .related-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
}
@media (max-width: 768px) {
    .main-header { padding: 0 12px; }
    .header-left .logo span { display: none; }
    .header-right .btn-upload span { display: none; }
    .bottom-nav { display: flex; }
    .main-content { padding: 12px 12px; padding-bottom: calc(12px + var(--nav-h)); }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .video-info h3 { font-size: 13px; }
    .hero-overlay h2 { font-size: 18px; }
    .ad-728 { display: none; }
    .ad-desktop { display: none; }
    .ad-mobile-header { display: flex; }
    .ad-mobile-320 { display: flex; }
    .ad-socialbar { display: block; }
    .watch-sidebar { display: none; }
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
}
@media (max-width: 480px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .shorts-container { margin: -12px -12px; height: calc(100vh - var(--header-h) - var(--nav-h)); }
    .comment-form { flex-direction: column; }
    .auth-card { padding: 30px 20px; }
    .earnings-video-cell a { flex-direction: column; align-items: flex-start; }
    .earnings-video-cell img { width: 100%; height: auto; aspect-ratio: 16/9; }
}

/* ===== EARNINGS PAGE ===== */
.earnings-page { max-width: 1100px; margin: 0 auto; }
.earnings-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 24px; }
.earnings-header h1 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.earnings-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (max-width: 768px) { .earnings-stats { grid-template-columns: repeat(2, 1fr); } }
.earnings-stats .stat-body strong { color: #2ecc71; }
.stat-icon.total { background: rgba(46,204,113,0.15); }
.stat-icon.total i { color: #2ecc71; }
.stat-icon.available { background: rgba(52,152,219,0.15); }
.stat-icon.available i { color: #3498db; }
.stat-icon.pending-bal { background: rgba(243,156,18,0.15); }
.stat-icon.pending-bal i { color: #f39c12; }
.stat-icon.paid { background: rgba(155,89,182,0.15); }
.stat-icon.paid i { color: #9b59b6; }

/* Earnings Section */
.earnings-section { background: var(--card); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.earnings-section h2 { font-size: 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }

/* Withdraw Form */
.withdraw-form .form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.withdraw-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.withdraw-form label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.withdraw-form input, .withdraw-form select { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.withdraw-form .form-actions { display: flex; gap: 10px; }
#withdrawFeedback { margin-top: 12px; }

/* Earnings Table */
.earnings-table-wrap { overflow-x: auto; }
.earnings-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.earnings-table th, .earnings-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.earnings-table th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.earnings-table tr:hover { background: var(--bg-hover); }
.earnings-video-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.earnings-video-link img { width: 100px; height: 56px; object-fit: cover; border-radius: 6px; }
.earnings-video-link span { font-weight: 500; }

/* ===== SETTINGS FORM (Admin) ===== */
.settings-form .form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-bottom: 10px; }
.settings-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.settings-form label { font-size: 14px; color: var(--text); font-weight: 500; }
.settings-form input, .settings-form select { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.settings-form small { font-size: 12px; color: var(--text-muted); }
.settings-form .form-actions { margin-top: 20px; }
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.filter-form .form-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.filter-form .form-group { display: flex; flex-direction: column; gap: 4px; }
.filter-form label { font-size: 13px; color: var(--text-muted); }
.filter-form input { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.input-sm { padding: 6px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; width: 120px; }

/* ===== ADMIN NAV ===== */
.admin-nav { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-nav a { padding: 8px 16px; border-radius: 8px; background: var(--card); color: var(--text); text-decoration: none; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.admin-nav a:hover, .admin-nav a.active { background: var(--accent); color: #fff; }

/* ===== SUBSCRIBE / BELL ===== */
.subscribe-wrap { display: flex; align-items: center; gap: 6px; }
.btn-subscribe {
    background: #c00; color: #fff; font-weight: 600;
    padding: 8px 18px; border: none; border-radius: 20px;
    font-size: 14px; cursor: pointer; transition: all .2s;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-subscribe:hover { background: #8b0000; }
.btn-subscribed {
    background: rgba(255,255,255,0.08); color: #fff; font-weight: 600;
    padding: 8px 18px; border: 1px solid rgba(255,255,255,0.2); border-radius: 20px;
    font-size: 14px; cursor: pointer; transition: all .2s;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-subscribed:hover { background: rgba(255,255,255,0.15); }
.bell-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s; font-size: 16px;
    background: rgba(255,255,255,0.08); color: #fff;
}
.bell-btn:hover { background: rgba(255,255,255,0.18); }
.bell-on { color: #fff; }
.bell-on i { color: #fff; }
.bell-off { color: rgba(255,255,255,0.5); }
.bell-off i { color: rgba(255,255,255,0.5); }
.sub-count { display: block; font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: -2px; }
