/* ================================================================
   StreamVault — assets/style.css
   Full design system implementation
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@400;600;700&display=swap');

/* ----------------------------------------------------------------
   CSS Custom Properties
   ---------------------------------------------------------------- */
:root {
  --bg-base:          #0f0f13;
  --bg-card:          #1a1a22;
  --bg-secondary:     #22222e;
  --border-color:     #2e2e3d;
  --text-primary:     #f5f5f7;
  --text-secondary:   #8a8a9a;
  --text-muted:       #55556a;
  --accent-red:       #e53935;
  --accent-red-hover: #c62828;
  --accent-red-dim:   rgba(229, 57, 53, 0.15);
  --white:            #ffffff;

  --radius-btn:    6px;
  --radius-card:   8px;
  --radius-thumb:  8px;
  --radius-pill:   9999px;
  --radius-logo:   8px;
  --radius-input:  6px;

  --shadow-card:     0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.5);

  --font-body:    'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

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

html {
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: 14px;
}

ul, ol {
  list-style: none;
}

/* ----------------------------------------------------------------
   Scrollbar Styling (webkit)
   ---------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: #3e3e50;
}

/* ----------------------------------------------------------------
   Typography Helpers
   ---------------------------------------------------------------- */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

h1, .h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
h2, .h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
h3, .h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

/* Line clamp utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----------------------------------------------------------------
   Navbar
   ---------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: rgba(15, 15, 19, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(46, 46, 61, 0.6);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-logo);
  background: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar-logo-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--white);
}

.navbar-logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}
.btn-ghost:hover {
  color: var(--text-primary);
}
.btn-ghost svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-red {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-btn);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.btn-red:hover {
  background: var(--accent-red-hover);
}
.btn-red svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Hero Section
   ---------------------------------------------------------------- */
.hero {
  padding: 40px 24px 32px;
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.08) 0%, transparent 60%);
  border-bottom: 1px solid rgba(46, 46, 61, 0.4);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  text-align: center;
}

.hero-title .accent {
  color: var(--accent-red);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  //max-width: 480px;
  margin-top: 10px;
  text-align: center;
}

@media (max-width: 600px) {
  .hero-title { font-size: 24px; }
}

/* ----------------------------------------------------------------
   Category Filter Bar
   ---------------------------------------------------------------- */
.category-bar {
  padding: 14px 24px;
  border-bottom: 1px solid rgba(46, 46, 61, 0.4);
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  gap: 8px;
  align-items: center;
}
.category-bar::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
}

.pill-btn:hover {
  border-color: rgba(229, 57, 53, 0.5);
  color: var(--text-primary);
}

.pill-btn.active {
  background: var(--pill-color, var(--accent-red));
  color: var(--white);
  border-color: transparent;
}

/* ----------------------------------------------------------------
   Video Grid
   ---------------------------------------------------------------- */
.video-grid-wrapper {
  padding: 24px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1279px) {
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479px) {
  .video-grid { grid-template-columns: repeat(1, 1fr); }
}

/* ----------------------------------------------------------------
   Video Card
   ---------------------------------------------------------------- */
.video-card {
  background: transparent;
  cursor: pointer;
  border: none;
  text-align: left;
  padding: 0;
  display: block;
  text-decoration: none;
}

.video-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-thumb);
  overflow: hidden;
  background: var(--bg-secondary);
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.video-card:hover .video-card-thumb img {
  transform: scale(1.05);
}

.video-card:hover .video-card-title {
  color: var(--accent-red);
}

/* Duration badge */
.video-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--white);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
  pointer-events: none;
}

/* Category badge on thumbnail */
.video-cat-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  color: var(--white);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  line-height: 1.4;
  pointer-events: none;
}

/* Card text */
.video-card-body {
  margin-top: 10px;
}

.video-card-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.video-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.video-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.video-card-meta-item svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Load More Button
   ---------------------------------------------------------------- */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 24px 40px;
}

.btn-load-more {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 9px 28px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-load-more:hover {
  border-color: var(--accent-red);
  color: var(--text-primary);
}

/* ----------------------------------------------------------------
   Skeleton Loading
   ---------------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-thumb);
  width: 100%;
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-top: 10px;
  width: 75%;
}

.skeleton-meta {
  height: 12px;
  border-radius: 4px;
  margin-top: 6px;
  width: 50%;
}

/* ----------------------------------------------------------------
   Empty State
   ---------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--border-color);
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 12px;
}

.empty-state-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ----------------------------------------------------------------
   Watch Page
   ---------------------------------------------------------------- */
.watch-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}
.back-link:hover {
  color: var(--text-primary);
}
.back-link svg {
  width: 14px;
  height: 14px;
}

.watch-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1023px) {
  .watch-grid { grid-template-columns: 1fr; }
}

/* Player */
.player-container {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.player-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video ended overlay */
.video-ended-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 12px;
}
.video-ended-overlay.visible {
  display: flex;
}

.ended-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ended-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  padding: 0 24px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 480px;
}

.ended-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-btn);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-replay:hover {
  background: var(--accent-red-hover);
}
.btn-replay svg {
  width: 16px;
  height: 16px;
}

.btn-browse {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn-browse:hover {
  background: #2a2a38;
}

/* Video info below player */
.video-info {
  margin-top: 16px;
}

.video-info-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.video-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.video-info-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.video-info-meta-item svg {
  width: 14px;
  height: 14px;
}

.video-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
}

.video-description {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* Sidebar */
.sidebar-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.related-video {
  display: flex;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 12px;
}

.related-video-thumb {
  width: 144px;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-secondary);
}

.related-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.related-video:hover .related-video-thumb img {
  transform: scale(1.05);
}

.related-video:hover .related-video-title {
  color: var(--accent-red);
}

.related-video-info {
  flex: 1;
  min-width: 0;
}

.related-video-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.related-video-views {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ----------------------------------------------------------------
   Admin Panel
   ---------------------------------------------------------------- */
.admin-wrapper {
  max-width: 768px;
  margin: 0 auto;
  padding: 24px;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-header-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Tab switcher */
.tab-switcher {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 4px;
  display: inline-flex;
  gap: 2px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 6px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  background: var(--bg-base);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Tab panels */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Form card */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 24px;
}

/* Form fields */
.form-field {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-red);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* URL + Fetch Info row */
.url-fetch-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.url-fetch-row .form-input {
  flex: 1;
}

.btn-fetch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
  flex-shrink: 0;
}
.btn-fetch svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.btn-fetch:hover {
  border-color: var(--accent-red);
}
.btn-fetch.success {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}
.btn-fetch.loading {
  opacity: 0.7;
  cursor: wait;
}

/* Thumbnail preview */
.thumb-preview-wrap {
  position: relative;
  margin-bottom: 16px;
  display: none;
}
.thumb-preview-wrap.visible {
  display: block;
}
.thumb-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius-card);
  display: block;
}
.thumb-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: var(--radius-btn);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.thumb-clear-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}
.thumb-clear-btn svg {
  width: 14px;
  height: 14px;
}

/* Color picker */
.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.color-swatch.selected {
  border-color: var(--white);
  transform: scale(1.15);
}

/* Submit button */
.btn-submit {
  width: 100%;
  background: var(--accent-red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-btn);
  padding: 10px 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-submit:hover {
  background: var(--accent-red-hover);
}
.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Section heading inside forms */
.form-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Admin list items */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-card);
  background: rgba(34, 34, 46, 0.5);
  border: 1px solid var(--border-color);
}

.admin-list-thumb {
  width: 80px;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-secondary);
}
.admin-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-list-info {
  flex: 1;
  min-width: 0;
}

.admin-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-list-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-delete {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: transparent;
  color: #ef4444;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.btn-delete:hover {
  background: rgba(239, 68, 68, 0.1);
}
.btn-delete svg {
  width: 14px;
  height: 14px;
}

/* Confirm tooltip */
.confirm-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 8px 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-dropdown);
  font-size: 12px;
  color: var(--text-secondary);
}
.confirm-tooltip .btn-confirm-yes {
  background: #ef4444;
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.confirm-tooltip .btn-confirm-no {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.delete-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Category list items */
.cat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.cat-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.cat-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   Login / Register Pages
   ---------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 24px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  text-decoration: none;
}

.auth-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-logo);
  background: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-logo-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--white);
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 24px;
}

.auth-footer {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 16px;
}

.auth-footer a {
  color: var(--accent-red);
  text-decoration: none;
}
.auth-footer a:hover {
  text-decoration: underline;
}

.auth-note {
  background: rgba(229, 57, 53, 0.08);
  border: 1px solid rgba(229, 57, 53, 0.2);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
  font-size: 13px;
  color: #ef4444;
  margin-bottom: 16px;
}

/* ----------------------------------------------------------------
   Toast Notifications
   ---------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  min-width: 240px;
  max-width: 360px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  border-left: 3px solid var(--border-color);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success { border-left-color: #22c55e; }
.toast.toast-error   { border-left-color: #ef4444; }
.toast.toast-info    { border-left-color: #3b82f6; }

.toast.hiding {
  transform: translateY(16px);
  opacity: 0;
}

/* ----------------------------------------------------------------
   Utility Classes
   ---------------------------------------------------------------- */
.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary  { color: var(--text-primary); }
.text-red      { color: var(--accent-red); }
.text-center   { text-align: center; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ================================================================
   StreamVault v2 — Google Drive / Audio additions
   ================================================================ */

/* ── Source Switcher ─────────────────────────────────────────── */
.source-switcher {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.source-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
}
.source-btn:hover {
  border-color: rgba(229,57,53,0.5);
  color: var(--text-primary);
}
.source-btn.active {
  background: var(--accent-red);
  color: var(--white);
  border-color: var(--accent-red);
}

/* ── Form hint text ──────────────────────────────────────────── */
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Thumbnail Upload Area ───────────────────────────────────── */
.thumb-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 0.15s ease;
  cursor: pointer;
}
.thumb-upload-area:hover {
  border-color: var(--accent-red);
}
.thumb-upload-area.dragover {
  border-color: var(--accent-red);
  background: var(--accent-red-dim);
}

.thumb-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 20px;
  color: var(--text-muted);
  text-align: center;
}
.thumb-upload-placeholder p {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}
.thumb-upload-placeholder span {
  font-size: 12px;
}

.thumb-upload-preview {
  position: relative;
}
.thumb-upload-preview img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
}
.thumb-upload-preview .thumb-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* ── Download Button ─────────────────────────────────────────── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-top: 4px;
}
.btn-download:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: var(--white);
}
.btn-download svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Audio Player ────────────────────────────────────────────── */
.audio-player-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.audio-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  overflow: hidden;
}
.audio-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
}
.audio-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.audio-controls-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

audio {
  width: 100%;
  outline: none;
  border-radius: 4px;
  accent-color: var(--accent-red);
}
/* Webkit audio player */
audio::-webkit-media-controls-panel {
  background: var(--bg-secondary);
}

/* ── GDrive Player container ─────────────────────────────────── */
.gdrive-player {
  background: #000;
}
.gdrive-player video {
  border-radius: 12px;
}

/* ── Source badge on watch page ──────────────────────────────── */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.gdrive-badge {
  border-color: rgba(59,130,246,0.4);
  color: #3b82f6;
}

/* ── Related audio badge (mini icon on sidebar thumb) ────────── */
.related-video-thumb {
  position: relative;
}
.related-audio-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  color: var(--white);
  border-radius: 4px;
  padding: 2px 5px;
  display: flex;
  align-items: center;
}

/* ── Card media type badge ───────────────────────────────────── */
.video-type-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.75);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── .hidden utility (ensure it exists) ─────────────────────── */
.hidden { display: none !important; }
