/* ===== RESET ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== VARIABLES ===== */
:root {
  --red: #db3546;
  --red-dark: #b82a38;
  --black: #1a1a1a;
  --gray: #6b6b6b;
  --gray-light: #f2f2f2;
  --gray-mid: #e0e0e0;
  --border: #d0d0d0;
  --white: #ffffff;
  --bg: #ffffff;
  --bg-secondary: #f7f7f7;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--black);
  min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.left-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--black);
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#menu-btn:hover {
  background: var(--gray-light);
}

.logo {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.logo img {
  height: 32px;
  width: auto;
  display: block;
}

.center-section {
  flex: 1;
  max-width: 500px;
}

.search-bar {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  height: 38px;
  background: var(--bg-secondary);
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--red);
  background: var(--white);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 14px;
  font-size: 14px;
  color: var(--black);
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--gray);
}

#search-btn {
  background: var(--red);
  border: none;
  color: #fff;
  width: 44px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
  flex-shrink: 0;
}

#search-btn:hover {
  background: var(--red-dark);
}

.right-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0 14px;
  height: 34px;
  font-size: 13px;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  border-color: var(--red);
  color: var(--red);
}

.nav-link i {
  font-size: 16px;
}

/* Bulle (tooltip) au survol du lien d'action (ex. icône caméra "Upload a video") */
.nav-link[data-tip] { position: relative; }
.nav-link[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: #222;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

/* Bouton d'appel "Go Premium" (mène à la boutique). Pilule pleine rouge pour ressortir. */
.go-premium-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 20px;
  padding: 0 14px;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.go-premium-btn:hover { background: #c42f45; border-color: #c42f45; color: #fff; }
.go-premium-btn i { font-size: 16px; }
/* Sur mobile, le header est chargé : on ne garde que la couronne. */
@media (max-width: 768px) {
  .go-premium-btn span { display: none; }
  .go-premium-btn { padding: 0 10px; }
}

.right-section button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--black);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.15s;
}

.right-section button:hover {
  background: var(--gray-light);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ===== CATEGORIES ===== */
.categories {
  width: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.chip {
  background: var(--gray-mid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover {
  background: #c8c8c8;
}

.chip.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ===== LAYOUT ===== */
.main-container {
  display: flex;
  min-height: calc(100vh - 100px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  background: var(--white);
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--black);
  text-decoration: none;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.sidebar a:hover {
  background: var(--gray-light);
}

.sidebar a.active {
  background: #fceaec;
  color: var(--red);
  font-weight: 600;
}

.sidebar a i {
  font-size: 18px;
}

.sidebar hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 6px;
}

.sidebar-section {
  padding: 0 4px;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  padding: 10px 14px 6px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group {
  margin-bottom: 2px;
}

.filter-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--black);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s;
}

.filter-menu:hover {
  background: var(--gray-light);
}

.filter-menu::after {
  content: '\203A';
  font-size: 18px;
  color: #999;
  transition: transform 0.2s;
  display: inline-block;
}

details[open] > .filter-menu::after {
  transform: rotate(90deg);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px 2px 28px;
  font-size: 13px;
  color: var(--black);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}

.filter-checkbox:hover {
  background: var(--gray-light);
}


/* ===== MAIN CONTENT ===== */
.content {
  flex: 1;
  padding: 20px 24px;
  min-width: 0;
}

/* ===== FORMULAIRE DE SIGNALEMENT (watch page) ===== */
.report-form {
  margin: 10px 0 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  max-width: 480px;
}
.report-row { display: flex; gap: 18px; margin-bottom: 10px; font-size: 14px; }
.report-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.report-form textarea {
  width: 100%; min-height: 70px; padding: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  box-sizing: border-box; margin-bottom: 10px; resize: vertical;
}
.report-actions { display: flex; gap: 10px; align-items: center; }
.report-actions button { padding: 8px 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); }
.report-status { font-size: 13px; margin-top: 8px; }

/* ===== MENU QUALITÉ FLUID PLAYER (compact) ===== */
/* NB : ne PAS forcer `display` ici — Fluid bascule display none/block pour ouvrir/fermer le menu
   au clic. L'ordre décroissant vient de l'ordre des <source> dans le DOM (1080→480). */
.fluid_video_sources_list { padding: 4px !important; }
.fluid_video_source_list_item {
  padding: 6px 16px !important;
  line-height: 1.3 !important;
  font-size: 13px !important;
}
/* Bouton qualité : on retire l'icône "HD" figée et on affiche la qualité courante */
.fluid_button_video_source:before { background-image: none !important; content: '' !important; }
.fp_hd_source { display: none !important; }   /* masque le superscript "HD" du menu déroulant */
.fluid_button_video_source { width: auto !important; min-width: 28px; }
.fluid_button_video_source .fp-q-label {
  display: inline-block;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;        /* = hauteur des autres contrôles → alignement vertical */
  vertical-align: top;
  padding: 0 3px;
  white-space: nowrap;
}

/* ===== BANNIÈRE PUB (sidebar gauche, sous le Filter) ===== */
.ad-sidebar-left {
  padding: 16px 8px 8px;
  text-align: center;
  overflow: hidden;
}
.ad-sidebar-left ins {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

/* ===== SIDEBAR PUB (droite) ===== */
.ad-sidebar {
  width: 340px;            /* intérieur ~308px → une bannière 300px tient sans être coupée */
  flex-shrink: 0;
  padding: 20px 16px;
  border-left: 1px solid var(--border);
  background: var(--white);
  text-align: center;
  overflow: hidden;        /* sécurité : rien ne déborde sur le contenu */
}
.ad-sidebar ins {
  display: block;
  max-width: 100%;
  margin: 0 auto 16px;
}

/* ===== BANNIÈRE HORIZONTALE (au-dessus de la grille) ===== */
.ad-top {
  width: 100%;
  margin-bottom: 20px;
  text-align: center;
  overflow: hidden;
}
.ad-top:empty { display: none; }
.ad-top ins { display: inline-block; max-width: 100%; }

/* ===== BANNIÈRES WATCH PAGE ===== */
.ad-watch {
  width: 100%;
  text-align: center;
  margin: 0 0 16px;
  overflow: hidden;
}
.ad-watch:empty { display: none; }
.ad-watch ins { display: inline-block; max-width: 100%; }

.ad-watch-side {
  text-align: center;
  margin-bottom: 18px;
}
.ad-watch-side ins {
  display: block;
  max-width: 100%;
  margin: 0 auto 14px;
}

/* ===== AUCUNE PUB POUR LES PREMIUM (classe posée sur <html> par auth.js) =====
   Masque toutes les bannières et fait disparaître les colonnes pub sans laisser de "trous"
   (le contenu en flex se réétale ; la watch page se recentre sur la colonne vidéo). */
.ads-hidden .ad-top,
.ads-hidden .ad-sidebar,
.ads-hidden .ad-sidebar-left,
.ads-hidden .ad-watch,
.ads-hidden .watch-right { display: none !important; }
.ads-hidden .watch-layout { max-width: 728px; }

/* ===== VIDEO GRID ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 728px;   /* calée sur la largeur de la bannière du haut */
  margin: 0 auto;
}

/* ===== VIDEO CARD ===== */
.video-card {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s;
}

.video-card:hover {
  transform: translateY(-3px);
}

.video-card:hover .play-overlay {
  opacity: 1;
}

.thumbnail-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--gray-light);
  border-radius: 8px;
  overflow: hidden;
}

.thumbnail-wrapper video,
.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(219, 53, 70, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.play-overlay i {
  font-size: 44px;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.video-duration {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-info {
  padding: 10px 4px;
}

.video-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 12px;
  color: var(--gray);
}

.video-meta .channel-name {
  color: var(--red);
  font-weight: 600;
}

/* ===== PAGE DE VISIONNAGE (watch.html) ===== */
.watch-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  max-width: 1092px;        /* 728 (vidéo) + 24 (gap) + 320 (sidebar pub) */
  margin: 0 auto;
}

.watch-left {
  width: 728px;             /* calé sur la largeur de la bannière du dessus */
  max-width: 100%;
  flex-shrink: 0;
  min-width: 0;
}

.watch-right {
  width: 320px;
  flex-shrink: 0;
}

.video-player-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
}

/* Bandeau d'invitation premium par-dessus l'aperçu flouté (watch page) */
.premium-watch-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  pointer-events: none;            /* laisse cliquer/lire la vidéo en dessous */
}
.premium-watch-overlay button {
  pointer-events: auto;            /* …sauf le bouton */
  background: #e53950;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.premium-watch-overlay button:hover { background: #c9293f; }

/* Footer du site (contact + liens légaux) */
.site-footer {
  margin-top: 40px;
  padding: 22px 16px;
  border-top: 1px solid var(--border, #e5e5e5);
  background: var(--bg, #fff);
  color: #888;
  font-size: 13px;
}
.site-footer-inner {
  max-width: 1092px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.site-footer a { color: #888; text-decoration: none; }
.site-footer a:hover { color: var(--red, #e53950); text-decoration: underline; }

/* Bouton S'abonner (watch page) */
.subscribe-btn {
  margin-left: 14px;
  padding: 9px 18px;
  border: none;
  border-radius: 20px;
  background: #e53950;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.subscribe-btn:hover { background: #c9293f; }
.subscribe-btn.subscribed {
  background: #2a2a2a;
  color: #ddd;
}
.subscribe-btn:disabled { opacity: 0.6; cursor: default; }

/* Short : lecteur vertical 9:16, centré, limité à la hauteur de l'écran */
.video-player-wrapper.short {
  aspect-ratio: 9 / 16;
  width: auto;
  height: min(78vh, 760px);
  max-width: 100%;
  margin: 0 auto 14px;
}

.video-player-wrapper video,
.video-player-wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* ===== Overlay click-to-play pour iframe ===== */

.iframe-play-overlay {
  position: absolute;
  inset: 0;
  background: #000 center/cover no-repeat;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iframe-play-btn svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
  transition: transform 0.15s ease;
}

.iframe-play-overlay:hover .iframe-play-btn svg {
  transform: scale(1.1);
}

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

.iframe-loading {
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.iframe-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== Contrôles personnalisés du lecteur ===== */

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 8px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.video-player-wrapper.controls-visible .player-controls {
  opacity: 1;
  transform: translateY(0);
}

.video-player-wrapper:not(.controls-visible) {
  cursor: none;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
}

.progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
}

.progress-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--red);
  border-radius: 3px;
}

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

.control-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume-slider {
  width: 80px;
  accent-color: var(--red);
}

.time-display {
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.controls-spacer {
  flex: 1;
}

.quality-menu {
  position: relative;
}

.quality-toggle {
  /* bouton-texte : affiche la qualité courante (ex. 1080p60), largeur auto */
  width: auto;
  min-width: 52px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.quality-dropdown {
  position: absolute;
  bottom: 46px;
  right: 0;
  background: rgba(28, 28, 28, 0.95);
  border-radius: 8px;
  overflow: hidden;
  min-width: 140px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.quality-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.quality-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.quality-option.active {
  color: var(--red);
  font-weight: 600;
}

.quality-fps {
  font-size: 12px;
  color: #aaa;
}

.video-title-large {
  font-size: 19px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.4;
  margin-bottom: 6px;
}

.video-meta-large {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 14px;
}

/* ===== CHANNEL ROW ===== */
.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.channel-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

.channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-name-large {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
}

.channel-subs {
  font-size: 12px;
  color: var(--gray);
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.like-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.like-btn.liked {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ===== DESCRIPTION ===== */
.description-box {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
  background: var(--gray-light);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 24px;
  white-space: pre-wrap;
}

/* ===== COMMENTAIRES ===== */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 14px;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.comment-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  background: var(--bg-secondary);
  color: var(--black);
}

.comment-input:focus {
  border-color: var(--red);
  background: var(--white);
}

.comment-submit {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.comment-submit:hover {
  background: var(--red-dark);
}

.comment {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.c-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.c-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.c-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
}

.c-date {
  font-size: 11px;
  font-weight: 400;
  color: #999;
  margin-left: 6px;
}

.c-text {
  font-size: 13px;
  color: var(--gray);
  margin-top: 2px;
  line-height: 1.5;
}

/* ===== COMMENTAIRES VERROUILLÉS (visiteurs / non-membres) ===== */
.comment-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--gray-light);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--gray);
}

.comment-locked a {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.comment-locked a:hover {
  text-decoration: underline;
}

/* ===== VIDEOS CONNEXES ===== */
.related-section {
  margin-top: 32px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 16px;
}

/* ===== Grille Shorts (cartes verticales 9:16) ===== */
.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.short-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
.short-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.short-thumb img,
.short-thumb .short-clip {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.short-thumb .short-clip {
  position: absolute;
  inset: 0;
}
.short-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
}
.short-card-title {
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.short-card-meta {
  font-size: 12px;
  color: var(--text-secondary, #888);
  margin-top: 2px;
}

/* ===== Feed Shorts (TikTok) ===== */
body.feed-mode .header,
body.feed-mode .main-container { display: none !important; }
body.feed-mode { overflow: hidden; }

.shorts-feed {
  position: fixed;
  inset: 0;
  background: #000;
  overflow-y: scroll;
  overflow-x: hidden;        /* pas de défilement horizontal */
  touch-action: pan-y;       /* au doigt : glissement vertical uniquement */
  scroll-snap-type: y mandatory;
  z-index: 1000;
}
.feed-back {
  position: fixed;
  top: 16px; left: 16px;
  z-index: 1100;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.short-slide {
  position: relative;
  overflow: hidden;          /* clippe le fond zoomé / le cadre plus large que l'écran */
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.short-stage {
  position: relative;
  z-index: 1;                /* au-dessus du fond flou plein écran (.short-bg) */
  height: 88vh;
  aspect-ratio: 9 / 16;
  background: transparent;   /* le letterbox laisse voir le fond flou derrière */
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
}
.short-video {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;
  background: transparent;   /* laisse voir le fond flou derrière (au lieu du noir) */
  display: block;
  cursor: pointer;
}

/* Fond d'ambiance : la MÊME vidéo, floutée + zoomée pour remplir le cadre (cover).
   Remplace les bandes noires du letterbox par des couleurs floues. */
.short-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(100px) brightness(0.85) saturate(1.2);
  transform: scale(1.6);     /* zoom fort : masque les bords fondus par un flou aussi intense */
  z-index: 0;
  pointer-events: none;
}
.short-playicon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff; font-size: 64px;
  opacity: 1; transition: opacity 0.2s;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.short-actions {
  position: absolute;
  right: 10px; bottom: 96px;
  display: flex; flex-direction: column;
  gap: 18px; z-index: 2;
}
.sa-btn {
  background: none; border: none; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
}
.sa-btn i { font-size: 30px; }
.sa-btn .sa-count, .sa-btn .sa-label { font-size: 12px; }
.sa-like.liked i { color: #e53950; }
.sa-fav.faved i { color: #f5c518; }
.sa-btn.reported i { color: #f0c000; }
.short-info {
  position: absolute;
  left: 0; right: 54px; bottom: 14px;
  padding: 0 14px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  z-index: 2;
}
.short-info-channel { font-weight: 600; font-size: 14px; }
.short-info-title {
  font-size: 13px; opacity: 0.92; line-height: 1.35;
  max-height: 3.6em; overflow: hidden; margin-top: 2px;
}
.short-comments {
  width: 360px; max-width: 32vw;
  height: 88vh;
  background: #fff; color: #111;
  border-radius: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.short-comments-head {
  padding: 14px 16px; font-weight: 600; font-size: 15px;
  border-bottom: 1px solid #eee;
}
.short-comments-list { flex: 1; overflow-y: auto; padding: 12px 16px; }
.sc-comment { display: flex; gap: 10px; margin-bottom: 14px; }
.sc-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #eee; flex: 0 0 32px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 16px;
}
.sc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sc-author { font-size: 13px; font-weight: 600; }
.sc-date { font-weight: 400; color: #888; font-size: 12px; margin-left: 6px; }
.sc-text { font-size: 14px; margin-top: 2px; }
.sc-empty { color: #888; font-size: 13px; }
.short-comment-form {
  display: flex; gap: 8px;
  padding: 12px 16px; border-top: 1px solid #eee;
}
.short-comment-form .sc-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid #ddd; border-radius: 18px; outline: none;
}
.short-comment-locked {
  padding: 12px 16px; color: #888; font-size: 13px;
  border-top: 1px solid #eee;
}
@media (max-width: 900px) {
  .short-comments { display: none; }
}

.related-card {
  display: flex;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 14px;
  border-radius: 8px;
  transition: background 0.15s;
  padding: 4px;
}

.related-card:hover {
  background: var(--gray-light);
}

/* En grille (sous les commentaires) : cartes verticales */
.related-grid .related-card {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
  padding: 0;
}

.related-grid .related-card:hover {
  background: transparent;
}

.related-grid .rel-thumb {
  width: 100%;
}

.rel-thumb {
  width: 130px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: var(--gray-mid);
}

.rel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rel-dur {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.rel-info {
  min-width: 0;
}

.rel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.rel-meta {
  font-size: 11px;
  color: var(--gray);
}

/* ===== PAGES AUTH (connexion / inscription / profil) ===== */
.auth-page {
  display: flex;
  justify-content: center;
  padding: 50px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.auth-title {
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-title i {
  color: var(--red);
}

.auth-subtitle {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 20px;
}

.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  background: var(--bg-secondary);
  color: var(--black);
}

.auth-card input:focus {
  border-color: var(--red);
  background: var(--white);
}

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}

.radio-option input {
  width: auto;
  margin: 0;
}

.auth-btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}

.auth-btn:hover {
  background: var(--red-dark);
}

.auth-btn-secondary {
  background: var(--gray-mid);
  color: var(--black);
  margin-top: 14px;
  width: auto;
  display: inline-block;
  padding: 10px 18px;
}

.auth-btn-secondary:hover {
  background: #c8c8c8;
}

.auth-btn-danger {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
  margin-top: 24px;
}

.auth-btn-danger:hover {
  background: var(--red);
  color: #fff;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--gray);
  margin-top: 18px;
}

.auth-switch a {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fceaec;
  color: var(--red-dark);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-tabs {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  background: var(--bg-secondary);
  border: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray);
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: var(--red);
  color: #fff;
}

.auth-tab-content {
  display: none;
}

.auth-tab-content.active {
  display: block;
}

/* ===== PROFIL ===== */
.profile-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-info {
  background: var(--gray-light);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}

.profile-info p {
  font-size: 13px;
  color: var(--black);
  padding: 6px 0;
}

.profile-info p strong {
  color: var(--gray);
  font-weight: 600;
  margin-right: 6px;
}

/* ===== RESPONSIVE ===== */
/* ===== Rubrique "Shorts" de l'accueil (rangée horizontale au-dessus de la grille) ===== */
.home-shorts { max-width: 728px; margin: 4px auto 26px; }   /* même boîte centrée que .video-grid */
.home-shorts-head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 19px; font-weight: 700; color: inherit; text-decoration: none;
  margin-bottom: 12px;
}
.home-shorts-head .uil-play { color: var(--red, #e53950); }
.home-shorts-head .uil-angle-right { color: #999; font-size: 22px; }
.home-shorts-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 4 shorts, dans la même boîte 728px que la grille */
  gap: 20px;                               /* même gap que .video-grid */
}
.home-short-card { text-decoration: none; color: inherit; }
.hs-thumb {
  width: 100%; aspect-ratio: 9 / 16;
  border-radius: 10px; overflow: hidden; background: var(--gray-light, #eee);
}
.hs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-short-card:hover .hs-thumb { opacity: .92; }
.hs-title {
  font-size: 13px; margin-top: 6px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Rubrique Shorts sur mobile : 4 shorts au-dessus de la grille 2 colonnes (gap réduit pour qu'ils tiennent). */
@media (max-width: 768px) {
  .home-shorts-row { gap: 8px; }
  .hs-title { font-size: 12px; }
}

/* Overlay du menu mobile (drawer). Masqué hors mobile. */
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
  /* Colonne pub : masquée. Sidebar : transformée en TIROIR coulissant (ouvert par le ☰). */
  .ad-sidebar { display: none; }

  .sidebar {
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    margin: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1000;
    background: #fff;
    overflow-y: auto;
    box-shadow: 2px 0 18px rgba(0, 0, 0, .3);
    padding: 14px 14px 30px;
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
  }
  .sidebar-overlay.open { opacity: 1; visibility: visible; }

  /* Header sur DEUX lignes : ligne 1 = ☰ + logo (taille normale) + avatar à droite ;
     ligne 2 = barre de recherche pleine largeur. → logo bien visible ET recherche large. */
  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px 10px;
  }
  .left-section { order: 1; }
  .right-section { order: 2; margin-left: auto; }   /* avatar repoussé à droite de la ligne 1 */
  .center-section {
    order: 3;
    flex-basis: 100%;       /* passe à la ligne suivante, pleine largeur */
    max-width: none;
    min-width: 0;
  }
  .logo img { height: 32px; max-width: none; }      /* logo pleine taille */
  .search-bar { width: 100%; }
  .search-bar input { min-width: 0; }

  .nav-link span {
    display: none;
  }

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

  .content {
    padding: 12px;
  }

  .watch-layout {
    flex-direction: column;
  }

  .watch-right {
    width: 100%;
  }

  /* Vidéo pleine largeur (bord à bord) : on annule le padding de .content pour le lecteur seul ;
     le titre / les commentaires gardent leur marge. (.content a padding:12px sur mobile.) */
  .watch-left .video-player-wrapper {
    margin-left: -12px;
    margin-right: -12px;
    width: calc(100% + 24px);
    border-radius: 0;
  }


  .rel-thumb {
    width: 120px;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 12px;
  }
}
