/* ── Variables ── */
:root {
  --header-height: 58px;
}

body {
  background-color: #13181d;
  color: #f1f1f1;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Arial,
    sans-serif;
  text-align: center;
  padding: var(--header-height) 20px 20px;
}

/* ══════════════════════════════════════
   NAVBAR (identique à faq.css)
══════════════════════════════════════ */
.lang-switcher {
  display: inline-flex !important;
  align-items: center !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}
.lang-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.35) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  padding: 0 5px !important;
  text-shadow: none !important;
}
.lang-btn.active {
  color: #fff !important;
}
.lang-btn:focus,
.lang-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.lang-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #0b0e14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-bar {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}

.brand {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.username {
  font-size: 14px;
  font-weight: 600;
  color: #e8eefc;
}

.profile-link,
.stats-button,
.records-button,
.suggest-button,
.likes-button {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.profile-link:hover,
.stats-button:hover,
.records-button:hover,
.likes-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.stats-button {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.3);
}
.records-button {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}
.likes-button {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.3);
}
.suggest-button {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
}
.logout-button {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s;
}

.logout-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.google-icon {
  width: 18px;
  height: 18px;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #9aa3b2;
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s;
}

.login-button-google {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eefc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.google-icon {
  width: 18px;
  height: 18px;
}

/* ══════════════════════════════════════
   CONTENU VOTE
══════════════════════════════════════ */
h1 {
  color: #ffd700;
  margin-top: 30px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Conteneur général en flex pour placer playlists et résultats côte à côte */
.main-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  max-width: 1000px;
  align-items: flex-start;
  margin: 50px auto 0 auto;
}

/* Liste des playlists */
.playlist-list {
  flex: 1 1 400px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.playlist-list ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 56px;
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 900px;
}

.playlist-item {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #161d2e;
  color: #e8eefc;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition:
    background 0.2s,
    transform 0.15s,
    border-color 0.2s;
}

.playlist-item .name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item .badge {
  flex: 0 0 auto;
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.4);
  color: #a7f3c0;
}

.playlist-item:hover {
  background: #1aa34a;
  border-color: #1db954;
  transform: translateY(-1px);
}

/* Résultats */
.results-container {
  flex: 0 0 320px;
  background: #0f1520;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 18px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-height: 480px;
  overflow-y: auto;
  margin-top: 20px;
  transform: translateX(-50px);
}

.results-container h2 {
  color: #e8eefc;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 14px;
  margin-top: 0;
}

.results-container .winner-text {
  color: #ffd700;
  font-weight: bold;
  font-size: 22px;
  margin-top: 20px;
}

.results-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  background: #161d2e;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid #1db954;
  border-radius: 8px;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-weight: 600;
  transition:
    background 0.3s,
    transform 0.2s,
    box-shadow 0.2s;
  cursor: default;
}

.result-row:hover {
  background: #1e2840;
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.result-row.winner {
  background: #1db954;
  color: #ffffff;
  font-weight: 700;
  border-color: #17a846;
}

.playlist-name {
  flex: 1;
  text-align: left;
}
.vote-count {
  flex-shrink: 0;
  text-align: right;
}

.playlist-list.disabled {
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.playlist-item.voted-by-user {
  outline: 2px solid #4a90e2;
  box-shadow:
    0 0 0 2px rgba(74, 144, 226, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
}

.user-vote-info {
  color: #fff;
  margin-top: 10px;
  font-weight: 500;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a2540;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #e8eefc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s,
    transform 0.3s;
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success {
  border-color: rgba(29, 185, 84, 0.4);
}
.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
}

/* ══════════════════════════════════════
   MOBILE
══════════════════════════════════════ */
@media (max-width: 800px) {
  .header-bar {
    height: 48px !important;
    padding: 0 8px !important;
    gap: 6px !important;
  }
  .lang-switcher {
    display: none !important;
  }

  .brand {
    font-size: 13px !important;
  }
  .header-tabs {
    gap: 4px !important;
  }
  .tab-link {
    font-size: 10px !important;
    padding: 4px 5px !important;
    white-space: nowrap !important;
  }
  .nav-right .records-button,
  .nav-right .likes-button,
  .nav-right .logout-button,
  .nav-right .profile-link {
    display: none !important;
  }
  .nav-right .stats-button {
    font-size: 11px !important;
    padding: 4px 7px !important;
  }
  .profile-img {
    width: 26px !important;
    height: 26px !important;
  }
  .username {
    display: none !important;
  }
  .login-button-google {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }
  .login-button-google span {
    display: inline !important;
  }
  .google-icon {
    width: 14px !important;
    height: 14px !important;
  }
}

@media (max-width: 768px) {
  body {
    background: #0f1420;
    color: #e9eef8;
    font-family:
      Inter,
      system-ui,
      -apple-system,
      Segoe UI,
      Roboto,
      Arial,
      sans-serif;
    padding: calc(var(--header-height) + 10px) 5vw 20px;
  }

  h1 {
    font-size: clamp(18px, 5.2vw, 24px);
    line-height: 1.25;
    margin: 10px 0 10px;
    color: #ffd95a;
  }

  .main-container {
    display: block;
    max-width: 100%;
    margin: 10px auto 0;
  }

  .results-container {
    transform: none !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 0 14px 0 !important;
    padding: 12px 14px;
    background: #131a2a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    max-height: 38vh;
    overflow-y: auto;
    text-align: center;
  }

  .results-container h2 {
    font-size: 16px;
    margin: 0 0 8px;
  }
  .results-container .winner-text {
    font-size: 18px;
    margin-top: 10px;
  }

  .playlist-list {
    margin-top: 8px;
  }

  .playlist-list ul {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .playlist-item {
    background: #1a2135;
    color: #eef3ff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
  }

  .playlist-item:active {
    transform: scale(0.99);
  }

  .playlist-item .name {
    font-size: 15px;
    line-height: 1.25;
  }

  .playlist-item .badge {
    font-size: 12px;
    padding: 6px 10px;
    background: #1db9541f;
    border: 1px solid #1db95480;
    color: #dfffe9;
  }

  .playlist-list.disabled {
    opacity: 0.6;
  }

  .playlist-item.voted-by-user {
    outline: 2px solid #4a90e2;
    box-shadow:
      0 0 0 2px rgba(74, 144, 226, 0.25),
      0 6px 14px rgba(0, 0, 0, 0.45);
  }

  .result-row {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .result-row.winner {
    background: #1db954;
    color: #08140f;
  }
}

@media (max-width: 768px) {
  .suggest-button {
    display: none !important;
  }
}


/* ── Hamburger ── */
.hamburger-btn {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  z-index: 998;
}
.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hamburger-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}
.hamburger-overlay.open {
  display: block;
}

.hamburger-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #111827;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 20px 0 32px;
  overflow-y: auto;
}
.hamburger-panel.open {
  transform: translateX(0);
}

.hamburger-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #9aa3b2;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.5;
}
.hamburger-close:hover {
  color: #fff;
  opacity: 1;
}

.hamburger-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 2px solid rgba(99, 120, 255, 0.5);
}
.hamburger-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.hamburger-username {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hamburger-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 12px;
  flex: 1;
}
.hamburger-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  color: #e8eefc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid transparent;
  transition:
    background 0.15s,
    border-left 0.15s;
}
.hamburger-link:last-child {
  border-bottom: none;
}
.hamburger-link:hover {
  background: rgba(99, 120, 255, 0.08);
  border-left: 3px solid rgba(99, 120, 255, 0.6);
  color: #fff;
}
.hamburger-logout {
  color: #9aa3b2;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  border-left: 3px solid transparent;
}
.hamburger-logout:hover {
  color: #fff;
  background: rgba(255, 80, 80, 0.08);
  border-left: 3px solid rgba(255, 80, 80, 0.5);
}
.hamburger-suggest {
  margin-top: 8px;
}
.hamburger-login {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.hamburger-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 20px 0;
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  .nav-right .profile-link,
  .nav-right .stats-button,
  .nav-right .records-button,
  .nav-right .likes-button,
  .nav-right .suggest-button,
  .nav-right .logout-button,
  .nav-right .login-button-google,
  .nav-right .lang-switcher,
  .nav-right .username,
  .nav-right .profile-img,
  .header-tabs {
    display: none !important;
  }
  .nav-right {
    margin-left: auto;
    display: flex !important;
    align-items: center;
    gap: 8px;
    overflow: visible !important;
  }
  .header-bar {
    height: 56px !important;
    padding: 0 12px !important;
    gap: 0 !important;
  }
}
