/* ============================================================
   STREAMVAULT — style.css
   Premium Editorial Dark Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --black:       #07070f;
  --surface-1:   #0d0d1a;
  --surface-2:   #121220;
  --surface-3:   #191928;
  --surface-4:   #202032;

  --border-soft: rgba(255,255,255,0.055);
  --border-med:  rgba(255,255,255,0.10);
  --border-hard: rgba(255,255,255,0.18);

  --accent:      #7c6cfc;
  --accent-2:    #60a5fa;
  --accent-glow: rgba(124,108,252,0.20);
  --accent-dim:  rgba(124,108,252,0.07);
  --gradient:    linear-gradient(135deg, #7c6cfc 0%, #60a5fa 100%);

  --text-100: #f0f0f6;
  --text-200: #b0b0c8;
  --text-300: #72728a;
  --text-400: #44445a;

  --green: #34d399;
  --red:   #f87171;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Outfit', sans-serif;
  --font-mono:    'Fira Code', monospace;

  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  26px;

  --shadow-md:     0 8px 32px rgba(0,0,0,0.55);
  --shadow-lg:     0 24px 64px rgba(0,0,0,0.65);
  --shadow-accent: 0 0 40px var(--accent-glow);

  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.15s var(--ease);
  --t-med:  0.25s var(--ease);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--text-100);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Ambient top glow */
body::before {
  content: '';
  position: fixed;
  top: -25vh; left: 50%;
  transform: translateX(-50%);
  width: 80vw; height: 60vh;
  background: radial-gradient(ellipse, rgba(124,108,252,0.055) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 3px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 200;
  height: 62px;
  display: flex; align-items: center;
  padding: 0 32px;
  background: rgba(7,7,15,0.80);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--border-soft);
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 25px; letter-spacing: 0.04em;
  transition: opacity var(--t-fast);
}
.nav-logo:hover { opacity: 0.75; }

.nav-logo-mark {
  width: 30px; height: 30px;
  background: var(--gradient);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
  box-shadow: 0 0 20px var(--accent-glow);
  flex-shrink: 0;
}
.nav-logo-text em { font-style: normal; color: var(--accent); }

.nav-spacer { flex: 1; }

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

.nav-link {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text-300);
  transition: all var(--t-fast);
}
.nav-link:hover { color: var(--text-100); background: var(--surface-3); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600;
  transition: all var(--t-med);
  white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
  transform: translateX(-150%);
  transition: transform 0.55s var(--ease);
}
.btn:hover::after { transform: translateX(150%); }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,108,252,0.38); }
.btn-primary:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-100);
  border: 1px solid var(--border-med);
}
.btn-secondary:hover { background: var(--surface-4); border-color: var(--border-hard); }

.btn-sm { padding: 6px 15px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 72px 32px 56px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(124,108,252,0.09) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.014) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.014) 40px);
  pointer-events: none;
}

.hero-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(124,108,252,0.18);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.hero-pill::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.25} }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(54px, 9vw, 100px);
  letter-spacing: 0.035em;
  line-height: 1.0;
  margin-bottom: 16px;
}
.hero h1 em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 17px; font-weight: 300;
  color: var(--text-300);
  max-width: 520px; margin: 0 auto;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar-wrap { padding: 0 32px; margin-bottom: 22px; position: relative; z-index: 1; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}

.toolbar-sep { width: 1px; height: 18px; background: var(--border-soft); margin: 0 6px; }

.filter-select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface-3);
  color: var(--text-100);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 7px 30px 7px 12px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--t-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2372728a' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-select:focus { outline: none; border-color: var(--accent); background-color: var(--surface-4); }
.filter-select option { background: var(--surface-3); }

.results-badge {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-400);
  padding: 4px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
}

.label-text {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-400);
}

/* ============================================================
   GRID
   ============================================================ */
.grid-wrap { padding: 0 32px 80px; position: relative; z-index: 1; }

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

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-med);
  animation: cardIn 0.5s var(--ease) both;
}
.card:hover {
  border-color: var(--border-med);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-video {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-1);
  overflow: hidden;
}
.card-video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
  pointer-events: none;
}
.card-thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-video::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 50px;
  background: linear-gradient(transparent, rgba(13,13,26,0.65));
  pointer-events: none;
}

.card-body { padding: 15px 17px 13px; }

.card-cat {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.09em; text-transform: uppercase;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(124,108,252,0.14);
  margin-bottom: 7px;
}

.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-100); line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 12px;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid var(--border-soft);
}

.card-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-400); }

/* Like */
.card-actions {
  display: flex; 
  align-items: center; 
  gap: 8px; /* Spazio tra download e like */
}

/* Stile base per entrambi i pulsantini a pillola */
.action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 99px;
  background: var(--surface-3); border: 1px solid var(--border-soft);
  color: var(--text-300); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t-fast);
}
.action-icon { font-size: 13px; transition: transform var(--t-fast); }

/* Download Hover */
.download-btn:hover {
  background: rgba(96,165,250,0.07); 
  border-color: rgba(96,165,250,0.22); 
  color: var(--accent-2);
}
.download-btn:hover .action-icon { transform: translateY(-2px); }

/* Like Hover & Active */
.like-btn:hover { background: rgba(248,113,113,0.07); border-color: rgba(248,113,113,0.22); color: var(--red); }
.like-btn.liked { background: rgba(248,113,113,0.09); border-color: rgba(248,113,113,0.28); color: var(--red); }
.like-btn:hover .like-icon, .like-btn.liked .like-icon { transform: scale(1.4); }
/* ============================================================
   STATES
   ============================================================ */
.state {
  grid-column: 1/-1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 90px 24px; text-align: center; gap: 10px;
}
.state-icon { font-size: 42px; margin-bottom: 6px; }
.state h3 { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.04em; color: var(--text-200); }
.state p { font-size: 14px; color: var(--text-400); max-width: 260px; }

.spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--surface-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   UPLOAD PAGE
   ============================================================ */
.upload-wrap {
  min-height: calc(100vh - 62px);
  display: grid; place-items: start center;
  padding: 52px 20px;
  position: relative; z-index: 1;
}

.upload-card {
  width: 100%; max-width: 570px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.upload-card::before {
  content: ''; display: block;
  height: 3px; background: var(--gradient);
}

.upload-header { padding: 28px 30px 22px; }
.upload-header h2 {
  font-family: var(--font-display);
  font-size: 30px; letter-spacing: 0.04em;
  color: var(--text-100); margin-bottom: 5px;
}
.upload-header p { font-size: 14px; color: var(--text-300); }

.upload-body {
  padding: 24px 30px 30px;
  border-top: 1px solid var(--border-soft);
}

/* ============================================================
   FORM
   ============================================================ */
.form-group { margin-bottom: 19px; }

.form-label {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-300); margin-bottom: 7px;
}

.form-input, .form-select-s {
  width: 100%; padding: 11px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  color: var(--text-100);
  font-family: var(--font-body); font-size: 15px;
  transition: all var(--t-fast);
}
.form-input::placeholder { color: var(--text-400); }
.form-input:focus, .form-select-s:focus {
  outline: none; border-color: var(--accent);
  background: var(--surface-4);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select-s {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2372728a' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 36px;
}
.form-select-s option { background: var(--surface-3); }

/* Drop zone */
.drop-zone {
  position: relative;
  border: 2px dashed var(--border-med);
  border-radius: var(--r-md);
  padding: 38px 20px; text-align: center;
  background: var(--surface-1);
  transition: all var(--t-med); cursor: pointer;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-dim); }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.drop-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.drop-title { font-size: 15px; font-weight: 600; color: var(--text-200); margin-bottom: 4px; }
.drop-sub { font-size: 13px; color: var(--text-400); }

.file-chip {
  display: none; align-items: center; gap: 8px;
  margin-top: 11px; padding: 8px 13px;
  background: rgba(52,211,153,0.07);
  border: 1px solid rgba(52,211,153,0.18);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--green);
}
.file-chip.show { display: flex; animation: cardIn 0.3s var(--ease); }

/* ============================================================
   PROGRESS
   ============================================================ */
.prog-wrap { display: none; margin-top: 20px; }
.prog-wrap.show { display: block; animation: cardIn 0.3s var(--ease); }

.prog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.prog-label { font-size: 13px; font-weight: 600; color: var(--text-200); }
.prog-pct { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }

.prog-track { width: 100%; height: 5px; background: var(--surface-4); border-radius: 99px; overflow: hidden; }

.prog-fill {
  height: 100%; width: 0%;
  background: var(--gradient); border-radius: 99px;
  transition: width 0.3s ease; position: relative;
}
.prog-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(250%); } }

.prog-status {
  margin-top: 7px; display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-400);
}
.status-dot {
  width: 5px; height: 5px; background: var(--accent);
  border-radius: 50%; animation: blink 1s infinite; flex-shrink: 0;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: none; align-items: flex-start; gap: 10px;
  padding: 12px 15px; border-radius: var(--r-sm);
  font-size: 14px; margin-top: 16px;
}
.alert.show { display: flex; animation: cardIn 0.3s var(--ease); }
.alert-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.alert-ok { background: rgba(52,211,153,0.07); border: 1px solid rgba(52,211,153,0.18); color: var(--green); }
.alert-err { background: rgba(248,113,113,0.07); border: 1px solid rgba(248,113,113,0.18); color: var(--red); }

/* ============================================================
   FILE QUEUE (multi-upload)
   ============================================================ */
.file-queue {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.queue-item {
  padding: 14px;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  animation: cardIn 0.25s var(--ease);
}
.queue-item.queue-uploading {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.queue-item.queue-done {
  border-color: rgba(52,211,153,0.3);
  opacity: 0.7;
}
.queue-item.queue-error {
  border-color: rgba(248,113,113,0.3);
}
.queue-item-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.queue-item-name {
  font-size: 13px; font-weight: 600;
  color: var(--text-200);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; margin-right: 10px;
}
.queue-item-remove {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-4);
  border: none;
  color: var(--text-300);
  font-size: 12px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.queue-item-remove:hover { background: var(--red); color: #fff; }
.queue-item-status {
  font-size: 16px; font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}
.queue-item-err { color: var(--red); }
.queue-item-fields {
  display: flex; gap: 8px;
}
.queue-item-fields .queue-title {
  flex: 2;
  padding: 8px 10px;
  font-size: 13px;
}
.queue-item-fields .queue-cat {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
}
.queue-item-prog {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
}
.queue-item-prog .prog-track { flex: 1; }
.queue-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}
.queue-item-errmsg {
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
}
.queue-default-cat {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}
.queue-progress {
  margin-bottom: 12px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 22px 32px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  position: relative; z-index: 1;
}
.footer-copy { font-size: 13px; color: var(--text-400); }
.footer-copy strong { color: var(--text-300); }
.footer-links { display: flex; gap: 20px; }
.footer-link { font-size: 13px; color: var(--text-400); transition: color var(--t-fast); }
.footer-link:hover { color: var(--text-200); }

/* ============================================================
   VIDEO PAGE
   ============================================================ */
.vp-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  position: relative; z-index: 1;
}

.vp-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-1);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lg);
}
.vp-player iframe {
  width: 100%; height: 100%;
  border: none;
}

.vp-info {
  padding: 24px 0;
}

.vp-cat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(124,108,252,0.18);
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.vp-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: var(--text-100);
  margin-bottom: 10px;
}

.vp-meta {
  margin-bottom: 20px;
}
.vp-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-400);
}

.vp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.vp-actions .action-btn {
  padding: 8px 18px;
  font-size: 14px;
}
.vp-actions .like-label {
  margin-left: 2px;
}
.fullscreen-btn:hover {
  background: rgba(124,108,252,0.07);
  border-color: rgba(124,108,252,0.22);
  color: var(--accent);
}

/* ============================================================
   CARD OVERLAY LINK (clickable cards)
   ============================================================ */
.card-overlay-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.15);
  transition: background var(--t-med);
  cursor: pointer;
}
.card-overlay-link:hover {
  background: rgba(0,0,0,0.4);
}
.card-overlay-link .play-icon {
  opacity: 0;
  transition: all var(--t-med);
}
.card-overlay-link:hover .play-icon {
  opacity: 1;
  transform: scale(1.1);
}
.play-icon {
  width: 56px; height: 56px;
  background: var(--gradient);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 0 30px var(--accent-glow);
}
.card-title-link {
  display: block;
  transition: color var(--t-fast);
}
.card-title-link:hover .card-title {
  color: var(--accent);
}

/* ============================================================
   REQUESTS
   ============================================================ */
.req-form-wrap {
  padding: 0 32px;
  margin-bottom: 28px;
  position: relative; z-index: 1;
}
.req-search-note {
  max-width: 700px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(124,108,252,0.18);
  border-radius: var(--r-md);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text-200);
}
.req-search-note a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.req-search-note a:hover { color: var(--text-100); }
.req-search-note-icon { font-size: 18px; flex-shrink: 0; }
.req-form-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.req-form-card::before {
  content: ''; display: block;
  height: 3px; background: var(--gradient);
}
.req-form-header {
  padding: 20px 24px 14px;
}
.req-form-header h3 {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 0.04em;
  color: var(--text-100);
}
.req-form-body {
  padding: 0 24px 24px;
}
.req-textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}
.req-form-row {
  display: flex; gap: 12px;
}
.req-img-upload {
  display: flex; align-items: center; gap: 10px;
}
.req-img-hint {
  font-size: 12px; color: var(--text-400);
}
.req-img-preview {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.req-img-thumb {
  position: relative;
  width: 80px; height: 80px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.req-img-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.req-img-remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff; font-size: 10px;
  cursor: pointer;
  display: grid; place-items: center;
}
.req-img-remove:hover { background: var(--red); }

/* Request list */
.req-list-wrap {
  padding: 0 32px 40px;
  position: relative; z-index: 1;
}
.req-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: 14px;
}
.req-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  animation: cardIn 0.3s var(--ease);
}
.req-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.req-card-user {
  display: flex; align-items: center; gap: 10px;
}
.req-card-name {
  font-size: 14px; font-weight: 600;
  color: var(--accent);
}
.req-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-400);
}
.req-card-desc {
  font-size: 14px;
  color: var(--text-200);
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-line;
}
.req-card-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.req-meta-item {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.05em;
  color: var(--text-300);
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  padding: 3px 9px;
  border-radius: 99px;
}
.req-card-images {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.req-card-img {
  width: 100px; height: 100px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: opacity var(--t-fast);
}
.req-card-img:hover { opacity: 0.8; }

/* Request card actions */
.req-card-actions {
  display: flex; gap: 8px; align-items: center;
}

/* Section titles */
.req-section-title {
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: 0.04em;
  color: var(--text-200);
  max-width: 700px;
  margin: 0 auto 14px;
}
.req-solved-title {
  color: var(--text-300);
}

/* Solved cards */
.req-card-solved {
  opacity: 0.7;
  border-color: rgba(52,211,153,0.15);
}
.req-card-desc-solved {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.req-solved-badge {
  font-size: 12px; font-weight: 600;
  color: var(--green);
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.2);
  padding: 2px 10px;
  border-radius: 99px;
}

/* Resolve page */
.resolve-info {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
}
.resolve-req-info {
  display: flex; flex-direction: column; gap: 8px;
}

/* Nav active link */
.nav-link.active {
  color: var(--text-100);
  background: var(--surface-3);
}

/* ============================================================
   SEARCH BY IMAGE
   ============================================================ */
.search-wrap { padding: 0 32px 40px; position: relative; z-index: 1; }
.search-card { max-width: 700px; margin: 0 auto 24px; }
.search-preview { max-width: 700px; margin: 12px auto 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.search-preview-img { max-width: 150px; max-height: 150px; border-radius: var(--r-md); border: 1px solid var(--border-soft); }
.search-status { max-width: 700px; margin: 20px auto; text-align: center; color: var(--text-300); }
.search-results { max-width: 700px; margin: 0 auto; }
.search-section-title { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.04em; color: var(--green); margin-bottom: 14px; }
.search-section-maybe { color: var(--text-300); margin-top: 24px; }
.search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.search-result { display: block; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; transition: all var(--t-fast); text-decoration: none; }
.search-result:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.search-result-img { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-1); }
.search-result-thumb { width: 100%; height: 100%; object-fit: cover; }
.search-result-nothumb { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-400); font-size: 12px; }
.search-result-info { padding: 10px 12px; }
.search-result-title { display: block; font-size: 13px; font-weight: 600; color: var(--text-100); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-sim { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }

/* ============================================================
   LAYOUT — CONTENT + CHAT SIDEBAR
   ============================================================ */
.app-layout {
  display: flex;
  min-height: calc(100vh - 62px);
  position: relative;
}
.app-content {
  flex: 1;
  min-width: 0;
  transition: margin-right 0.3s var(--ease);
}

/* ============================================================
   CHAT SIDEBAR (Twitch-style)
   ============================================================ */
.chat-sidebar {
  width: 340px;
  flex-shrink: 0;
  background: var(--surface-1);
  border-left: 1px solid var(--border-med);
  display: none;
  flex-direction: column;
  height: calc(100vh - 62px);
  position: sticky;
  top: 62px;
  z-index: 100;
}
.chat-sidebar.open {
  display: flex;
}

/* Chat tab (visible when collapsed) */
.chat-tab {
  display: none;
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-right: none;
  border-radius: var(--r-md) 0 0 var(--r-md);
  padding: 14px 10px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all var(--t-med);
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}
.chat-tab.show { display: flex; }
.chat-tab:hover {
  background: var(--surface-3);
  padding-right: 14px;
}
.chat-tab-icon { font-size: 22px; }
.chat-tab-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-300);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Header */
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
  flex-shrink: 0;
}
.chat-header-title {
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: 0.04em;
  color: var(--text-100);
}
.chat-header-actions { display: flex; gap: 6px; }
.chat-header-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  color: var(--text-300);
  font-size: 14px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--t-fast);
  text-decoration: none;
}
.chat-header-btn:hover {
  background: var(--surface-4);
  color: var(--text-100);
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.chat-msg {
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  animation: cardIn 0.2s var(--ease);
}
.chat-msg-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 3px;
}
.chat-msg-name {
  font-size: 12px; font-weight: 600;
  color: var(--accent);
}
.chat-msg-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-400);
}
.chat-msg-text {
  font-size: 13px;
  color: var(--text-200);
  word-break: break-word;
  line-height: 1.45;
}
.chat-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--r-sm);
  margin-top: 5px;
  cursor: pointer;
  transition: opacity var(--t-fast);
}
.chat-img:hover { opacity: 0.85; }

/* Footer */
.chat-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  flex-shrink: 0;
}
.chat-username {
  width: 100%;
  padding: 6px 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  color: var(--text-100);
  font-family: var(--font-body);
  font-size: 12px;
  margin-bottom: 8px;
  transition: border-color var(--t-fast);
}
.chat-username:focus { outline: none; border-color: var(--accent); }
.chat-username::placeholder { color: var(--text-400); }

.chat-input-row {
  display: flex; gap: 6px; align-items: center;
}
.chat-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  color: var(--text-100);
  font-family: var(--font-body);
  font-size: 13px;
  transition: border-color var(--t-fast);
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-400); }

.chat-img-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border-med);
  color: var(--accent);
  font-size: 20px; font-weight: 700;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--t-fast);
  flex-shrink: 0;
  line-height: 1;
}
.chat-img-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: scale(1.1);
}

.chat-send-btn {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  background: var(--gradient);
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.chat-send-btn:hover {
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Fullscreen chat */
.chat-fullscreen-wrap {
  height: calc(100vh - 62px);
  display: flex;
  justify-content: center;
}
.chat-sidebar.fullscreen {
  width: 100%;
  max-width: 800px;
  height: 100%;
  position: relative;
  top: 0;
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .chat-sidebar {
    position: fixed;
    top: 62px; right: 0;
    width: 320px;
    z-index: 300;
    box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  }
}
@media (max-width: 640px) {
  .nav { padding: 0 16px; height: 56px; }
  .hero { padding: 52px 16px 40px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .toolbar-wrap, .grid-wrap { padding-left: 16px; padding-right: 16px; }
  .toolbar { gap: 8px; }
  .toolbar-sep, .results-badge { display: none; }
  .video-grid { grid-template-columns: 1fr; gap: 14px; }
  .upload-header, .upload-body { padding-left: 20px; padding-right: 20px; }
  .footer { padding: 18px 16px; }
  .vp-wrap { padding: 16px 16px 32px; }
  .vp-player { border-radius: var(--r-md); }
  .vp-title { font-size: 24px; }
  .vp-actions { flex-wrap: wrap; }
  .chat-sidebar { width: 100%; }
  .chat-tab { top: auto; bottom: 20px; right: 16px; transform: none;
    flex-direction: row; border-radius: var(--r-md);
    padding: 10px 16px; border-right: 1px solid var(--border-med); }
  .chat-tab-label { writing-mode: horizontal-tb; }
  .queue-item-fields { flex-direction: column; }
  .req-form-wrap, .req-list-wrap { padding-left: 16px; padding-right: 16px; }
  .req-form-row { flex-direction: column; gap: 0; }
}
