/* =====================================================
   StreamVibe – Lightweight Professional CSS
   Design: Dark #0d1117 background, Electric Blue #2563eb
   Fonts: Inter (heading) + system-ui (body)
   ===================================================== */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    --bg:           #0d1117;
    --surface:      #161b22;
    --surface2:     #21262d;
    --surface3:     #2d333b;
    --border:       #30363d;
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --text-subtle:  #6e7681;
    --accent:       #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #3b82f6;
    --success:      #10b981;
    --error:        #ef4444;
    --warning:      #f59e0b;
    --radius:       0.5rem;
    --radius-lg:    0.75rem;
    --radius-xl:    1rem;
    --shadow:       0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg:    0 8px 30px rgba(0,0,0,0.5);
    --transition:   0.2s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

/* ---------- Layout Helpers ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(13,17,23,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    height: 64px;
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1rem;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.navbar-brand span { color: var(--accent); }
.navbar-search-form {
    flex: 1;
    max-width: 480px;
    position: relative;
}
.navbar-search-form input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.75rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 2rem;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color var(--transition), background var(--transition);
    outline: none;
}
.navbar-search-form input:focus {
    border-color: var(--accent);
    background: var(--surface);
}
.navbar-search-form .search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.btn-ghost {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); background: var(--surface2); }
.btn-ghost.active { color: var(--accent-light); background: var(--surface2); }
.btn-primary {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-secondary:hover { background: var(--surface3); border-color: var(--text-muted); }
.btn-danger {
    padding: 0.45rem 0.9rem;
    background: rgba(239,68,68,0.1);
    color: var(--error);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    transition: background var(--transition);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-success {
    padding: 0.45rem 0.9rem;
    background: rgba(16,185,129,0.1);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    transition: background var(--transition);
}
.btn-success:hover { background: rgba(16,185,129,0.2); }
.btn-icon {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 1rem;
    transition: color var(--transition), background var(--transition);
}
.btn-icon:hover { color: var(--text); background: var(--surface2); }

/* User Avatar Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem 0.3rem 0.4rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 2rem;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
}
.user-avatar-sm {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface3);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* ---------- Main Content Offset ---------- */
.main-content { padding-top: 64px; min-height: calc(100vh - 64px); }

/* ---------- Alert Messages ---------- */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
}
.alert-error   { background: rgba(239,68,68,0.1); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.alert-success { background: rgba(16,185,129,0.1); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.alert-info    { background: rgba(37,99,235,0.1); color: #93c5fd; border-color: rgba(37,99,235,0.3); }

/* ---------- Hero Section ---------- */
.hero {
    padding: 3rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(37,99,235,0.07) 0%, transparent 100%);
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.75rem;
}
.hero h1 span { color: var(--accent-light); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2rem; }
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.75rem; font-weight: 800; color: var(--text); }
.hero-stat span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Section Headers ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.25em;
    background: var(--accent);
    border-radius: 2px;
}
.section { padding: 2.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ---------- Video Grid ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.video-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    position: relative;
}
.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(37,99,235,0.2);
}
.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--surface2);
}
.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.video-card:hover .video-thumbnail img { transform: scale(1.05); }
.video-thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}
.video-card:hover .video-thumbnail-overlay { opacity: 1; }
.play-btn-overlay {
    width: 52px; height: 52px;
    background: rgba(37,99,235,0.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    transform: scale(0.8);
    transition: transform 0.2s ease;
    padding-left: 4px;
}
.video-card:hover .play-btn-overlay { transform: scale(1); }
.video-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.2rem 0.55rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.video-views-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    padding: 0.2rem 0.5rem;
    background: rgba(0,0,0,0.75);
    color: #fff;
    border-radius: var(--radius);
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.video-info { padding: 0.875rem; }
.video-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    transition: color var(--transition);
}
.video-card:hover .video-info h3 { color: var(--accent-light); }
.video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.video-stats { display: flex; align-items: center; gap: 0.75rem; }
.video-stat-item { display: flex; align-items: center; gap: 0.25rem; }
.video-card-link { position: absolute; inset: 0; z-index: 1; }
.video-actions {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 0.4rem;
}
.video-actions form { display: inline; }
.video-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface2);
    cursor: pointer;
    transition: all var(--transition);
}
.video-action-btn:hover { background: var(--surface3); color: var(--text); border-color: var(--text-muted); }
.video-action-btn.liked { color: var(--success); border-color: var(--success); background: rgba(16,185,129,0.1); }
.video-action-btn.saved { color: var(--accent-light); border-color: var(--accent); background: rgba(37,99,235,0.1); }

/* ---------- Category Filter Bar ---------- */
.category-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
.category-chip {
    padding: 0.35rem 0.9rem;
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.category-chip:hover, .category-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 38px; height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
    padding: 0 0.5rem;
}
.page-btn:hover:not(:disabled):not(.active) { background: var(--surface3); color: var(--text); border-color: var(--text-muted); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.925rem;
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent);
    background: var(--surface);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-subtle); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-select option { background: var(--surface2); color: var(--text); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ---------- Auth Forms ---------- */
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.auth-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.75rem; }
.auth-tabs {
    display: flex;
    background: var(--surface2);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 1.75rem;
}
.auth-tab {
    flex: 1;
    padding: 0.55rem;
    text-align: center;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1;
    border-top: 1px solid var(--border);
}

/* ---------- Panel / Card ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 1.1rem; font-weight: 700; }

/* ---------- Admin Panel ---------- */
.admin-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.75rem; flex-wrap: wrap; }
.admin-tab {
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.admin-tab.active { color: var(--accent-light); border-bottom-color: var(--accent); }
.admin-tab:hover:not(.active) { color: var(--text); }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius);
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Table */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
    padding: 0.75rem 1rem;
    background: var(--surface2);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
tbody td { padding: 0.75rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: var(--surface2); }

/* User list */
.user-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.user-item:last-child { border-bottom: none; }
.user-item-info { flex: 1; min-width: 140px; }
.user-item-name { font-weight: 600; font-size: 0.9rem; }
.user-item-email { font-size: 0.78rem; color: var(--text-muted); }
.user-item-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.user-inline-form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.user-inline-form .form-input { width: auto; min-width: 100px; font-size: 0.8rem; padding: 0.35rem 0.6rem; }

/* ---------- Video Player Page ---------- */
.player-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.75rem; align-items: start; }
.player-main {}
.player-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.custom-player {
    position: relative;
    background: #000;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.25rem;
}
.custom-player video { width: 100%; display: block; }
.player-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: opacity 0.3s;
}
.player-overlay.hidden { opacity: 0; pointer-events: none; }
.player-overlay-thumb {
    position: absolute; inset: 0;
    object-fit: cover;
    width: 100%; height: 100%;
    z-index: 1;
}
.player-overlay-play {
    position: relative; z-index: 2;
    width: 80px; height: 80px;
    background: rgba(37,99,235,0.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.75rem;
    padding-left: 6px;
    box-shadow: 0 4px 24px rgba(37,99,235,0.5);
    transition: transform 0.2s, background 0.2s;
}
.player-overlay-play:hover { background: var(--accent); transform: scale(1.08); }
.player-controls {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 1rem 0.875rem 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3;
}
.custom-player:hover .player-controls { opacity: 1; }
.progress-bar {
    width: 100%; height: 5px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 0.65rem;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    pointer-events: none;
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute; right: -4px; top: -3px;
    width: 10px; height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}
.progress-bar:hover .progress-fill::after { transform: scale(1.3); }
.controls-row { display: flex; align-items: center; gap: 0.6rem; }
.ctrl-btn { color: rgba(255,255,255,0.9); font-size: 1rem; padding: 4px; transition: color 0.2s, transform 0.2s; background: none; border: none; cursor: pointer; }
.ctrl-btn:hover { color: #fff; transform: scale(1.1); }
.volume-slider { width: 70px; height: 4px; background: rgba(255,255,255,0.25); border-radius: 2px; cursor: pointer; position: relative; }
.volume-fill { height: 100%; background: #fff; border-radius: 2px; }
.time-display { color: rgba(255,255,255,0.85); font-size: 0.78rem; white-space: nowrap; flex: 1; }
.speed-menu-wrapper { position: relative; }
.speed-menu {
    position: absolute; bottom: 2.5rem; left: 50%;
    transform: translateX(-50%);
    background: rgba(13,17,23,0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: none;
    min-width: 80px;
    z-index: 10;
}
.speed-menu.open { display: block; }
.speed-opt {
    display: block; width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    background: none; border: none;
}
.speed-opt:hover { background: var(--surface2); color: var(--text); }
.speed-opt.active { color: var(--accent-light); font-weight: 700; }

/* Video Info Box */
.video-info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.video-info-box h1 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); margin-bottom: 0.6rem; }
.video-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.video-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
    padding: 0.2rem 0.6rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.like-dislike-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.like-btn, .dislike-btn, .save-btn, .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    transition: all var(--transition);
    text-decoration: none;
}
.like-btn:hover { background: rgba(16,185,129,0.15); border-color: var(--success); color: var(--success); }
.like-btn.active { background: rgba(16,185,129,0.15); border-color: var(--success); color: var(--success); }
.dislike-btn:hover { background: rgba(239,68,68,0.1); border-color: var(--error); color: var(--error); }
.dislike-btn.active { background: rgba(239,68,68,0.1); border-color: var(--error); color: var(--error); }
.save-btn:hover { background: rgba(37,99,235,0.1); border-color: var(--accent); color: var(--accent-light); }
.save-btn.active { background: rgba(37,99,235,0.1); border-color: var(--accent); color: var(--accent-light); }
.download-btn:hover { background: rgba(245,158,11,0.1); border-color: var(--warning); color: var(--warning); }
.download-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Comments */
.comment-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
}
.comment-input-row { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1.5rem; }
.comment-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: var(--accent-light);
    flex-shrink: 0;
    overflow: hidden;
}
.comment-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.comment-input-area { flex: 1; }
.comment-textarea {
    width: 100%; padding: 0.65rem 0.9rem;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    font-size: 0.9rem; resize: none; outline: none;
    transition: border-color var(--transition);
    min-height: 70px;
    line-height: 1.5;
}
.comment-textarea:focus { border-color: var(--accent); }
.comment-item { display: flex; gap: 0.75rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-content { flex: 1; }
.comment-author { font-size: 0.875rem; font-weight: 700; color: var(--text); margin-bottom: 0.2rem; }
.comment-author span { font-weight: 400; font-size: 0.76rem; color: var(--text-muted); margin-left: 0.5rem; }
.comment-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* Sidebar cards */
.sidebar-heading { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; }
.related-card {
    display: flex;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.6rem;
    transition: border-color var(--transition), transform var(--transition);
    text-decoration: none;
    color: inherit;
}
.related-card:hover { border-color: var(--accent); transform: translateX(2px); color: inherit; }
.related-thumb {
    width: 100px; min-width: 100px;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface2);
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info { flex: 1; min-width: 0; }
.related-title {
    font-size: 0.825rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.related-meta { font-size: 0.74rem; color: var(--text-muted); }

/* ---------- Profile Page ---------- */
.profile-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.75rem; align-items: start; }
.profile-sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    text-align: center;
    position: sticky; top: 80px;
}
.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}
.profile-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    background: var(--surface2);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: var(--accent-light);
    overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-avatar-upload {
    position: absolute; bottom: 0; right: 0;
    width: 30px; height: 30px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.75rem;
    cursor: pointer;
    border: 2px solid var(--bg);
    z-index: 2;
}
.profile-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.25rem; }
.profile-email { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.profile-stats { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 1.25rem; font-weight: 700; }
.profile-stat span { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-bio { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin: 1rem 0; text-align: left; }

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty-state p { font-size: 1rem; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 1rem 0;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--text); }

/* ---------- Toast Notifications ---------- */
#toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: slideInToast 0.3s ease;
    max-width: 320px;
}
.toast-success { background: #064e3b; border: 1px solid var(--success); color: #6ee7b7; }
.toast-error   { background: #7f1d1d; border: 1px solid var(--error); color: #fca5a5; }
@keyframes slideInToast { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Loading Skeleton ---------- */
.skeleton { background: var(--surface2); border-radius: var(--radius); animation: shimmer 1.5s infinite; }
@keyframes shimmer {
    0% { background-color: var(--surface2); }
    50% { background-color: var(--surface3); }
    100% { background-color: var(--surface2); }
}

/* ---------- Search Results Banner ---------- */
.search-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
.footer-brand { font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: 0.75rem; }
.footer-brand span { color: var(--accent); }
.footer-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1rem; }
.footer-col-title { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.875rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--accent-light); }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-subtle);
    flex-wrap: wrap;
    gap: 0.75rem;
}
.footer-social { display: flex; gap: 0.75rem; }
.footer-social a {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-muted); font-size: 0.875rem;
    transition: all var(--transition);
}
.footer-social a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Popup / Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.25s;
    text-align: center;
}
.modal-overlay.open .modal-box { transform: none; }
.modal-icon { font-size: 2.5rem; color: var(--accent-light); margin-bottom: 1rem; }
.modal-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.5rem; }
.modal-desc { color: var(--text-muted); font-size: 0.925rem; margin-bottom: 1.75rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .player-layout { grid-template-columns: 1fr; }
    .player-sidebar { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-sidebar-card { position: static; }
}
@media (max-width: 768px) {
    .navbar-search-form { display: none; }
    .navbar-search-form.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; padding: 0.75rem; background: rgba(13,17,23,0.97); border-bottom: 1px solid var(--border); z-index: 999; }
    .navbar-search-form.open input { border-radius: var(--radius); }
    .menu-toggle { display: flex; }
    #mobileSearchBtn { display: flex !important; }
    .nav-desktop { display: none; }
    .nav-mobile-open .nav-desktop {
        display: flex; flex-direction: column;
        position: absolute; top: 64px; left: 0; right: 0;
        background: rgba(13,17,23,0.97);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        gap: 0.75rem;
    }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .auth-card { padding: 1.5rem; }
    .user-inline-form { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 1.75rem; }
    .video-grid { grid-template-columns: 1fr 1fr; }
    .hero-stats { gap: 1.5rem; }
    .panel { padding: 1.25rem; }
    .modal-actions { flex-direction: column; }
}
@media (max-width: 360px) {
    .video-grid { grid-template-columns: 1fr; }
}

/* ---------- Utility Extras ---------- */
.text-accent { color: var(--accent-light); }
.text-muted  { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error  { color: var(--error); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-0 { padding: 0; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid { display: grid; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.border { border: 1px solid var(--border); }
.opacity-50 { opacity: 0.5; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.whitespace-nowrap { white-space: nowrap; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.leading-relaxed { line-height: 1.7; }

/* Auth card modal scale animation (was missing) */
.modal-overlay .auth-card {
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.25s;
}
.modal-overlay.open .auth-card { transform: none; }

/* =============================================================
   Smart / Keyword Category System — added styles
   ============================================================= */

/* category.php video grid (uses same .video-card but with play overlay) */
.video-card .video-thumb { position: relative; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface2); aspect-ratio: 16/9; }
.video-card .video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.video-card:hover .video-thumb img { transform: scale(1.04); }
.play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.0); transition: background 0.2s; }
.video-card:hover .play-overlay { background: rgba(0,0,0,0.45); }
.play-overlay i { font-size: 2.25rem; color: #fff; opacity: 0; transform: scale(0.7); transition: opacity 0.2s, transform 0.2s; }
.video-card:hover .play-overlay i { opacity: 1; transform: scale(1); }
.video-card .video-info { padding: 0.75rem; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.video-card .video-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.video-card .video-title a { color: var(--text); text-decoration: none; }
.video-card .video-title a:hover { color: var(--accent-light); }
.video-card .video-meta { display: flex; gap: 0.75rem; font-size: 0.75rem; color: var(--text-muted); }

/* Admin panel keyword category table spacing */
.admin-tab-content details summary::-webkit-details-marker { display: none; }
.admin-tab-content details summary::before { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-right: 0.4rem; color: var(--accent); transition: transform 0.2s; display: inline-block; }
.admin-tab-content details[open] summary::before { transform: rotate(-180deg); }

/* Mobile menu drawer */
.mobile-menu { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: rgba(13,17,23,0.97); z-index: 998; overflow-y: auto; padding: 1rem; transform: translateX(-100%); transition: transform 0.25s; }
.mobile-menu.open { display: block; transform: translateX(0); }
.mobile-nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); font-size: 1rem; text-decoration: none; transition: background 0.15s; border-radius: var(--radius); }
.mobile-nav-item:hover, .mobile-nav-item.active { background: var(--surface2); color: var(--accent-light); }

/* Pagination (shared across video grid pages) */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.4rem; flex-wrap: wrap; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem; padding: 0 0.5rem; border-radius: var(--radius); background: var(--surface2); color: var(--text-muted); font-size: 0.875rem; font-weight: 500; border: 1px solid var(--border); text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.page-btn:hover { background: var(--surface3); color: var(--text); border-color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.page-ellipsis { color: var(--text-subtle); padding: 0 0.25rem; }

