/* ===================== Header ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 6vw;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.site-brand .dot {
  color: var(--accent);
}

.site-logo-img {
  display: block;
  max-height: 28px;
  width: auto;
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}

.header-search .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 12px;
  pointer-events: none;
}

.header-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px 9px 36px;
  font-size: 13px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.header-search input:focus {
  border-color: var(--accent-dim);
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}
.header-search input::placeholder { color: var(--text-faint); }

.header-search .search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  min-width: 320px;
}

/* ===================== Hero ===================== */
.hero {
  position: relative;
  padding: 12vh 6vw 7vh;
  max-width: 880px;
  overflow: visible;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -160px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(229, 62, 62, 0.16) 0%, rgba(229, 62, 62, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  position: relative;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.03;
  letter-spacing: 0.3px;
  margin: 0 0 18px;
  max-width: 14ch;
}

.hero p {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 52ch;
  margin: 0 0 40px;
  line-height: 1.6;
}

.search-box {
  position: relative;
  max-width: 620px;
}

.search-box .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  font-size: 15px;
}

.search-box input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px 18px 17px 46px;
  font-size: 16px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-box input:focus {
  border-color: var(--accent-dim);
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

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

.search-results {
  position: absolute;
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  display: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 30;
}

.search-results.open { display: block; }

.search-result-row {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s ease;
}

.search-history-label {
  padding: 10px 16px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover { background: var(--surface-2); }

.search-result-row img {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-2);
  flex-shrink: 0;
}

.search-result-meta { min-width: 0; }
.search-result-title { font-weight: 600; font-size: 14.5px; }
.search-result-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

.badge-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 8px;
  letter-spacing: 0.2px;
}

/* --- Bandeau de confiance sous le hero --- */
.trust-strip {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 0 6vw 8vh;
  margin-top: -2vh;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.trust-item .dot { color: var(--success); font-size: 8px; }

/* ===================== Grille "derniers ajouts" ===================== */
.catalog-section { padding: 2vh 6vw 8vh; }

.catalog-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.3px;
  margin: 0 0 20px;
}

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

.catalog-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.catalog-row::-webkit-scrollbar { display: none; }
.catalog-row .catalog-card { flex: 0 0 150px; }

.catalog-card { cursor: pointer; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.catalog-card { animation: fadeIn .35s ease both; }

@keyframes shimmer {
  0% { background-position: -300% 0; }
  100% { background-position: 300% 0; }
}
.skeleton-poster, .skeleton-line {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
}
.skeleton-poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.skeleton-line { height: 10px; border-radius: 4px; margin-top: 9px; }
.skeleton-line.short { width: 55%; }

.catalog-poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.catalog-card:hover .catalog-poster-wrap {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
}

.catalog-poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.catalog-badge { position: absolute; top: 8px; right: 8px; background: var(--bg); }

.fav-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s ease;
}
.fav-btn:hover { border-color: var(--accent); }
.fav-btn.is-fav { color: var(--accent); border-color: var(--accent-dim); background: rgba(229, 62, 62, 0.18); }

.catalog-title {
  margin-top: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.catalog-year { color: var(--text-faint); font-size: 11px; margin-top: 2px; }

/* ===================== Vue detail ===================== */
.detail-view {
  display: none;
  padding-bottom: 8vh;
}

.detail-view.open { display: block; }

.detail-banner {
  position: relative;
  height: 340px;
  background-size: cover;
  background-position: center 20%;
  border-bottom: 1px solid var(--border);
}

.detail-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,11,0.35) 0%, var(--bg) 92%);
  z-index: 1;
}

.detail-banner.no-image { background-color: var(--surface); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13.5px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}

.back-link.on-banner {
  position: absolute;
  top: 24px;
  left: 6vw;
  z-index: 2;
  background: rgba(10, 10, 11, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  transition: border-color .12s ease, color .12s ease;
}
.back-link.on-banner:hover { color: var(--text); border-color: var(--accent-dim); }

.back-link:hover { color: var(--text); }

.detail-content { padding: 0 6vw; max-width: 1040px; opacity: 0; transition: opacity .3s ease; }
.detail-content.loaded { opacity: 1; }

.detail-head {
  display: flex;
  gap: 28px;
  margin-top: -110px;
  margin-bottom: 32px;
  position: relative;
  z-index: 2;
}

.detail-poster {
  width: 150px;
  height: 225px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.detail-head-info { padding-top: 118px; }

.detail-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 38px);
  letter-spacing: 0.3px;
  margin: 0 0 8px;
}

.detail-year { color: var(--text-dim); font-size: 14px; }

.detail-year-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.fav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 12.5px;
  color: var(--text-dim);
  transition: all .12s ease;
}
.fav-pill:hover { border-color: var(--accent-dim); color: var(--text); }
.fav-pill.is-fav { color: var(--accent); border-color: var(--accent-dim); background: rgba(229, 62, 62, 0.08); }
.detail-overview { color: var(--text-dim); font-size: 14.5px; line-height: 1.65; max-width: 62ch; }

.season-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 32px 0 20px;
}

.season-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: all .12s ease;
}
.season-tab:hover { border-color: var(--accent-dim); color: var(--text); }

.season-tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.episode-list {
  display: grid;
  gap: 8px;
  margin-bottom: 32px;
}

.episode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 14px;
  transition: border-color .12s ease;
}
.episode-row:hover { border-color: var(--accent-dim); }

.episode-row .ep-num { color: var(--text-faint); margin-right: 12px; font-variant-numeric: tabular-nums; font-family: var(--font-display); font-size: 15px; }

.episode-row button, .season-pack-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all .12s ease;
}

.episode-row button:hover, .season-pack-btn:hover { border-color: var(--accent); color: var(--accent); }

.stream-section h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.3px;
  font-size: 20px;
  margin-bottom: 16px;
}

/* --- Blocs de resultats par tracker --- */
.tracker-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--surface);
}

.tracker-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--surface-2);
  font-size: 13px;
}

.tracker-block-head .tname {
  font-family: var(--font-display);
  letter-spacing: 0.4px;
  font-size: 15px;
}
.tracker-block-head .tcount { color: var(--text-dim); font-size: 11.5px; }
.tracker-block-head .terror { color: var(--danger); font-size: 11.5px; }

.stream-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  transition: background .12s ease;
}
.stream-row:hover { background: rgba(255, 255, 255, 0.02); }

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

.stream-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.stream-filename {
  color: var(--text-faint);
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  font-size: 12.5px;
}

.stream-meta .ssize { color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

.stream-meta .sseed {
  color: var(--success);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 70px;
}
.stream-meta .sseed::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  display: inline-block;
  flex-shrink: 0;
}

.qbadge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  letter-spacing: 0.2px;
  line-height: 1.4;
}

.qbadge.res { color: var(--accent); border-color: var(--accent-dim); background: rgba(229, 62, 62, 0.06); }
.qbadge.hdr { color: var(--teal); border-color: #2a4a73; background: rgba(96, 165, 250, 0.06); }

.empty-state, .loading-state {
  color: var(--text-faint);
  font-size: 13.5px;
  padding: 22px 16px;
}
.loading-state { animation: pulseText 1.2s ease-in-out infinite; }
@keyframes pulseText { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ===================== Header connecte + "Mes trackers" ===================== */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.header-right .icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  transition: color .12s ease;
}
.header-right .icon-btn:hover { color: var(--accent); }

/* --- Menu utilisateur --- */
.user-menu { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  color: var(--text);
  font-size: 13px;
  transition: border-color .12s ease;
}
.user-menu-trigger:hover { border-color: var(--accent-dim); }

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.user-menu-trigger .chevron { color: var(--text-faint); font-size: 10px; }

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

.avatar-lg { width: 64px; height: 64px; font-size: 26px; flex-shrink: 0; }

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 6px;
}

/* --- Modale Profil --- */
.profile-modal { position: relative; width: 400px; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 22px;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.avatar-xl { width: 72px; height: 72px; font-size: 28px; flex-shrink: 0; }

.avatar-upload-wrap {
  position: relative;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity .15s ease;
}
.avatar-upload-wrap:hover .avatar-overlay { opacity: 1; }

.profile-username {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.3px;
  color: var(--text);
}
.profile-meta { color: var(--text-faint); font-size: 12px; margin-top: 3px; }

.profile-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
}
.profile-section:last-child { margin-bottom: 0; }

.profile-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.profile-icon { display: flex; color: var(--accent); flex-shrink: 0; }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: none;
  z-index: 50;
}
.user-menu-dropdown.open { display: block; }

.user-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 12px 16px;
  font-size: 13px;
  transition: all .1s ease;
}
.user-menu-dropdown button:hover { background: var(--surface-2); color: var(--accent); }

.trackers-view {
  display: none;
  padding: 7vh 6vw 8vh;
  max-width: 720px;
}
.trackers-view.open { display: block; }

.trackers-view .detail-overview { max-width: 65ch; }

.auth-switch {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 14px;
  text-align: center;
}
.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ===================== Footer ===================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 12px;
}
.site-footer .site-brand { font-size: 16px; }

/* ===================== Banniere d'annonce ===================== */
.announcement {
  background: rgba(229, 62, 62, 0.12);
  border-bottom: 1px solid var(--accent-dim);
  color: var(--text);
  text-align: center;
  font-size: 13px;
  padding: 10px 6vw;
  line-height: 1.5;
}
