/* ============================================================
   MyGameList v3 — Composants UI réutilisables
   ============================================================ */

/* ── Boutons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; font-weight: 600; }

.btn-primary {
  background: var(--yellow);
  color: var(--blue);
  border-color: var(--yellow);
}
.btn-primary:hover {
  background: var(--yellow-dark);
  border-color: var(--yellow-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,197,24,0.35);
}

.btn-blue {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-blue:hover {
  background: var(--blue-mid);
  border-color: var(--blue-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-gamelist {
  background: #2563eb;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.25);
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.btn-gamelist:hover {
  background: #1d4ed8;
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--gray-200);
}
.btn-ghost:hover {
  border-color: var(--blue-mid);
  background: var(--blue-pale);
}

.btn-outline-yellow {
  background: transparent;
  color: var(--blue);
  border-color: var(--yellow);
}
.btn-outline-yellow:hover {
  background: var(--yellow-light);
}

/* ── Flash messages ─────────────────────────── */
.flash-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  min-width: 260px;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.flash-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.flash-error   { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.flash-info    { background: var(--blue-light); color: var(--blue); border: 1px solid #90B8F8; }
.flash-close   { background: none; border: none; font-size: 16px; opacity: 0.6; padding: 0 4px; }

/* ── Avatar ──────────────────────────────────── */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-mid);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.navbar-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 4px 10px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.navbar-avatar:hover { background: var(--gray-100); }
.navbar-avatar span { color: var(--pseudo); font-weight: 600; }

/* Formulaires */
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-label-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--blue-mid);
}
.form-label-link:hover { text-decoration: underline; }
.form-required { color: #E24B4A; font-weight: 400; }

.form-input {
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(43,91,168,0.1);
}
.form-input::placeholder { color: var(--gray-400); }
.form-hint { font-size: 11px; color: var(--text-muted); }

/* Password toggle */
.input-password-wrap { position: relative; }
.input-password-wrap .form-input { padding-right: 42px; }
.input-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.input-toggle-password:hover { opacity: 1; }

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}
.form-check-label { font-size: 13px; color: var(--text); cursor: pointer; }

.form-radio-group { display: flex; gap: 20px; flex-wrap: wrap; }
.form-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.form-radio input { accent-color: var(--blue); }

/* Bouton full width */
.btn-block { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

/* Footer auth */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-link {
  color: var(--blue-mid);
  font-weight: 600;
}
.auth-link:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Pagination ─────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  transition: all var(--transition);
}
.pagination-btn:hover {
  background: var(--blue-pale);
  border-color: var(--blue-mid);
}
.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Flash badge (notification obtention) ────────────────────── */
.flash-badge {
  background: linear-gradient(135deg, #1a3a6b, #2a5298);
  color: #fff;
  border-left: 4px solid #f5c518;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 8px;
  min-width: 260px;
  max-width: 420px;
}
.flash-badge strong { color: #f5c518; }
.flash-badge-header {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #f5c518;
}
.flash-badge-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.flash-badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 5px 8px;
}
.flash-badge-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.flash-badge-nom {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
}
.flash-badge-cat {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ── Rang dans les listes (activité, collectionneurs…) ──────── */
.rank-mini {
  display: inline-block;
  font-size: 11px;
  vertical-align: middle;
  margin-left: 3px;
}

/* ── Avatar dans la navbar (macaron petit) ───────────────────── */
.nav-avatar-wrap { position: relative; display: inline-block; }
.nav-avatar-wrap .rank-macaron {
  width: 14px; height: 14px;
  font-size: 8px;
  bottom: -2px; right: -2px;
  border-width: 1.5px;
}
.nav-avatar-wrap .online-dot {
  width: 8px; height: 8px;
  top: -1px; right: -1px;
  border-width: 1.5px;
}

/* ── Badge progress bar ──────────────────────────────────────── */
.badge-progress-bar {
  width: 100%; height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin: 4px 0 2px;
  overflow: hidden;
}
.badge-progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #f5c518, #e6a800);
  transition: width 0.3s ease;
}

/* ── Toast undo (retrait ami) ────────────────────────────── */
.toast-undo {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  display: flex; align-items: center; gap: 14px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
}
.toast-undo-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-undo-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toast-undo-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Badge type item (jeu / console / accessoire) ── */
.item-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ── Tables globales : padding réduit, hauteur fixe ────────── */
table { border-collapse: collapse; width: 100%; }
thead th {
  height: 36px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  background: var(--gray-50, #f8f9fb);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
tbody tr { height: 40px; }
tbody td {
  padding: 0 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100, #f1f3f5);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--blue-pale, #f0f4ff); }

/* ── Classe .avatar : mutualisée pour tous les avatars du site ──────────
   Utilisée par : .profile-avatar, .review-avatar, .msg-list-avatar,
                  .new-member-avatar, navbar-avatar, etc.
   Chaque composant garde ses dimensions, mais le style rond est ici. ── */
.avatar,
.profile-avatar,
.review-avatar,
.review-comment-avatar,
.msg-list-avatar,
.new-member-avatar,
.navbar-avatar img,
img[src*="nav/avatars"],
img[src*="/avatars/"],
img[src*="ukn_"],
img[src*="/f_16"], img[src*="/f_32"], img[src*="/f_48"],
img[src*="/m_16"], img[src*="/m_32"], img[src*="/m_48"] {
  border-radius: 50% !important;
  object-fit: cover;
  object-position: center top;
  overflow: hidden;
  background: var(--gray-100);
}

/* ── Classe globale pseudo/auteur ───────────────────────────── */
/* Modifier --pseudo dans base.css pour changer la couleur partout  */
.pseudo-link,
a.pseudo-link {
  color: var(--pseudo);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.pseudo-link:hover { text-decoration: underline; }
.pseudo-name {
  color: var(--pseudo);
  font-size: 13px;
  font-weight: 700;
}
/* Pseudo compact (dans les commentaires, footers) */
.pseudo-link-sm,
a.pseudo-link-sm {
  color: var(--pseudo);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.pseudo-link-sm:hover { text-decoration: underline; }
.pseudo-name-sm { color: var(--pseudo); font-size: 12px; font-weight: 700; }
