/* Police sur tout le header */
header,
header * {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}

/* ===== HEADBAR ===== */
header {
  padding: 6px 20px; /* header un peu plus petit */
  background: rgba(10, 12, 18, 0.75);
  border-bottom: 1px solid #0b1120;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 3 zones */
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  transition:
	background-color 0.25s ease,
	backdrop-filter 0.25s ease;
}

/* État "tout en haut de la page" */
header.header-at-top {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}

/* Quand on scroll → search box centrée et plus petite */
header:not(.header-at-top) .search-box {
  transform: translateY(-15px) scale(1);
  width: 240px;
  max-width: 260px;
}

/* Zones gauche / centre (logo + titre / tabs + search) */
.header-left {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-center {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.header-right {
  justify-self: end;
}

/* Titre dans le header */
header h1 {
  margin: 0;
  font-size: 18px;
}

/* Style générique des boutons dans le header (fallback) */
header button {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid #0891b2;
  background: #06b6d4;
  color: #ecfeff;
  cursor: pointer;
  font-size: 13px;
  transition:
    background-color 0.15s ease-out,
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

/* Bouton ACCUEIL — violet */
.btn-home {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(90deg, #6C5E97, #C2B8D8);
  color: #0f172a;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* Bouton LEADERBOARD — vert */
.btn-leaderboard {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(90deg, #E8FFE8, #B5EECB);
  color: #0f172a;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn-home,
.btn-leaderboard {
  border: none;
  outline: none;
  box-shadow: none;
}

.btn-home:focus,
.btn-leaderboard:focus {
  border: none;
  outline: none;
  box-shadow: none;
}

/* Bouton contenant le GIF (Accueil) */
.btn-home-logo {
  background: none !important;
  border: none !important;
  outline: none !important;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-home-logo:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

/* GIF du logo */
.logo-gif {
  width: 40px;
  height: 40px;
  transition: transform 0.2s ease;
}

/* Hover : agrandir le GIF */
.btn-home-logo:hover .logo-gif {
  transform: scale(1.12);
}

/* ===== TABS au-dessus de la barre de recherche ===== */
.top-search-tabs {
  display: flex;
  gap: 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f9fafb;

  opacity: 0;
  transform: translateY(-10px);
  filter: blur(8px);
  pointer-events: none;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    filter 0.25s ease;
}

/* Retire totalement le style par défaut de Chrome */
.top-search-tab {
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;

  color: #b8bec9;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

/* Retire aussi le focus bleu */
.top-search-tab:focus {
  outline: none !important;
  background: none !important;
  box-shadow: none !important;
}

/* Hover : devient blanc et bouge légèrement */
.top-search-tab:hover {
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Quand on est en haut de la page → tabs visibles */
header.header-at-top .top-search-tabs {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  pointer-events: auto;
}

/* ===== BARRE DE RECHERCHE ===== */
.search-box {
  position: relative;
  width: 260px;
  justify-self: center;
  transition:
    transform 0.25s ease,
    width 0.25s ease,
    max-width 0.25s ease;
}

.search-box input {
  width: 100%;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 13px;
  text-align: center;
}

header.header-at-top .search-box {
  transform: translateY(8px) scale(1.05);
  width: 320px;
  max-width: 360px;
}

/* Placeholder */
.search-box input::placeholder {
  color: #6b7280;
  text-align: center;
}

/* Dropdown des résultats */
.search-results {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
  padding: 4px 0;
  z-index: 50;
  display: none;
}

.search-results.visible {
  display: block;
}

/* Un résultat dans la liste */
.search-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  width: 97%;
  margin: 0 auto;
  min-width: 0;
}

.search-result:hover {
  background: #111827;
}

.search-result .label {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.search-result .tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.search-result .search-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* Ligne "Aucun résultat" */
.search-result.empty {
  cursor: default;
  opacity: 0.7;
  justify-content: center;
}

/* ===== RESPONSIVE HEADER ===== */
@media (max-width: 700px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    display: flex;
  }

  .header-center {
    width: 100%;
    align-items: stretch;
  }

  .search-box {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
  }

  header.header-at-top .search-box {
    width: 100%;
    max-width: 100%;
    transform: translateY(6px) scale(1.02);
  }
}
