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

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #212121;
  --bg-hover: #2d2d2d;
  --text-primary: #f1f1f1;
  --text-secondary: #aaaaaa;
  --accent-gold: #ffd700;
  --accent-orange: #ff6b35;
  --accent-blue: #3ea6ff;
  --accent-red: #ff4444;
  --accent-green: #00c853;
  --accent-purple: #9c27b0;
  --border-radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Header */
header {
  background: linear-gradient(
    180deg,
    rgba(15, 15, 15, 0.98) 0%,
    rgba(15, 15, 15, 0.9) 100%
  );
  backdrop-filter: blur(10px);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  font-size: 32px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.header-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-secondary);
  transition: all 0.2s;
  font-size: 14px;
}

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

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

.logo-text {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--accent-gold) 0%,
    var(--accent-orange) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-info {
  color: var(--text-secondary);
  font-size: 14px;
}

.back-btn {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-secondary);
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Main content */
main {
  padding: 24px 32px;
  max-width: 1800px;
  margin: 0 auto;
}

/* Filters Section */
.filters {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  opacity: 0.5;
}

.search-box input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.search-box input::placeholder {
  color: var(--text-secondary);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  border-radius: 50%;
  transition: all 0.2s;
}

.clear-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--accent-gold) 0%,
    var(--accent-orange) 100%
  );
  color: #000;
  border-color: transparent;
}

.filter-btn span {
  font-size: 14px;
}

/* Champion filter button special style */
.filter-btn.champion-btn {
  border-color: rgba(156, 39, 176, 0.3);
}

.filter-btn.champion-btn:hover {
  border-color: rgba(156, 39, 176, 0.5);
  background: rgba(156, 39, 176, 0.2);
}

.filter-btn.champion-btn.active {
  background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
  border-color: transparent;
}

.sort-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-dropdown label {
  color: var(--text-secondary);
  font-size: 13px;
}

.sort-dropdown select {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-dropdown select:focus {
  outline: none;
  border-color: var(--accent-gold);
}

/* Favorite Button on Card */
.video-thumbnail .favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  z-index: 10;
}

.video-card:hover .favorite-btn {
  opacity: 1;
}

.video-thumbnail .favorite-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.video-thumbnail .favorite-btn.active {
  opacity: 1;
  color: var(--accent-gold);
}

/* Status Badge */
.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  z-index: 5;
}

.status-badge.complete {
  background: var(--accent-green);
  color: #000;
}

.status-badge.in-progress {
  background: var(--accent-blue);
  color: #fff;
}

/* Champion Badge */
.champion-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  z-index: 5;
}

.champion-badge.emilien {
  background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
  color: #fff;
}

/* Processed Badge */
.processed-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  z-index: 6;
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: #fff;
}

/* When both status badge and processed badge exist, move processed badge down */
.video-thumbnail .status-badge + .champion-badge + .processed-badge,
.video-thumbnail .status-badge ~ .processed-badge {
  top: auto;
  bottom: 50px;
  left: 10px;
}

/* Processed filter button style */
.filter-btn.processed-filter-btn {
  border-color: rgba(76, 175, 80, 0.3);
}

.filter-btn.processed-filter-btn:hover {
  border-color: rgba(76, 175, 80, 0.5);
  background: rgba(76, 175, 80, 0.2);
}

.filter-btn.processed-filter-btn.active {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  border-color: transparent;
}

/* Unprocessed filter button style */
.filter-btn.unprocessed-filter-btn {
  border-color: rgba(255, 152, 0, 0.3);
}

.filter-btn.unprocessed-filter-btn:hover {
  border-color: rgba(255, 152, 0, 0.5);
  background: rgba(255, 152, 0, 0.2);
}

.filter-btn.unprocessed-filter-btn.active {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  border-color: transparent;
}

/* Progress Bar on Card */
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-fill {
  height: 100%;
  background: var(--accent-red);
  transition: width 0.3s ease;
}

.progress-fill.complete {
  background: var(--accent-green);
}

/* Video Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow), 0 0 30px rgba(255, 215, 0, 0.15);
}

.video-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

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

.video-thumbnail .placeholder {
  font-size: 64px;
  opacity: 0.5;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 68px;
  height: 68px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.play-overlay::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent white;
  margin-left: 4px;
}

.video-card:hover .play-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-details {
  padding: 16px;
}

.video-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px;
  color: var(--text-secondary);
  font-size: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px;
}

.empty-state .icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h2 {
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Watch page */
.watch-page main {
  padding-top: 24px;
}

.watch-container {
  max-width: 1600px;
  margin: 0 auto;
}

.watch-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.watch-main {
  flex: 1;
  min-width: 0;
}

.video-wrapper {
  background: #000;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-wrapper video {
  width: 100%;
  display: block;
  max-height: 75vh;
}

/* Fullscreen styles */
.video-wrapper:fullscreen {
  display: flex;
  flex-direction: column;
  background: #000;
  border-radius: 0;
}

.video-wrapper:fullscreen video {
  flex: 1;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-wrapper:fullscreen .custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.video-wrapper:fullscreen .speed-control {
  position: absolute;
  bottom: 56px;
  left: 0;
  right: 0;
  z-index: 10;
}

/* Webkit fallback */
.video-wrapper:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  background: #000;
  border-radius: 0;
}

.video-wrapper:-webkit-full-screen video {
  flex: 1;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Custom video controls */
.custom-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
}

.play-pause-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.2s;
  flex-shrink: 0;
}

.play-pause-btn:hover {
  transform: scale(1.1);
  background: #c73a52;
}

.current-time, .duration-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  min-width: 45px;
  font-variant-numeric: tabular-nums;
}

.seek-bar-wrapper {
  flex: 1;
  position: relative;
}

.seek-bar {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  transition: height 0.1s;
}

.seek-bar:hover {
  height: 10px;
}

.seek-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: white;
  border-radius: 3px;
  pointer-events: none;
}

.seek-hover {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  pointer-events: none;
}

.preview-container {
  display: none;
  position: absolute;
  bottom: 100%;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.95);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  z-index: 100;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-container::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(0, 0, 0, 0.95);
}

.preview-container canvas {
  display: block;
  border-radius: 4px;
}

.preview-time {
  display: block;
  text-align: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 0 4px;
}

.volume-btn, .fullscreen-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.volume-btn:hover, .fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.volume-slider {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Subtitle button in controls */
.subtitle-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.subtitle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.subtitle-btn.available {
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.subtitle-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.subtitle-btn.active:hover {
  background: #5bb5ff;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.speed-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
}

.speed-buttons {
  display: flex;
  gap: 6px;
}

.speed-btn {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.speed-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.speed-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

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

.video-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.video-nav h1 {
  flex: 1;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
}

.nav-episode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
  justify-content: center;
}

.nav-episode-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.nav-episode-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-episode-btn .nav-label {
  font-size: 13px;
}

@media (max-width: 768px) {
  .video-nav {
    flex-wrap: wrap;
  }
  
  .video-nav h1 {
    order: -1;
    width: 100%;
    margin-bottom: 12px;
    font-size: 18px;
  }
  
  .nav-episode-btn {
    flex: 1;
    min-width: 100px;
  }
}

.video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.video-info h1 {
  font-size: 24px;
  font-weight: 600;
}

/* Large Favorite Button */
.favorite-btn-large {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.favorite-btn-large:hover {
  background: var(--bg-hover);
  border-color: var(--accent-gold);
}

.favorite-btn-large.active {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.2) 0%,
    rgba(255, 107, 53, 0.2) 100%
  );
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.favorite-btn-large .star {
  font-size: 18px;
}

/* Action buttons container */
.action-buttons {
  display: flex;
  gap: 8px;
}

/* Processed button */
.processed-btn-large {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.processed-btn-large:hover {
  background: var(--bg-hover);
  border-color: #4caf50;
}

.processed-btn-large.active {
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 0.2) 0%,
    rgba(56, 142, 60, 0.2) 100%
  );
  border-color: #4caf50;
  color: #4caf50;
}

.processed-btn-large .flag {
  font-size: 18px;
}

/* Trash button */
.trash-btn-large {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.trash-btn-large:hover {
  background: rgba(244, 67, 54, 0.15);
  border-color: #f44336;
  color: #f44336;
}

.trash-btn-large .trash-icon {
  font-size: 18px;
}

/* Resume Progress Info */
.video-progress-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(
    135deg,
    rgba(62, 166, 255, 0.1) 0%,
    rgba(62, 166, 255, 0.05) 100%
  );
  border: 1px solid rgba(62, 166, 255, 0.3);
  border-radius: var(--border-radius);
  margin-top: 12px;
  flex-wrap: wrap;
}

.progress-icon {
  font-size: 20px;
}

.progress-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}

.progress-text strong {
  color: var(--accent-blue);
}

.resume-btn,
.restart-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.resume-btn {
  background: var(--accent-blue);
  color: #fff;
}

.resume-btn:hover {
  background: #5bb5ff;
  transform: scale(1.02);
}

.restart-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
}

.restart-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Screenshot section - Sidebar */
.screenshot-section {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 16px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.screenshot-section h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  text-align: center;
}

.screenshot-hint {
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 12px;
  text-align: center;
}

.screenshot-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Clusters section */
.clusters-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.clusters-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}

.clusters-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cluster-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 12px;
}

.cluster-name {
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-count {
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

.no-clusters {
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
  font-style: italic;
}

.screenshot-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.screenshot-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.screenshot-btn:hover::before {
  opacity: 1;
}

.screenshot-btn:active {
  transform: scale(0.97);
}

.btn-icon {
  font-size: 20px;
  z-index: 1;
  flex-shrink: 0;
}

.btn-text {
  font-size: 11px;
  font-weight: 600;
  z-index: 1;
  text-align: left;
  line-height: 1.2;
}

/* Button colors */
.btn-envoi {
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%);
  color: #90ee90;
}
.btn-envoi:hover {
  box-shadow: 0 0 20px rgba(144, 238, 144, 0.3);
}

.btn-duel {
  background: linear-gradient(135deg, #4a1a1a 0%, #6b2d2d 100%);
  color: #ff6b6b;
}
.btn-duel:hover {
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.btn-parcoup {
  background: linear-gradient(135deg, #1a3a4a 0%, #2d5a6b 100%);
  color: #64b5f6;
}
.btn-parcoup:hover {
  box-shadow: 0 0 20px rgba(100, 181, 246, 0.3);
}

.btn-fatal {
  background: linear-gradient(135deg, #4a1a4a 0%, #6b2d6b 100%);
  color: #ce93d8;
}
.btn-fatal:hover {
  box-shadow: 0 0 20px rgba(206, 147, 216, 0.3);
}

.btn-maitre {
  background: linear-gradient(135deg, #4a3a1a 0%, #6b5a2d 100%);
  color: #ffd54f;
}
.btn-maitre:hover {
  box-shadow: 0 0 20px rgba(255, 213, 79, 0.3);
}


/* Notification */
.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent-green);
  border-radius: var(--border-radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification.hidden {
  display: none;
}

.notif-icon {
  font-size: 24px;
}

.notif-text {
  font-size: 14px;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 48px;
}

/* Responsive */
@media (max-width: 1100px) {
  .watch-layout {
    flex-direction: column;
  }

  .screenshot-section {
    width: 100%;
    position: static;
    max-height: none;
    margin-top: 20px;
  }

  .screenshot-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .screenshot-btn {
    flex: 1;
    min-width: 140px;
    flex-direction: column;
    text-align: center;
  }

  .btn-text {
    text-align: center;
  }
}

@media (max-width: 768px) {
  header {
    padding: 12px 16px;
  }

  .logo-text {
    font-size: 18px;
  }

  main {
    padding: 16px;
  }

  .filters {
    padding: 16px;
    gap: 12px;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .sort-dropdown {
    width: 100%;
  }

  .sort-dropdown select {
    flex: 1;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .video-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .video-progress-info {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .screenshot-btn {
    min-width: 100px;
    padding: 10px 8px;
  }

  .screenshot-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== QUESTIONS SECTION ==================== */

.questions-section {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
}

.questions-section h2 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: var(--text-primary);
}

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

.question-column {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  transition: background 0.2s;
  user-select: none;
}

.column-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}

.column-header-left:hover {
  opacity: 0.8;
}

.launch-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
}

.launch-btn:hover {
  background: rgba(76, 175, 80, 0.4);
  transform: scale(1.1);
}

.launch-btn.loading {
  animation: spin 1s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}

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

/* Benchmark toast container */
.benchmark-toasts-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 1000;
}

/* Benchmark toast */
.benchmark-toast {
  background: rgba(20, 20, 30, 0.95);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastSlideIn 0.3s ease-out;
  border-left: 4px solid var(--accent-primary);
}

.benchmark-toast-running {
  border-left-color: #64b5f6;
}

.benchmark-toast-success {
  border-left-color: #4caf50;
}

.benchmark-toast-error {
  border-left-color: #f44336;
}

.benchmark-toast-icon {
  font-size: 20px;
}

.benchmark-toast-icon.spinning {
  display: inline-block;
  animation: spin 1s linear infinite;
}

.benchmark-toast-text {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.benchmark-toast.fade-out {
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease-out;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.column-icon {
  font-size: 18px;
}

.column-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.column-count {
  background: var(--accent-primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.column-toggle {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.3s;
}

.question-column.expanded .column-toggle {
  transform: rotate(180deg);
}

.column-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.question-column.expanded .column-content {
  max-height: 600px;
  overflow-y: auto;
}

.question-item {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.question-item:first-child {
  border-top: none;
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.question-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.correction-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-timecode {
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.question-timecode:hover {
  background: #c73a52;
  transform: scale(1.05);
}

/* Question action buttons */

.question-action-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.response-time-badge {
  background: rgba(100, 181, 246, 0.2);
  color: #64b5f6;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.verify-btn {
  background: rgba(150, 150, 150, 0.3);
  color: #888;
}

.verify-btn:hover {
  background: rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

.verify-btn.verified {
  background: rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

.delete-btn {
  background: rgba(150, 150, 150, 0.3);
  color: #888;
}

.delete-btn:hover {
  background: rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.question-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.correction-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.correction-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.2);
}

.correction-input::placeholder {
  color: var(--text-secondary);
}

.correction-dropdown {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}

.correction-dropdown:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.correction-dropdown option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.reasoning-display {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  font-style: italic;
  border-left: 2px solid var(--accent-primary);
  white-space: pre-line;
}

.no-questions {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  font-style: italic;
}

/* Responsive for questions */
@media (max-width: 1200px) {
  .questions-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ==================== SUBTITLE PANEL ==================== */

.subtitle-panel {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.subtitle-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.subtitle-panel-icon {
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-blue);
  color: #fff;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.subtitle-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.subtitle-status {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: auto;
}

.subtitle-status.available {
  background: rgba(0, 200, 83, 0.15);
  color: var(--accent-green);
}

.subtitle-status.unavailable {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.subtitle-upload-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subtitle-upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.subtitle-upload-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.subtitle-upload-btn .upload-icon {
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
}

.subtitle-upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--text-secondary);
  font-size: 13px;
  width: 100%;
  justify-content: center;
}

.upload-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Video subtitle cue styling */
video::cue {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 1.1em;
  font-family: "Outfit", sans-serif;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1.4;
}

/* ==================== ROOM SYNC PANEL ==================== */

.room-panel {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.room-idle {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.room-create-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-orange) 100%);
  color: #000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.room-create-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.room-join {
  display: flex;
  gap: 8px;
  align-items: center;
}

.room-join input {
  width: 120px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
}

.room-join input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15);
}

.room-join input::placeholder {
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
}

.room-join-btn {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.room-join-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-gold);
}

.room-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.room-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.5);
  animation: roomPulse 2s ease-in-out infinite;
}

@keyframes roomPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.room-code-display {
  font-size: 14px;
  color: var(--text-secondary);
}

.room-code-display strong {
  color: var(--accent-gold);
  font-size: 16px;
  letter-spacing: 2px;
}

.room-viewers {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
}

.room-actions {
  display: flex;
  gap: 8px;
}

.room-copy-btn {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.room-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.room-leave-btn {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.room-leave-btn:hover {
  background: rgba(244, 67, 54, 0.15);
  border-color: #f44336;
  color: #f44336;
}

@media (max-width: 768px) {
  .room-idle {
    flex-direction: column;
    align-items: stretch;
  }

  .room-active {
    flex-direction: column;
    align-items: stretch;
  }

  .room-info {
    justify-content: center;
  }

  .room-actions {
    justify-content: center;
  }
}
