/* ── Variables ── */
:root {
  --bg: #0b0e14;
  --panel: #111726;
  --line: #1a2236;
  --text: #e8eefc;
  --muted: #9aa3b2;
  --gold: #ffd166;
  --header-height: 58px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: #0b0e14;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font:
    15px/1.5 Inter,
    system-ui,
    -apple-system,
    sans-serif;
}
.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;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 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 ── */
.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: var(--text);
}

.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);
}

.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: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.login-button-google:hover {
  background: rgba(255, 255, 255, 0.1);
}

.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: 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);
}

.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: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.login-button-google:hover {
  background: rgba(255, 255, 255, 0.1);
}
.google-icon {
  width: 18px;
  height: 18px;
}

/* ── Page ── */
.likes-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

h1 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  text-align: center;
  margin: 0 0 24px;
  color: var(--text);
}

/* ── Controls ── */
.controls {
  margin-bottom: 20px;
}

#searchBar {
  width: 100%;
  max-width: 500px;
  height: 40px;
  font-size: 14px;
  padding: 0 14px;
  background: #ffffff;
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  font-family: inherit;
  display: block;
  margin: 0 auto;
  transition: border-color 0.15s;
}

#searchBar:focus {
  outline: none;
  border-color: rgba(99, 120, 220, 0.5);
}

#searchBar::placeholder {
  color: #888;
  text-align: center;
}

/* ── Table ── */
.stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.stats-table thead th {
  text-align: left;
  font-weight: 600;
  color: #cdd6f4;
  background: #0f1629;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-table thead th:nth-child(1) {
  width: 70px;
  text-align: center;
}
.stats-table thead th:nth-child(4) {
  width: 80px;
  text-align: center;
}
.stats-table thead th:nth-child(5) {
  width: 80px;
  text-align: center;
}

.stats-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  vertical-align: middle;
}

.stats-table tbody tr:last-child td {
  border-bottom: 0;
}
.stats-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Ordre */
.stats-table tbody td:nth-child(1) {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

/* YouTube icon */
.stats-table td a.youtube-link {
  color: #ff0000;
}
.stats-table td a.youtube-link:hover {
  opacity: 0.8;
}

/* Bouton supprimer */
.delete-btn {
  background: rgba(255, 77, 77, 0.08);
  color: #ff6b6b;
  border: 1px solid rgba(255, 77, 77, 0.25);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
  padding: 0;
  font-size: 14px;
}

.delete-btn::before {
  content: '✕';
  font-weight: 700;
  font-size: 13px;
}

.delete-btn:hover {
  background: rgba(255, 77, 77, 0.2);
  border-color: rgba(255, 77, 77, 0.5);
  color: #ff4d4d;
}

.delete-btn:active {
  transform: scale(0.92);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 16px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.pagination button:hover:not(:disabled) {
  background: #141b2e;
  border-color: rgba(255, 255, 255, 0.2);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#pageIndicator {
  font-size: 14px;
  color: var(--muted);
}

/* ── Dialog ── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dialog-box {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  max-width: 320px;
  color: var(--text);
}

/* Centrage colonne YouTube et Supprimer */
.stats-table thead th:nth-child(4),
.stats-table thead th:nth-child(5) {
  text-align: center !important;
}

.stats-table tbody td:nth-child(4),
.stats-table tbody td:nth-child(5) {
  text-align: center !important;
  vertical-align: middle !important;
}

.dialog-overlay {
  display: none;
}

.dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.dialog-btn {
  padding: 8px 22px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.dialog-btn.confirm {
  background: rgba(255, 77, 77, 0.15);
  color: #ff6b6b;
  border-color: rgba(255, 77, 77, 0.35);
}

.dialog-btn.confirm:hover {
  background: rgba(255, 77, 77, 0.28);
}

.dialog-btn.cancel {
  background: rgba(255, 255, 255, 0.05);
  color: #9aa3b2;
  border-color: rgba(255, 255, 255, 0.1);
}

.dialog-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e8eefc;
}

/* ── Mobile ── */
@media (max-width: 800px) {
  :root {
    --header-height: 52px;
  }
  .lang-switcher {
    display: none !important;
  }

  .header-bar {
    height: 48px !important;
    padding: 0 8px !important;
    gap: 6px !important;
  }
  .brand {
    font-size: 13px !important;
    white-space: nowrap;
  }
  .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: none !important;
  }
  .google-icon {
    width: 14px !important;
    height: 14px !important;
  }

  .likes-page {
    padding: 16px 10px 40px;
  }

  #searchBar {
    max-width: 100%;
  }

  .stats-table thead th:nth-child(4),
  .stats-table tbody td:nth-child(4),
  .stats-table thead th:nth-child(5),
  .stats-table tbody td:nth-child(5) {
    display: none !important;
  }

  .stats-table thead th,
  .stats-table tbody td {
    padding: 10px 8px !important;
    font-size: 13px !important;
  }
}

@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) {
   a.tab-link { display: none !important;}
  .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;
  }
}
