/* =====================================================
   Multipedia — Styles globaux
   Reset + Layout + Composants réutilisables
   ===================================================== */

@import url('./tokens.css');


/* ─── Reset ──────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }


/* ─── Typographie ────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

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

a:hover { color: var(--accent); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--text-accent);
}

pre {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
}


/* ─── Layout principal (sidebar + contenu) ───────────── */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) max(calc(100vw - var(--sidebar-width)), calc(var(--content-min) - var(--sidebar-width)));
  min-height: 100vh;
  min-width: var(--content-min);
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  overflow-y: auto;
  overflow-x: hidden;
}

.app-content {
  grid-column: 2;
  padding: var(--content-padding);
  padding-bottom: calc(var(--content-padding) + 72px);
  max-width: calc(var(--content-max) + var(--sidebar-width));
  width: 100%;
}


/* ─── Sidebar — Logo ─────────────────────────────────── */

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo-text {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.03em;
}


/* ─── Sidebar — Navigation ───────────────────────────── */

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.nav-section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: var(--font-semibold);
}

.nav-item.active svg { opacity: 1; }


/* ─── Sidebar — Footer utilisateur ──────────────────── */

.sidebar-footer {
  padding: var(--space-3) var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-user:hover { background: var(--bg-elevated); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--accent);
  flex-shrink: 0;
  text-transform: uppercase;
}

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

.user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}


/* ─── Boutons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn:active:not(:disabled) { transform: scale(0.97); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Variantes */
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-overlay);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error-dim);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

/* Tailles */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-full { width: 100%; }

.btn-icon {
  padding: var(--space-2);
  aspect-ratio: 1;
  border-radius: var(--radius-md);
}


/* ─── Formulaires ─────────────────────────────────────── */

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.form-label.required::after {
  content: ' *';
  color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  appearance: none;
}

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

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-strong);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.form-input.has-error,
.form-select.has-error,
.form-textarea.has-error {
  border-color: var(--error);
}

.form-input[readonly],
.form-input[disabled] {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border-subtle);
}

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

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.field-error {
  font-size: var(--text-xs);
  color: var(--error);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.form-checkbox input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}


/* ─── Cards ───────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-elevated);
}


/* ─── Badges ──────────────────────────────────────────── */
/* Usage : qualité vidéo (4K, 1080p), codecs, langues */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2em 0.55em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-amber {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-error {
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-muted {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

.badge-pill {
  border-radius: var(--radius-full);
  padding: 0.2em 0.7em;
}


/* ─── Indicateur de statut (point) ───────────────────── */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-dot.offline {
  background: var(--error);
}

.status-dot.pending {
  background: var(--warning);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); }
  50%       { opacity: 0.75; box-shadow: 0 0 0 5px rgba(251, 191, 36, 0); }
}


/* ─── Messages d'alerte ───────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.alert-error   { background: var(--error-dim);   color: var(--error);   border: 1px solid rgba(248, 113, 113, 0.25); }
.alert-success { background: var(--success-dim); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.25);  }
.alert-warning { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(251, 191, 36, 0.25);  }
.alert-info    { background: var(--info-dim);    color: var(--info);    border: 1px solid rgba(96, 165, 250, 0.25);   }


/* ─── Toast (notifications) ───────────────────────────── */

.toast {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  z-index: var(--z-toast);
  white-space: nowrap;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(12px);
  animation: toast-in var(--transition-base);
}

@keyframes toast-in {
  from { transform: translateX(-50%) translateY(12px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.toast-success { background: rgba(52, 211, 153, 0.14);  color: var(--success);      border: 1px solid rgba(52, 211, 153, 0.3);  }
.toast-error   { background: rgba(248, 113, 113, 0.14); color: var(--error);        border: 1px solid rgba(248, 113, 113, 0.3); }
.toast-info    { background: rgba(99, 102, 241, 0.14);  color: var(--text-accent);  border: 1px solid rgba(99, 102, 241, 0.3);  }


/* ─── Spinner de chargement ───────────────────────────── */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

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


/* ─── Modal ───────────────────────────────────────────── */

.modal-scrim {
  position: fixed;
  inset: 0;
  background: var(--bg-scrim);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 2 * var(--space-8));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  flex-shrink: 0;
}


/* ─── Contenu de la modal d'aide VLC ──────────────────── */

.vlc-help {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.vlc-help-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vlc-help-heading {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.vlc-help-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vlc-help-steps {
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.vlc-help-steps li {
  line-height: 1.6;
}

.vlc-help-code {
  background: var(--bg-muted, rgba(0,0,0,.3));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 11px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-secondary);
}

.vlc-help-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Titre de page avec actions ──────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  font-weight: var(--font-regular);
}


/* ─── Section title ───────────────────────────────────── */

.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}


/* ─── Empty state ─────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-20) var(--space-8);
  text-align: center;
}

.empty-state-icon {
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.empty-state-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 360px;
}


/* ─── Utilitaires ─────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono          { font-family: var(--font-mono); }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-muted    { color: var(--text-muted); }
.text-accent   { color: var(--text-accent); }
.text-amber    { color: var(--amber); }
.text-success  { color: var(--success); }
.text-error    { color: var(--error); }
.text-warning  { color: var(--warning); }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flex              { display: flex; }
.flex-col          { flex-direction: column; }
.items-center      { align-items: center; }
.justify-between   { justify-content: space-between; }
.gap-2             { gap: var(--space-2); }
.gap-3             { gap: var(--space-3); }
.gap-4             { gap: var(--space-4); }
.flex-1            { flex: 1; }

/* ─── Filter select component ────────────────────────────────────────────── */

.filter-select {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 3px var(--space-2);
  position: relative;
  min-height: 2rem;
}

.filter-select-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: var(--space-2);
  border-right: 1px solid var(--border-default);
  align-self: stretch;
  display: flex;
  align-items: center;
  margin-right: var(--space-1);
}

.filter-select-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-secondary);
  border: 1px solid color-mix(in srgb, var(--text-muted) 20%, transparent);
  white-space: nowrap;
}

.filter-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 0 1px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.filter-tag-remove:hover {
  opacity: 1;
}

.filter-select-add-wrap {
  position: relative;
}

.filter-select-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.filter-select-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  border-style: solid;
}

/* ─── Single-select variant ───────────────────────────────────────────────── */

.filter-single-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-1);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.filter-single-btn:hover {
  color: var(--text-primary);
}

.filter-single-btn svg {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.filter-single-btn.open svg {
  transform: rotate(180deg);
}

.filter-single-btn.has-value {
  color: var(--accent);
  font-weight: 600;
}

.filter-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  min-width: 130px;
  max-height: 220px;
  overflow-y: auto;
}

.filter-select-dropdown.open {
  display: flex;
}

.filter-option {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.filter-option:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ─── Genre tags (cards — movies & tv-shows) ─────────────────────────────── */

.genre-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
  border: 1px solid color-mix(in srgb, var(--text-muted) 20%, transparent);
  white-space: nowrap;
}

.genre-more-btn {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.genre-more-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* ─── Genre popup ─────────────────────────────────────────────────────────── */

.genre-popup {
  display: none;
  position: absolute;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-width: 200px;
}

.genre-popup.open {
  display: flex;
}

.genre-popup-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
  border: 1px solid color-mix(in srgb, var(--text-muted) 20%, transparent);
  white-space: nowrap;
}
.min-w-0           { min-width: 0; }
