/* =========================================================
   MODE SOMBRE (par défaut) - variables globales
   ========================================================= */
:root {
  --bg-body: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  --bg-container: #000000;
  --bg-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --text-main: #ffffff;
  --text-muted: #a9b4d8;

  --accent: #28a745;
  --accent-hover: #218838;

  --btn-secondary: #6c757d;
  --btn-secondary-hover: #5a6268;

  --border-subtle: rgba(255, 255, 255, 0.2);
  --border-strong: rgba(148, 163, 184, 0.8);

  --nav-toggle-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --nav-toggle-bg-hover: linear-gradient(135deg, #111827 0%, #020617 100%);
  --nav-menu-bg: rgba(15, 23, 42, 0.98);

  --lang-btn-bg: rgba(0, 0, 0, 0.18);
  --lang-menu-bg: rgba(3, 3, 8, 0.7);

  --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-nav: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-nav-hover: 0 10px 24px rgba(0, 0, 0, 0.6);
  --shadow-menu: 0 16px 40px rgba(0, 0, 0, 0.7);

  --modal-bg: rgba(15, 23, 42, 0.96);
  --modal-border: rgba(148, 163, 184, 0.9);
  --modal-header-bg: #111827;
}

/* =========================================================
   MODE CLAIR
   ========================================================= */
body.light-mode {
  --bg-body: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  --bg-container: #5986f8;
  --bg-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-main: #000000;
  --text-muted: #a9b4d8;

  --accent: #4ec56a;
  --accent-hover: #3bac56;

  --btn-secondary: #6c757d;
  --btn-secondary-hover: #5a6268;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(148, 163, 184, 0.8);

  --nav-toggle-bg: linear-gradient(135deg, #264d8b 0%, #183370 100%);
  --nav-toggle-bg-hover: linear-gradient(135deg, #264d8b 0%, #183370 100%);
  --nav-menu-bg: #264d8b;

  --lang-btn-bg: rgba(0, 0, 0, 0.18);
  --lang-menu-bg: rgba(3, 3, 8, 0.7);

  --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-nav: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-nav-hover: 0 10px 24px rgba(0, 0, 0, 0.6);
  --shadow-menu: 0 16px 40px rgba(0, 0, 0, 0.7);

  --modal-bg: #bebdbd;
  --modal-border: rgba(148, 163, 184, 0.9);
  --modal-header-bg: #e5e7eb;
  --modal-tetxt: #dae6ff;
}

/* =========================================================
   Reset / Typo
   ========================================================= */
* {
  font-family: "Segoe UI", sans-serif;
  box-sizing: border-box;
}

body {
  background: var(--bg-body);
  margin: 0;
  padding: 20px;
  color: var(--text-main);
}

button {
  font-family: inherit;
}

/* =========================================================
   Container principal
   ========================================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-container);
  border-radius: 15px;
  padding: 30px;
  box-shadow: var(--shadow-strong);
  color: var(--text-main);
}

/* =========================================================
   Header
   ========================================================= */
.header {
  background: var(--bg-header) !important;
  color: #ffffff !important;
  padding: 78px 30px 30px 30px;
  border-radius: 15px 15px 0 0;
  margin: -30px -30px 20px -30px;
  text-align: center;
  position: relative;
}

.header > .lang-switcher {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 200;
}

.header h1 {
  font-size: 2.5em;
  margin: 0 0 10px 0;
}

.header h2 {
  font-size: 1.3em;
  opacity: 0.95;
  margin: 0;
}

.header-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 200;
  pointer-events: none;
}

.header-top .team-switcher,
.header-top .lang-switcher {
  pointer-events: auto;
}

/* =========================================================
   Top bar / infos club
   ========================================================= */
.top-bar {
  margin-top: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-main);
}

.club-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.club-logo {
  width: auto;
  height: auto;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  padding: 0;
}

.club-name {
  font-size: 1.05em;
  font-weight: 700;
}

.club-sub {
  font-size: 0.9em;
  opacity: 0.8;
}

.button-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* =========================================================
   Boutons génériques
   ========================================================= */
button {
  background: var(--accent);
  color: #ffffff;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

button:hover {
  background: var(--accent-hover);
}

button:active {
  transform: translateY(1px);
  box-shadow: none;
}

button.secondary {
  background: var(--btn-secondary);
  color: var(--text-main);
}

button.secondary:hover {
  background: var(--btn-secondary-hover);
}

.icon-btn {
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   NT Staff
   ========================================================= */
#ntStaffBtnTop {
  display: none;
  margin-right: 10px;
}

#ntStaffBtnTop.is-visible {
  display: inline-block;
}

#ntStaffBtnTop.nt-staff-btn {
  background-color: #0247f2;
  border: 1px solid #1241b5;
  color: #ffffff;
}

#ntStaffBtnTop.nt-staff-btn:hover {
  background-color: #15803d;
}

/* =========================================================
   U21 Staff
   ========================================================= */

.nt-staff-btn {
  display: none;
}

.nt-staff-btn.is-visible {
  display: inline-flex;
}

/* =========================================================
   Contenu principal
   ========================================================= */
.content {
  margin-top: 20px;
}

/* =========================================================
   Menus Players / Team / League / Tool - menus au premier plan
   ========================================================= */

/* Container principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-container);
  border-radius: 15px;
  padding: 30px;
  box-shadow: var(--shadow-strong);
  color: var(--text-main);
  position: relative;      /* important pour le z-index du nav */
  z-index: 0;
}

/* Nav au tout premier plan dans la container */
#bhNavMenus {
  padding-top: 6px;
  position: relative;
  z-index: 50;             /* au-dessus du contenu */
}

#bhNavMenus.nav-dropdowns {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;   /* 🔥 clé: interdit le retour à la ligne */
}

#bhNavMenus .nav-dropdown {
  position: relative;
  flex: 1 1 0;
  display: flex;
  justify-content: center;
}

#bhNavMenus .nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  margin-top: 6px;
  background: var(--nav-menu-bg);
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-menu);
  padding: 6px 0;
  display: none;
  z-index: 1000;           /* plus que tout ce qui est dans .container */
}

/* Affichage du menu ouvert */
#bhNavMenus .nav-dropdown.open .nav-dropdown-menu,
#bhNavMenus .nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

/* Chaque menu */
#bhNavMenus .nav-dropdown {
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  position: relative;       /* référence pour le menu déroulant */
  z-index: 20;              /* au-dessus du reste du header */
}

/* Boutons de menu */
#bhNavMenus .nav-dropdown-toggle {
  all: unset;
  box-sizing: border-box;
  background: var(--nav-toggle-bg);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-nav);
  transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
  min-width: 160px;
  max-width: 220px;
  text-align: center;
  white-space: nowrap;
}

#bhNavMenus .nav-dropdown-toggle::after {
  content: "▾";
  font-size: 0.75rem;
  opacity: 0.8;
}

#bhNavMenus .nav-dropdown-toggle:hover,
#bhNavMenus .nav-dropdown-toggle:focus-visible {
  background: var(--nav-toggle-bg-hover);
  box-shadow: var(--shadow-nav-hover);
  transform: translateY(-1px);
}

/* Menu déroulant au premier plan */
#bhNavMenus .nav-dropdown-menu {
  position: absolute;       /* reste accroché au bouton */
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  margin-top: 6px;
  background: var(--nav-menu-bg);
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-menu);
  padding: 6px 0;
  display: none;
  z-index: 999;             /* passe devant le tableau */
  white-space: nowrap;
}

/* Affichage du menu ouvert */
#bhNavMenus .nav-dropdown.open .nav-dropdown-menu,
#bhNavMenus .nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

/* Items du menu */
#bhNavMenus .nav-dropdown-menu a,
#bhNavMenus .nav-dropdown-menu .nav-dropdown-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: #e5e7eb;
  text-decoration: none;
  white-space: nowrap;
}

#bhNavMenus .nav-dropdown-menu a:hover {
  background: rgba(37, 99, 235, 0.18);
}

#bhNavMenus .nav-dropdown-placeholder {
  opacity: 0.6;
}

/* =========================================================
   Switchers
   ========================================================= */
.lang-switcher,
.team-switcher {
  position: relative;
  display: inline-block;
  z-index: 210;
}

/* ----- Langue ----- */
.lang-switcher button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
}

.lang-switcher .lang-current {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 6px 16px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  background: var(--lang-btn-bg) !important;
  color: #fff !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

.lang-current .lang-flag {
  position: static;
  display: inline-block;
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  margin: 0;
  flex-shrink: 0;
}

.lang-current .lang-label {
  display: inline-block;
}

.lang-current .lang-arrow {
  font-size: 10px;
  opacity: 0.8;
  margin-left: 2px;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--lang-menu-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-menu);
  padding: 6px;
  min-width: 160px;
  z-index: 999;
  opacity: 0;
  transform: translateY(-4px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.lang-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-dropdown button {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.3;
}

.lang-dropdown button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lang-dropdown img.lang-flag {
  display: inline-block;
  position: static;
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  margin: 0;
  flex-shrink: 0;
}

/* ----- Team ----- */
.team-current {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: var(--lang-btn-bg);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  min-height: 34px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.team-current.disabled {
  cursor: default;
  opacity: 0.85;
}

.team-label {
  display: inline-block;
}

.team-arrow {
  font-size: 10px;
  opacity: 0.8;
  margin-left: 2px;
}

.team-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--lang-menu-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-menu);
  padding: 6px;
  min-width: 150px;
  z-index: 999;
  opacity: 0;
  transform: translateY(-4px);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.team-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.team-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.3;
  user-select: none;
}

.team-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* =========================================================
   Footer
   ========================================================= */
.bh-footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid #1e3c72;
  width: 100%;
}

.bh-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.bh-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bh-footer-logo {
  height: 1.5em;
  width: auto;
  object-fit: contain;
  margin-right: 0.5rem;
}

.bh-footer-brand {
  font-size: 0.95em;
  font-weight: 700;
  color: #aac4ff;
}

.bh-footer-copy {
  font-size: 0.75em;
  color: #374151;
  margin-top: 2px;
}

.bh-footer-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bh-footer-center p {
  margin: 0;
  font-size: 0.75em;
  color: #4b5563;
}

.bh-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.bh-footer-version {
  font-size: 0.75em;
  color: #374151;
}

.bh-footer-bblink {
  font-size: 0.78em;
  color: #3498db;
  text-decoration: none;
  transition: color 0.2s;
}

.bh-footer-bblink:hover {
  color: #60a5fa;
}

/* =========================================================
   Link status
   ========================================================= */
.link-status {
  position: absolute;
  right: 20px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  max-width: 260px;
}

.link-status-label {
  font-size: 0.9em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.link-status-linked {
  color: #16a34a;
  background-color: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.7);
}

.link-status-notlinked {
  color: #f97373;
  background-color: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.7);
}

.link-status-text {
  font-size: 0.8em;
  color: #e5e7eb;
}

.link-status-discord {
  color: #93c5fd;
  text-decoration: underline;
}

.link-status-discord:hover {
  color: #bfdbfe;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 600px) {
  .nav-dropdowns {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    flex-wrap: nowrap; 
  }

  .nav-dropdown {
    justify-content: stretch;
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .bh-footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bh-footer-right {
    align-items: center;
  }

  .header {
    padding: 88px 20px 24px 20px;
  }

  .header-top {
    left: 12px;
    right: 12px;
    top: 12px;
  }
}
