/* ============================================================
   SSSCensorFace – style.css
   Dark theme, purple accent (#6C5CE7), card-based, responsive
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --accent:        #6C5CE7;
  --accent-hover:  #5a4bd1;
  --accent-light:  rgba(108, 92, 231, 0.15);
  --accent-glow:   rgba(108, 92, 231, 0.35);

  --bg-base:       #0d0d14;
  --bg-surface:    #13131f;
  --bg-card:       #1a1a2e;
  --bg-input:      #1e1e30;
  --bg-overlay:    rgba(0, 0, 0, 0.65);

  --border:        rgba(255, 255, 255, 0.08);
  --border-focus:  rgba(108, 92, 231, 0.6);

  --text-primary:  #e8e8f0;
  --text-secondary:#9898b0;
  --text-muted:    #5a5a72;
  --text-invert:   #ffffff;

  --status-queued:     #f9ca24;
  --status-processing: #4d9de0;
  --status-completed:  #38d9a9;
  --status-failed:     #e05c5c;

  --google-blue:   #4285f4;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow:  0 0 24px rgba(108, 92, 231, 0.25);

  --transition: 0.2s ease;

  --header-height: 64px;
  --sidebar-width: 240px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

button { font-family: inherit; cursor: pointer; border: none; outline: none; }

input, textarea, select {
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ---------- Utilities ---------- */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.flex    { display: flex; }
.flex-col{ display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1   { gap: 4px; }
.gap-2   { gap: 8px; }
.gap-3   { gap: 12px; }
.gap-4   { gap: 16px; }

.mt-1    { margin-top: 4px; }
.mt-2    { margin-top: 8px; }
.mt-3    { margin-top: 12px; }
.mt-4    { margin-top: 16px; }

.text-sm   { font-size: 0.8125rem; }
.text-xs   { font-size: 0.75rem; }
.text-muted{ color: var(--text-secondary); }
.text-center { text-align: center; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full    { width: 100%; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,0.22); }

/* ============================================================
   AUTH VIEWS  (#login / #register)
   ============================================================ */
#view-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(108,92,231,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(108,92,231,0.10) 0%, transparent 60%),
    var(--bg-base);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px 36px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo svg {
  width: 36px; height: 36px;
  color: var(--accent);
}

.auth-logo-text {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-logo-text span {
  color: var(--accent);
}

.auth-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* Google Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn-google:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.btn-google svg { flex-shrink: 0; width: 18px; height: 18px; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Form */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Primary button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  background: var(--accent);
  color: var(--text-invert);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  margin-top: 4px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Secondary / Ghost */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}

/* Danger button */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(224, 92, 92, 0.12);
  color: var(--status-failed);
  border: 1px solid rgba(224, 92, 92, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.btn-danger:hover {
  background: rgba(224, 92, 92, 0.22);
  border-color: rgba(224, 92, 92, 0.45);
}

/* Download button */
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(108, 92, 231, 0.12);
  color: var(--accent);
  border: 1px solid rgba(108, 92, 231, 0.28);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.btn-download:hover {
  background: rgba(108, 92, 231, 0.22);
  border-color: rgba(108, 92, 231, 0.5);
}

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-switch button {
  background: none;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0 2px;
  transition: color var(--transition);
}

.auth-switch button:hover { color: var(--accent-hover); }

/* Auth error */
.auth-error {
  background: rgba(224, 92, 92, 0.12);
  border: 1px solid rgba(224, 92, 92, 0.28);
  border-radius: var(--radius-sm);
  color: #f08080;
  font-size: 0.875rem;
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* ============================================================
   APP SHELL  (#library / #admin)
   ============================================================ */
#view-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(13, 13, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.header-logo svg { width: 28px; height: 28px; color: var(--accent); }
.header-logo span { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  background: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  border: 1px solid transparent;
}

.nav-btn:hover, .nav-btn.active {
  color: var(--text-primary);
  background: var(--accent-light);
}

.nav-btn.active {
  color: var(--accent);
  border-color: rgba(108, 92, 231, 0.28);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.btn-logout {
  background: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-logout:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.2); }

/* ---- Main layout ---- */
.app-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

/* ---- Section titles ---- */
.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ============================================================
   QUOTA BAR
   ============================================================ */
.quota-bar-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.quota-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.quota-label strong {
  color: var(--text-primary);
  font-weight: 600;
}

.quota-track {
  flex: 1;
  min-width: 120px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.quota-fill.quota-warn   { background: linear-gradient(90deg, #f9ca24, #f0932b); }
.quota-fill.quota-danger { background: linear-gradient(90deg, #e05c5c, #c0392b); }

.quota-remain {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   UPLOAD AREA
   ============================================================ */
/* ---------- Censor mode selector ---------- */
.censor-mode-section {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.censor-mode-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.censor-mode-select {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.censor-mode-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.upload-section { margin-bottom: 40px; }

.upload-area {
  border: 2px dashed rgba(108, 92, 231, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(108, 92, 231, 0.04);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.10);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.08), inset 0 0 40px rgba(108, 92, 231, 0.05);
}

.upload-area.dragover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108,92,231,0.06) 0%, transparent 100%);
  pointer-events: none;
}

.upload-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.upload-icon svg { width: 28px; height: 28px; }

.upload-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.upload-hint strong { color: var(--accent); }

.upload-file-input { display: none; }

/* ---- Upload Progress ---- */
.upload-progress {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.upload-filename {
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-percent {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
}

.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.upload-status-msg {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Processing phase (after upload completes) */
.processing-phase { margin-top: 14px; }
.processing-phase.hidden { display: none; }
.processing-phase-bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}
.processing-phase-indeterminate {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: processingSlide 1.5s ease-in-out infinite;
}
@keyframes processingSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.processing-phase-text {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.processing-phase-text::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 1s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================================
   VIDEO LIBRARY
   ============================================================ */
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.library-header .section-title { margin-bottom: 0; }

.library-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color var(--transition), border-color var(--transition);
}

.btn-refresh:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.2); }
.btn-refresh.spinning svg { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Video Card */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.video-card:hover {
  border-color: rgba(108, 92, 231, 0.35);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(108,92,231,0.12);
  transform: translateY(-2px);
}

.video-thumb {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f20 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  position: relative;
  overflow: hidden;
  overflow: hidden;
}

.video-thumb svg { width: 36px; height: 36px; opacity: 0.4; }

.video-thumb-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Processing thumb state ---- */
.thumb-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.processing-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.processing-ring-spin {
  transform-origin: center;
  animation: ringRotate 1.4s linear infinite;
}

@keyframes ringRotate {
  from { transform: rotate(-90deg); }
  to   { transform: rotate(270deg); }
}

.thumb-processing-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.video-card-body { padding: 16px 18px 18px; }

.video-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.video-filename {
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.7375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-queued {
  color: var(--status-queued);
  background: rgba(249, 202, 36, 0.12);
  border: 1px solid rgba(249, 202, 36, 0.25);
}

.badge-processing {
  color: var(--status-processing);
  background: rgba(77, 157, 224, 0.12);
  border: 1px solid rgba(77, 157, 224, 0.25);
}

.badge-processing::before { animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.badge-completed {
  color: var(--status-completed);
  background: rgba(56, 217, 169, 0.12);
  border: 1px solid rgba(56, 217, 169, 0.25);
}

.badge-failed {
  color: var(--status-failed);
  background: rgba(224, 92, 92, 0.12);
  border: 1px solid rgba(224, 92, 92, 0.25);
}

/* Video meta */
.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7875rem;
  color: var(--text-muted);
}

.meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Card actions */
.video-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
}

.empty-state svg { width: 56px; height: 56px; opacity: 0.3; margin: 0 auto 16px; display: block; }
.empty-state h3 { font-size: 1.0625rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.875rem; }

/* Loading skeleton */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.09) 37%, rgba(255,255,255,0.05) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0%   { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}

.skeleton-thumb { height: 160px; border-radius: 0; }
.skeleton-body  { padding: 16px 18px; }
.skeleton-line  { height: 14px; margin-bottom: 10px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.shorter { width: 40%; }

/* ============================================================
   ADMIN PANEL — Rebuilt grid-based view
   ============================================================ */

/* Admin search bar */
.admin-search-bar {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-search-input-wrap {
  position: relative;
}

.admin-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.admin-search-field {
  width: 100%;
  padding: 11px 14px 11px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.admin-search-field:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.admin-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-user-filter-select {
  padding: 8px 36px 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  width: auto;
  min-width: 180px;
  appearance: none;
  -webkit-appearance: none;
  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='%235a5a72' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.admin-user-filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.admin-video-count-badge {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  white-space: nowrap;
}

/* Admin card owner info */
.video-card-owner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px 0;
  font-size: 0.7375rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.video-card-owner svg {
  width: 11px; height: 11px;
  flex-shrink: 0;
  color: var(--accent);
}

.video-card-owner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Archive button */
.btn-archive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(90, 90, 114, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(90, 90, 114, 0.28);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-archive:hover {
  background: rgba(90, 90, 114, 0.22);
  border-color: rgba(90, 90, 114, 0.5);
  color: var(--text-primary);
}

/* Unarchive button */
.btn-unarchive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(56, 217, 169, 0.1);
  color: var(--status-completed);
  border: 1px solid rgba(56, 217, 169, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.btn-unarchive:hover {
  background: rgba(56, 217, 169, 0.2);
  border-color: rgba(56, 217, 169, 0.45);
}

/* Archived video card state */
.video-card.archived {
  opacity: 0.55;
}

.video-card.archived .video-thumb img,
.video-card.archived .thumb-img {
  filter: grayscale(80%);
}

.video-card.archived:hover {
  opacity: 0.75;
}

/* Archived badge */
.badge-archived {
  color: var(--text-muted);
  background: rgba(90, 90, 114, 0.12);
  border: 1px solid rgba(90, 90, 114, 0.25);
}

/* Archived section collapsible */
.archived-section {
  margin-top: 36px;
}

.archived-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 0;
  user-select: none;
  border-top: 1px solid var(--border);
}

.archived-section-header:hover .archived-section-title {
  color: var(--text-primary);
}

.archived-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.archived-section-count {
  background: rgba(90, 90, 114, 0.2);
  color: var(--text-muted);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.archived-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform var(--transition);
  width: 16px; height: 16px;
}

.archived-section-header.open .archived-chevron {
  transform: rotate(180deg);
}

.archived-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.archived-grid.hidden { display: none; }

/* Legacy admin panel helpers (kept for compatibility) */
.admin-panel-placeholder {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}

.admin-panel-placeholder svg { width: 48px; height: 48px; opacity: 0.3; margin: 0 auto 14px; display: block; }
.admin-panel-placeholder p { font-size: 0.9rem; }

.admin-video-list { display: flex; flex-direction: column; gap: 12px; }

.admin-video-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

.admin-video-name {
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.admin-video-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-video-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Admin skeleton loading */
.admin-loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   ADMIN TABS
   ============================================================ */
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: fit-content;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: calc(var(--radius-md) - 2px);
  border: 1px solid transparent;
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition);
  white-space: nowrap;
}

.admin-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(108, 92, 231, 0.28);
  font-weight: 600;
}

.admin-tab svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.admin-tab.active svg {
  opacity: 1;
}

/* ============================================================
   ADMIN USERS TABLE
   ============================================================ */
.admin-users-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 720px;
}

.admin-users-table thead th {
  padding: 13px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-users-table thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.admin-users-table thead th:last-child  { border-radius: 0 var(--radius-md) 0 0; }

.admin-users-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.admin-users-table tbody tr:last-child { border-bottom: none; }

.admin-users-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-users-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--text-primary);
}

/* User cell: avatar + name */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.user-cell-name {
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Email cell */
.user-email-cell {
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Role badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-badge-admin {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
  border: 1px solid rgba(108, 92, 231, 0.3);
}

.role-badge-user {
  background: rgba(90, 90, 114, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(90, 90, 114, 0.22);
}

/* Video count cell */
.video-count-cell {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* User status badge / toggle button */
.user-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.7375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.user-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.user-status-active {
  color: var(--status-completed);
  background: rgba(56, 217, 169, 0.1);
  border: 1px solid rgba(56, 217, 169, 0.25);
}

.user-status-active:hover {
  background: rgba(56, 217, 169, 0.2);
  border-color: rgba(56, 217, 169, 0.45);
}

.user-status-inactive {
  color: var(--status-failed);
  background: rgba(224, 92, 92, 0.1);
  border: 1px solid rgba(224, 92, 92, 0.25);
}

.user-status-inactive:hover {
  background: rgba(224, 92, 92, 0.2);
  border-color: rgba(224, 92, 92, 0.45);
}

/* Joined date cell */
.joined-cell {
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* Actions cell */
.user-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Users table empty / loading state */
.admin-users-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}

.admin-users-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin: 0 auto 14px;
  display: block;
}

.admin-users-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-users-empty p {
  font-size: 0.875rem;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
#view-landing { background: var(--bg-base); color: var(--text-primary); }

/* ---- Nav ---- */
.landing-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,20,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.landing-nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.landing-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 600; color: var(--text-primary);
}
.landing-logo svg { width: 32px; height: 32px; }
.landing-logo strong { color: var(--accent); }
.landing-nav-links { display: flex; align-items: center; gap: 24px; }
.landing-nav-link {
  color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  transition: color 0.2s;
}
.landing-nav-link:hover { color: var(--text-primary); }
.btn-sm { padding: 8px 20px; font-size: 0.85rem; }

/* ---- Hero ---- */
.landing-hero {
  padding: 100px 24px 60px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(108,92,231,0.12) 0%, transparent 70%);
}
.landing-hero-inner { max-width: 800px; margin: 0 auto; }
.landing-badge {
  display: inline-block;
  padding: 6px 16px; border-radius: 20px;
  background: var(--accent-light); color: var(--accent);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 24px;
}
.landing-h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700; line-height: 1.2; margin: 0 0 20px;
}
.text-accent { color: var(--accent); }
.landing-subtitle {
  font-size: 1.1rem; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 32px; line-height: 1.6;
}
.landing-cta-row { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn-lg { padding: 14px 36px; font-size: 1rem; }
.landing-cta-note { font-size: 0.8rem; color: var(--text-muted); }

/* Demo before/after */
.landing-demo {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  margin-top: 56px; flex-wrap: wrap;
}
.demo-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px); padding: 16px; position: relative;
  transition: transform 0.3s;
}
.demo-card:hover { transform: translateY(-4px); }
.demo-label {
  position: absolute; top: -10px; left: 16px;
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 2px 10px; border-radius: 4px;
  border: 1px solid var(--border);
}
.demo-label-after { color: var(--accent); border-color: var(--accent); }
.demo-visual svg { width: 200px; height: 140px; display: block; }
.demo-arrow svg { width: 32px; height: 32px; }

/* ---- Sections shared ---- */
.landing-section-inner { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.landing-h2 {
  font-size: 1.8rem; font-weight: 700; text-align: center; margin: 0 0 8px;
}
.landing-section-sub {
  text-align: center; color: var(--text-secondary); margin: 0 0 48px; font-size: 1rem;
}

/* ---- Features ---- */
.landing-features { padding: 80px 0; background: var(--bg-surface); }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px 24px; text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}
.feature-card:hover {
  border-color: var(--accent); transform: translateY(-4px);
}
.feature-icon {
  width: 48px; height: 48px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--accent-light); color: var(--accent);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.05rem; margin: 0 0 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin: 0; }

/* ---- Selling points ---- */
.landing-points { padding: 80px 0; }
.points-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.point-item {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
}
.point-icon {
  flex-shrink: 0; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--accent-light); color: var(--accent);
}
.point-icon svg { width: 20px; height: 20px; }
.point-item h4 { margin: 0 0 4px; font-size: 0.95rem; }
.point-item p { margin: 0; color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; }

/* ---- Pricing ---- */
.landing-pricing { padding: 80px 0; background: var(--bg-surface); }
.pricing-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  max-width: 700px; margin: 0 auto;
}
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 28px; text-align: center;
  position: relative; transition: transform 0.3s;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card-pro { border-color: var(--accent); }
.pricing-popular {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  padding: 4px 14px; border-radius: 12px; letter-spacing: 0.05em;
}
.pricing-name { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.pricing-price { font-size: 2.8rem; font-weight: 700; }
.pricing-period { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.pricing-features {
  list-style: none; padding: 0; margin: 0 0 28px; text-align: left;
}
.pricing-features li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-secondary);
}
.pricing-features li::before {
  content: '\2713'; color: var(--accent); font-weight: 700; margin-right: 10px;
}
.btn-block { width: 100%; }
.btn-outline {
  display: inline-block; padding: 12px 24px;
  border: 1px solid var(--border); border-radius: var(--radius-md, 8px);
  background: transparent; color: var(--text-secondary);
  font-weight: 600; cursor: not-allowed; font-size: 0.9rem;
}

/* ---- Footer ---- */
.landing-footer {
  padding: 32px 0; border-top: 1px solid var(--border);
}
.landing-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.landing-footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem;
}
.landing-footer-logo svg { width: 24px; height: 24px; }
.landing-footer-text { color: var(--text-muted); font-size: 0.8rem; }

/* ---- Landing responsive ---- */
@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
  .points-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .landing-hero { padding: 60px 16px 40px; }
  .landing-nav-links .landing-nav-link { display: none; }
  .landing-demo { flex-direction: column; }
  .demo-arrow svg { transform: rotate(90deg); }
  .landing-footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}


/* ============================================================
   VIDEO COMPARISON (fullscreen)
   ============================================================ */
.video-modal { position:fixed; inset:0; z-index:1000; background:#000; display:flex; flex-direction:column; animation:vmFadeIn .25s ease; }
.video-modal.hidden { display:none; }
@keyframes vmFadeIn { from{opacity:0} to{opacity:1} }

/* Top bar */
.vm-topbar { display:flex; align-items:center; gap:16px; padding:12px 20px; background:rgba(0,0,0,0.6); backdrop-filter:blur(8px); flex-shrink:0; z-index:2; }
.vm-back { display:flex; align-items:center; gap:6px; background:none; border:none; color:#fff; font-size:0.9rem; font-weight:500; cursor:pointer; padding:6px 10px; border-radius:8px; transition:background .2s; }
.vm-back:hover { background:rgba(255,255,255,0.1); }
.vm-title { font-size:1rem; font-weight:600; color:#fff; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
.vm-info { display:flex; gap:12px; font-size:0.8rem; color:rgba(255,255,255,0.5); flex-shrink:0; }

/* Viewport */
.vm-viewport { flex:1; position:relative; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.vm-video-wrap { display:grid; grid-template-columns:1fr 1fr; gap:4px; width:100%; height:100%; padding:4px; }
.vm-video-side { position:relative; overflow:hidden; border-radius:8px; background:#111; display:flex; align-items:center; justify-content:center; }
.vm-video-side video { width:100%; height:100%; object-fit:contain; }
.vm-label { position:absolute; top:12px; left:12px; background:rgba(0,0,0,0.7); backdrop-filter:blur(4px); color:rgba(255,255,255,0.8); font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; padding:4px 12px; border-radius:6px; }
.vm-label-accent { background:rgba(108,92,231,0.8); color:#fff; }

/* Loading */
.vm-loading { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; background:rgba(0,0,0,0.7); z-index:3; color:rgba(255,255,255,0.6); font-size:0.9rem; }
.vm-loading.hidden { display:none; }
.vm-spinner { width:32px; height:32px; border:3px solid rgba(255,255,255,0.15); border-top-color:var(--accent); border-radius:50%; animation:vmSpin .8s linear infinite; }
@keyframes vmSpin { to{transform:rotate(360deg)} }

/* Controls bar */
.vm-controls { display:flex; align-items:center; gap:12px; padding:12px 20px; background:rgba(0,0,0,0.6); backdrop-filter:blur(8px); flex-shrink:0; z-index:2; }
.vm-play-btn, .vm-mute-btn { background:none; border:none; color:#fff; cursor:pointer; padding:6px; border-radius:8px; display:flex; align-items:center; justify-content:center; transition:background .2s; }
.vm-play-btn:hover, .vm-mute-btn:hover { background:rgba(255,255,255,0.1); }
.vm-time { font-size:0.8rem; color:rgba(255,255,255,0.6); font-variant-numeric:tabular-nums; min-width:36px; text-align:center; }

/* Slider */
.vm-slider { flex:1; -webkit-appearance:none; appearance:none; height:4px; background:rgba(255,255,255,0.15); border-radius:4px; outline:none; cursor:pointer; position:relative; }
.vm-slider::-webkit-slider-thumb { -webkit-appearance:none; width:14px; height:14px; border-radius:50%; background:var(--accent); cursor:pointer; border:2px solid #fff; box-shadow:0 0 4px rgba(0,0,0,0.4); }
.vm-slider::-moz-range-thumb { width:14px; height:14px; border-radius:50%; background:var(--accent); cursor:pointer; border:2px solid #fff; }
.vm-slider::-moz-range-track { background:rgba(255,255,255,0.15); height:4px; border-radius:4px; }

/* Thumbnail before/after */
.thumb-compare { display:grid; grid-template-columns:1fr 1fr; gap:2px; width:100%; height:100%; }
.thumb-half { position:relative; overflow:hidden; }
.thumb-img { width:100%; height:100%; object-fit:cover; background:#1a1a2e; display:block; min-height:80px; }
.thumb-tag { position:absolute; bottom:4px; left:4px; background:rgba(0,0,0,0.7); color:rgba(255,255,255,0.8); font-size:0.6rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; padding:2px 6px; border-radius:3px; }
.thumb-tag-accent { background:rgba(108,92,231,0.85); }

.video-card.completed { cursor:pointer; }
@media(max-width:768px) {
  .vm-video-wrap { grid-template-columns:1fr; }
  .vm-info { display:none; }
}

/* ============================================================
   TOAST / NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  width: calc(100vw - 48px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.25s ease;
  position: relative;
  overflow: hidden;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.removing {
  animation: slideOut 0.2s ease forwards;
}

@keyframes slideOut {
  to { opacity: 0; transform: translateX(20px); }
}

.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 18px; height: 18px; }

.toast-success { border-left: 3px solid var(--status-completed); }
.toast-success .toast-icon { color: var(--status-completed); }

.toast-error { border-left: 3px solid var(--status-failed); }
.toast-error .toast-icon { color: var(--status-failed); }

.toast-info { border-left: 3px solid var(--status-processing); }
.toast-info .toast-icon { color: var(--status-processing); }

.toast-body { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 600; }
.toast-msg   { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; }

.toast-close {
  background: none;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}

.toast-close:hover { color: var(--text-primary); }
.toast-close svg { width: 14px; height: 14px; }

/* ============================================================
   CENSOR MODE SELECTOR MODAL
   ============================================================ */
.mode-selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  animation: fadeIn 0.2s ease;
}

.mode-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: popIn 0.22s ease;
}

.mode-selector-header {
  margin-bottom: 8px;
}

.mode-selector-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.mode-selector-filename {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.mode-selector-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 16px 0 20px;
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.mode-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px 18px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  text-align: center;
  color: var(--text-primary);
}

.mode-option-btn:hover {
  border-color: rgba(108, 92, 231, 0.5);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.18);
}

.mode-option-btn.selected {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.12);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.18);
}

.mode-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(108, 92, 231, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: background var(--transition);
}

.mode-option-btn:hover .mode-option-icon,
.mode-option-btn.selected .mode-option-icon {
  background: rgba(108, 92, 231, 0.28);
}

.mode-option-icon svg {
  width: 22px;
  height: 22px;
}

.mode-option-label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.mode-option-desc {
  font-size: 0.7375rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.mode-selector-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-mode-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-mode-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .mode-options {
    grid-template-columns: 1fr;
  }
  .mode-selector-card {
    padding: 24px 18px 20px;
  }
}

/* ============================================================
   MODAL / CONFIRM DIALOG
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 28px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-card);
  animation: popIn 0.22s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-title  { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.modal-body   { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 22px; line-height: 1.6; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   PROCESSING INDICATOR (auto-refresh)
   ============================================================ */
.processing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--status-processing);
  background: rgba(77, 157, 224, 0.08);
  border: 1px solid rgba(77, 157, 224, 0.2);
  border-radius: 99px;
  padding: 5px 12px;
}

.processing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--status-processing);
  animation: pulse 1.2s ease-in-out infinite;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .admin-filter-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-user-filter-select {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .app-header { padding: 0 16px; gap: 10px; }
  .header-nav { display: none; }
  .app-main { padding: 20px 16px 40px; }
  .auth-card { padding: 28px 20px 24px; }
  .video-grid { grid-template-columns: 1fr; }
  .quota-track { min-width: 80px; }
  .toast-container { bottom: 16px; right: 16px; width: calc(100vw - 32px); max-width: none; }
  .upload-area { padding: 32px 20px; }
}

@media (max-width: 480px) {
  .header-logo { font-size: 1rem; }
  .user-name { display: none; }
  .admin-video-row { flex-direction: column; align-items: flex-start; }
  .admin-video-actions { width: 100%; }
  .admin-search-bar { gap: 10px; }
}

/* ---------- App footer ---------- */
.app-footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ============================================================
   MOBILE NAV (bottom bar – for small screens)
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(13, 13, 20, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

@media (max-width: 680px) {
  .mobile-nav { display: flex; }
  .app-main { padding-bottom: 80px; }
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 4px;
  transition: color var(--transition);
}

.mobile-nav-btn svg { width: 22px; height: 22px; }
.mobile-nav-btn.active, .mobile-nav-btn:hover { color: var(--accent); }

/* ============================================================
   MISC
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* focus-visible ring for keyboard nav */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   FOOTER LINKS
   ============================================================ */
.footer-link {
  color: var(--accent);
  text-decoration: none;
  transition: text-decoration 0.2s;
}
.footer-link:hover {
  text-decoration: underline;
}

/* Contact helper text (hero, pricing, auth card) */
.landing-hero-contact,
.pricing-contact,
.auth-contact {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 12px;
}

/* ============================================================
   UPGRADE PAGE
   ============================================================ */

/* "Get More" button in quota bar */
.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-upgrade:hover {
  background: var(--accent);
  color: var(--text-invert);
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.4);
}

.btn-upgrade-urgent {
  background: var(--accent);
  color: var(--text-invert);
  animation: upgradeUrgentPulse 2s ease-in-out infinite;
}

@keyframes upgradeUrgentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(108, 92, 231, 0); }
}

/* Upgrade page container */
.upgrade-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 0 40px;
}

/* Header */
.upgrade-header {
  margin-bottom: 28px;
}

.upgrade-header .section-subtitle {
  margin-top: 6px;
}

/* Current usage bar */
.upgrade-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 32px;
  font-size: 0.875rem;
}

.upgrade-current-label {
  color: var(--text-secondary);
}

.upgrade-current-label strong {
  color: var(--text-primary);
}

.upgrade-current-usage {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Packages grid */
.upgrade-packages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .upgrade-packages {
    grid-template-columns: 1fr;
  }
}

/* Individual package card */
.upgrade-package {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px 24px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  user-select: none;
}

.upgrade-package:hover {
  border-color: rgba(108, 92, 231, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* Popular / best-value highlight */
.upgrade-package.popular {
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--bg-card), rgba(108, 92, 231, 0.06));
}

.upgrade-package.popular:hover {
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.3);
}

/* Selected state */
.upgrade-package.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25), 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* "Best Value" badge */
.upgrade-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--text-invert);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 99px;
  white-space: nowrap;
}

.upgrade-package-credits {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upgrade-package-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 4px;
}

.upgrade-package-per {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Payment form */
.upgrade-payment-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  max-width: 480px;
  margin: 0 auto;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.upgrade-form-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* Payment field wrapper */
.payment-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.payment-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.payment-field input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color var(--transition);
  width: 100%;
}

.payment-field input::placeholder {
  color: var(--text-muted);
}

.payment-field input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

/* Two-column row for expiry + CVC */
.payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Disclaimer text */
.payment-disclaimer {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* Full-width button utility */
.btn-block {
  width: 100%;
  justify-content: center;
}

/* Quota bar: ensure the Get More button fits nicely */
.quota-bar-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.quota-track {
  flex: 1;
  min-width: 80px;
}
