/* ============================================================
   ViewTube - Main Stylesheet
   YouTube-inspired Light Theme
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-2:        #f9f9f9;
  --bg-3:        #f0f0f0;
  --surface:     #ffffff;
  --border:      #e5e5e5;
  --text:        #0f0f0f;
  --text-2:      #606060;
  --text-3:      #aaaaaa;
  --accent:      #ff0000;
  --accent-dark: #cc0000;
  --accent-soft: #fff0f0;
  --blue:        #065fd4;
  --navbar-h:    56px;
  --sidebar-w:   240px;
  --sidebar-mini:72px;
  --radius:      8px;
  --radius-sm:   4px;
  --shadow:      0 1px 4px rgba(0,0,0,.1);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
  --trans:       .18s ease;
  --font:        'Roboto', sans-serif;
}

[data-theme="dark"] {
  --bg:      #0f0f0f;
  --bg-2:    #1a1a1a;
  --bg-3:    #272727;
  --surface: #212121;
  --border:  #3d3d3d;
  --text:    #f1f1f1;
  --text-2:  #aaaaaa;
  --text-3:  #717171;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
ul { list-style: none; }
hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--navbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
}
.navbar-left  { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.navbar-center { flex: 1; max-width: 680px; margin: 0 auto; display: flex; gap: 8px; }
.navbar-right  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

.logo { display: flex; align-items: center; gap: 2px; padding: 0 8px; }
.logo-img { height: 28px; }
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.logo-accent { color: var(--accent); }

.btn-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text);
  transition: background var(--trans);
  position: relative;
}
.btn-icon:hover { background: var(--bg-3); }

/* Search */
.search-bar { display: flex; flex: 1; gap: 4px; }
.search-input-wrap {
  display: flex; flex: 1;
  border: 1px solid var(--border);
  border-radius: 40px;
  overflow: hidden;
  background: var(--bg);
}
.search-input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.search-input-wrap input {
  flex: 1; border: none; outline: none;
  padding: 8px 16px; font-size: 16px;
  background: transparent; color: var(--text);
}
.search-btn {
  width: 64px; background: var(--bg-3);
  border-left: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-2);
  transition: background var(--trans);
}
.search-btn:hover { background: var(--bg-2); }
.search-voice-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-3); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--trans);
}
.search-voice-btn:hover { background: var(--bg-2); }

.btn-upload {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 20px;
  background: var(--bg-3); color: var(--text);
  font-size: 14px; font-weight: 500;
  transition: background var(--trans);
}
.btn-upload:hover { background: var(--border); }
.btn-signin {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--blue);
  font-size: 14px; font-weight: 500;
  transition: background var(--trans);
}
.btn-signin:hover { background: #e8f0fe; }

/* Badge */
.badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 10px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* User avatar dropdown */
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-menu-wrap, .notif-wrap { position: relative; }
.user-dropdown, .notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 230px; z-index: 200;
  display: none; overflow: hidden;
}
.user-dropdown.open, .notif-dropdown.open { display: block; animation: fadeDown .15s ease; }
.user-dropdown-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.user-dropdown-header img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.user-dropdown-header strong { display: block; font-size: 14px; }
.user-dropdown-header small { color: var(--text-2); font-size: 12px; }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; font-size: 14px; color: var(--text);
  width: 100%; text-align: left;
  transition: background var(--trans);
}
.user-dropdown a:hover { background: var(--bg-3); }
.user-dropdown i { width: 20px; text-align: center; color: var(--text-2); }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--navbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w); overflow-y: auto; overflow-x: hidden;
  background: var(--bg); z-index: 900;
  transition: transform var(--trans), width var(--trans);
  padding: 8px 0 80px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar.collapsed { width: var(--sidebar-mini); }
.sidebar.collapsed .sidebar-item span,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-signin-box { display: none; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 12px; border-radius: var(--radius); margin: 2px 8px; }

.sidebar-item {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px; color: var(--text); font-size: 14px;
  font-weight: 400; transition: background var(--trans);
  border-radius: 10px; margin: 2px 8px;
}
.sidebar-item:hover { background: var(--bg-3); }
.sidebar-item.active { background: var(--bg-3); font-weight: 500; }
.sidebar-item i { width: 24px; text-align: center; font-size: 16px; flex-shrink: 0; }

.sidebar-label {
  padding: 4px 24px; font-size: 13px; font-weight: 500;
  color: var(--text-2); margin-top: 4px;
}
.sidebar-divider { margin: 8px 12px; }
.sidebar-footer { padding: 12px 24px; font-size: 11px; color: var(--text-3); }

.sidebar-signin-box {
  margin: 8px 16px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--text-2);
}
.sidebar-signin-box p { margin-bottom: 10px; }
.btn-signin-small {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--blue); color: var(--blue);
  font-size: 13px; font-weight: 500;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-top: var(--navbar-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--navbar-h));
  transition: margin-left var(--trans);
  padding: 24px;
}
.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-mini); }

/* ── Video Grid ──────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.video-card { cursor: pointer; }
.video-thumb-wrap {
  position: relative; padding-top: 56.25%;
  border-radius: var(--radius); overflow: hidden; background: var(--bg-3);
}
.video-thumb-wrap img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .3s ease;
}
.video-card:hover .video-thumb-wrap img { transform: scale(1.03); }
.video-duration {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.8); color: #fff;
  font-size: 12px; font-weight: 500; padding: 2px 5px;
  border-radius: 3px;
}
.video-progress {
  position: absolute; bottom: 0; left: 0;
  height: 3px; background: var(--accent);
}
.video-info { display: flex; gap: 10px; padding: 10px 0 4px; }
.channel-thumb {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.video-meta { flex: 1; min-width: 0; }
.video-title {
  font-size: 14px; font-weight: 500; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4; margin-bottom: 4px;
}
.video-channel {
  font-size: 13px; color: var(--text-2);
  display: flex; align-items: center; gap: 4px;
}
.video-channel .verified { color: var(--text-3); font-size: 11px; }
.video-stats { font-size: 13px; color: var(--text-2); }

/* Category Chips */
.category-chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 12px; margin-bottom: 16px;
  scrollbar-width: none;
}
.category-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px;
  border-radius: 20px; font-size: 14px; font-weight: 500;
  background: var(--bg-3); color: var(--text);
  border: none; cursor: pointer; transition: background var(--trans);
}
.chip:hover, .chip.active { background: var(--text); color: var(--bg); }

/* ── Video Player Page ───────────────────────────────────── */
.watch-layout { display: flex; gap: 24px; align-items: flex-start; }
.watch-main { flex: 1; min-width: 0; }
.watch-sidebar { width: 400px; flex-shrink: 0; }

/* Player wrapper */
.player-wrap {
  position: relative; padding-top: 56.25%;
  background: #000; border-radius: var(--radius);
  overflow: hidden;
}
.player-wrap video {
  position: absolute; inset: 0; width: 100%; height: 100%;
}

/* Custom Player Controls */
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  padding: 32px 12px 8px;
  opacity: 0; transition: opacity .2s;
}
.player-wrap:hover .player-controls,
.player-wrap.paused .player-controls { opacity: 1; }

.player-progress { position: relative; margin-bottom: 6px; }
.player-progress input[type=range] {
  width: 100%; height: 4px; cursor: pointer;
  -webkit-appearance: none; background: rgba(255,255,255,.3);
  border-radius: 4px; outline: none;
}
.player-progress input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: var(--accent); border-radius: 50%;
}
.player-btns { display: flex; align-items: center; gap: 4px; }
.player-btn {
  color: #fff; font-size: 18px; padding: 6px;
  background: none; border: none; cursor: pointer;
  opacity: .9; transition: opacity .15s;
}
.player-btn:hover { opacity: 1; }
.player-time { color: #fff; font-size: 13px; margin: 0 8px; white-space: nowrap; }
.player-volume { display: flex; align-items: center; gap: 4px; }
.player-volume input[type=range] {
  width: 70px; height: 3px; -webkit-appearance: none;
  background: rgba(255,255,255,.4); border-radius: 3px;
}
.player-volume input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
}
.player-spacer { flex: 1; }
.player-quality-menu {
  position: relative;
}
.quality-list {
  display: none; position: absolute; bottom: 100%; right: 0;
  background: rgba(28,28,28,.95); border-radius: 6px;
  overflow: hidden; min-width: 90px;
}
.quality-list.open { display: block; }
.quality-list button {
  display: block; width: 100%; padding: 8px 14px;
  color: #fff; text-align: left; font-size: 13px;
  background: none; border: none; cursor: pointer;
}
.quality-list button:hover, .quality-list button.active { background: rgba(255,255,255,.15); }

/* Ad overlay */
.ad-overlay {
  position: absolute; inset: 0; z-index: 20;
  background: #000; display: flex; align-items: center;
}
.ad-overlay video { width: 100%; height: 100%; }
.ad-skip-btn {
  position: absolute; bottom: 60px; right: 16px;
  background: rgba(0,0,0,.7); color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  padding: 8px 16px; font-size: 13px; cursor: pointer;
  border-radius: 3px;
}
.ad-skip-btn:disabled { opacity: .6; cursor: not-allowed; }
.ad-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.7); color: #ffcc00;
  font-size: 11px; padding: 3px 8px; border-radius: 3px;
}

/* Video info below player */
.video-page-title { font-size: 20px; font-weight: 600; margin: 14px 0 8px; }
.video-page-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--text-2); font-size: 14px; margin-bottom: 12px;
}
.video-action-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0 12px; border-bottom: 1px solid var(--border);
}
.channel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.channel-row-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.channel-row-info strong { font-size: 15px; font-weight: 600; }
.channel-row-info small { color: var(--text-2); font-size: 13px; }
.btn-subscribe {
  margin-left: auto; padding: 10px 20px;
  background: var(--text); color: var(--bg);
  border-radius: 20px; font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; transition: opacity .15s;
}
.btn-subscribe:hover { opacity: .85; }
.btn-subscribe.subscribed { background: var(--bg-3); color: var(--text); }

/* Reaction buttons */
.like-dislike-btn {
  display: flex; align-items: center; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--border); background: var(--bg-3);
}
.like-dislike-btn button {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-size: 14px; font-weight: 500;
  color: var(--text); background: none; border: none;
  cursor: pointer; transition: background .15s;
}
.like-dislike-btn button:hover { background: var(--border); }
.like-dislike-btn .divider { width: 1px; background: var(--border); height: 22px; }
.like-dislike-btn button.active { color: var(--blue); }

.btn-action {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 20px;
  background: var(--bg-3); color: var(--text);
  font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; transition: background .15s;
}
.btn-action:hover { background: var(--border); }

/* Description */
.video-description {
  background: var(--bg-3); border-radius: var(--radius);
  padding: 12px 14px; margin: 14px 0; font-size: 14px;
  cursor: pointer;
}
.video-description.collapsed .desc-text {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.desc-toggle { color: var(--blue); font-weight: 500; margin-top: 4px; font-size: 14px; }

/* Comments */
.comments-section { margin-top: 20px; }
.comment-count { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.comment-input-row { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-input-row img { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.comment-input-wrap { flex: 1; }
.comment-input-wrap input {
  width: 100%; border: none; border-bottom: 1px solid var(--border);
  padding: 8px 0; outline: none; font-size: 14px;
  background: transparent; color: var(--text);
}
.comment-input-wrap input:focus { border-color: var(--text); }
.comment-input-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.comment-item { display: flex; gap: 12px; margin-bottom: 16px; }
.comment-item img { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.comment-body strong { font-size: 13px; font-weight: 600; }
.comment-body .comment-date { font-size: 12px; color: var(--text-2); margin-left: 6px; }
.comment-body p { font-size: 14px; margin-top: 4px; line-height: 1.5; }
.comment-actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.comment-actions button {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-2); background: none; border: none;
  cursor: pointer; padding: 4px 6px; border-radius: 20px;
  transition: background .15s;
}
.comment-actions button:hover { background: var(--bg-3); }

/* Up Next Sidebar */
.up-next-item {
  display: flex; gap: 8px; cursor: pointer; padding: 4px;
  border-radius: var(--radius); transition: background .15s;
}
.up-next-item:hover { background: var(--bg-3); }
.up-next-thumb {
  position: relative; width: 168px; flex-shrink: 0;
  padding-top: 94.5px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-3);
}
.up-next-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.up-next-dur {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,.8); color: #fff; font-size: 11px;
  padding: 1px 4px; border-radius: 2px;
}
.up-next-info { flex: 1; min-width: 0; }
.up-next-title { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.up-next-channel { font-size: 12px; color: var(--text-2); }
.up-next-stats  { font-size: 12px; color: var(--text-2); }

/* ── Forms ──────────────────────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  max-width: 480px; margin: 60px auto;
  box-shadow: var(--shadow);
}
.form-card h2 { font-size: 22px; margin-bottom: 4px; }
.form-card p  { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 14px;
  outline: none; transition: border-color .15s;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(6,95,212,.12); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: none; transition: opacity .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-danger  { background: var(--accent); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-3); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

.form-divider { text-align: center; color: var(--text-3); margin: 16px 0; position: relative; }
.form-divider::before, .form-divider::after {
  content: ''; position: absolute; top: 50%; width: calc(50% - 24px); height: 1px;
  background: var(--border);
}
.form-divider::before { left: 0; }
.form-divider::after  { right: 0; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
  border-left: 4px solid;
}
.alert-success { background: #f0fff4; color: #15803d; border-color: #22c55e; }
.alert-danger   { background: #fff0f0; color: #dc2626; border-color: var(--accent); }
.alert-info     { background: #eff6ff; color: var(--blue); border-color: var(--blue); }
.alert-warning  { background: #fffbeb; color: #92400e; border-color: #f59e0b; }

/* ── Upload Page ────────────────────────────────────────── */
.upload-container { max-width: 900px; margin: 0 auto; }
.upload-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 60px 40px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over {
  border-color: var(--blue); background: #eff6ff;
}
.upload-drop-zone i { font-size: 56px; color: var(--text-3); margin-bottom: 16px; }
.upload-drop-zone h3 { font-size: 20px; margin-bottom: 8px; }
.upload-drop-zone p  { color: var(--text-2); margin-bottom: 20px; }

.upload-progress-wrap { margin-top: 20px; }
.progress-bar { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width .3s; }
.progress-text { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* ── Dashboard ──────────────────────────────────────────── */
.dashboard-layout { display: flex; gap: 24px; }
.dashboard-sidebar-nav {
  width: 220px; flex-shrink: 0;
}
.dashboard-sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 14px; color: var(--text); margin-bottom: 2px;
  transition: background .15s;
}
.dashboard-sidebar-nav a:hover, .dashboard-sidebar-nav a.active {
  background: var(--bg-3);
}
.dashboard-sidebar-nav a i { width: 20px; text-align: center; color: var(--text-2); }
.dashboard-main { flex: 1; min-width: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-change { font-size: 12px; color: #22c55e; margin-top: 4px; }
.stat-card .stat-icon { float: right; font-size: 24px; color: var(--border); }

/* ── Admin Panel ────────────────────────────────────────── */
.admin-layout { display: flex; min-height: calc(100vh - var(--navbar-h)); }
.admin-sidebar {
  width: 250px; flex-shrink: 0;
  background: #1a1a1a; color: #f1f1f1;
  padding: 16px 0; overflow-y: auto;
}
.admin-sidebar .admin-brand {
  padding: 8px 20px 20px;
  font-size: 16px; font-weight: 700; color: var(--accent);
  border-bottom: 1px solid #333; margin-bottom: 8px;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; font-size: 14px; color: #ccc;
  transition: background .15s, color .15s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: #2a2a2a; color: #fff;
}
.admin-sidebar a i { width: 20px; text-align: center; }
.admin-sidebar .admin-section { padding: 12px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #555; }

.admin-main { flex: 1; min-width: 0; background: var(--bg-2); padding: 24px; overflow-x: auto; }
.admin-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.admin-page-header h1 { font-size: 22px; }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th {
  background: var(--bg-3); padding: 12px 16px;
  text-align: left; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-2); }

.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.status-active   { background: #dcfce7; color: #15803d; }
.status-pending  { background: #fef9c3; color: #854d0e; }
.status-rejected { background: #fee2e2; color: #dc2626; }
.status-banned   { background: #fce7f3; color: #9d174d; }
.status-processing { background: #dbeafe; color: var(--blue); }

/* ── Support Tickets ─────────────────────────────────────── */
.ticket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.ticket-messages { max-height: 500px; overflow-y: auto; }
.ticket-msg {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.ticket-msg.staff { flex-direction: row-reverse; }
.ticket-msg img { width: 36px; height: 36px; border-radius: 50%; }
.ticket-msg-body { max-width: 70%; }
.ticket-msg-bubble {
  background: var(--bg-3); padding: 10px 14px;
  border-radius: var(--radius); font-size: 14px; line-height: 1.5;
}
.ticket-msg.staff .ticket-msg-bubble { background: #dbeafe; }
.ticket-msg-time { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ── Contact Page ────────────────────────────────────────── */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 960px; margin: 0 auto; }
.contact-info h2 { font-size: 26px; margin-bottom: 12px; }
.contact-info p  { color: var(--text-2); margin-bottom: 24px; }
.contact-item { display: flex; gap: 14px; margin-bottom: 20px; }
.contact-item i { width: 44px; height: 44px; background: var(--accent-soft); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.contact-item strong { display: block; font-size: 15px; margin-bottom: 2px; }
.contact-item span  { color: var(--text-2); font-size: 14px; }

/* ── Points Page ─────────────────────────────────────────── */
.points-hero {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: #fff; border-radius: var(--radius); padding: 32px;
  display: flex; align-items: center; gap: 24px; margin-bottom: 24px;
}
.points-hero .points-big { font-size: 56px; font-weight: 700; line-height: 1; }
.points-hero .points-label { font-size: 16px; opacity: .85; }

/* ── Utility ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h2 { font-size: 18px; font-weight: 600; }
.text-muted { color: var(--text-2); }
.text-sm    { font-size: 12px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: 8px; }
.hidden { display: none !important; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: #323232; color: #fff;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 14px; box-shadow: var(--shadow-md);
  animation: fadeUp .3s ease;
}
.toast.success { background: #15803d; }
.toast.error   { background: #dc2626; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 14px;
  background: var(--bg); color: var(--text);
  transition: background .15s;
}
.pagination a:hover { background: var(--bg-3); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.6); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px; width: 90%; max-width: 520px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-2); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(8px);  } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes spin     { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .watch-layout { flex-direction: column; }
  .watch-sidebar { width: 100%; }
}
@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr; }
  .dashboard-layout { flex-direction: column; }
  .dashboard-sidebar-nav { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .navbar-center { display: none; }
  .search-bar { display: none; }
  .video-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
  .form-card { margin: 20px; padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
