/* ============================================================
   MyGameList v3 — Gamelist · Wall · Gamethèque
   ============================================================ */


/* ════════════════════════════════════════════════════════════
   1. TOOLBAR & RECHERCHE
   ════════════════════════════════════════════════════════════ */

.gamelist-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.gamelist-toolbar-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gamelist-toolbar-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.gamelist-search {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
}
.gamelist-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.gamelist-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--gray-100);
  padding: 4px 12px;
  border-radius: 100px;
}
.gamelist-type-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.type-filter-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}
.type-filter-btn:hover  { border-color: var(--blue-mid); color: var(--blue); }
.type-filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }


/* ════════════════════════════════════════════════════════════
   2. BLOCS CONSOLE
   ════════════════════════════════════════════════════════════ */

.gamelist-console-block {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.gamelist-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--blue-pale);
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition);
}
.gamelist-console-header:hover { background: var(--blue-light); }
.gamelist-console-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}
.gamelist-console-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.gamelist-toggle { font-size: 10px; }


/* ════════════════════════════════════════════════════════════
   3. TABLE — BASE (structure, th, td, tr)
   ════════════════════════════════════════════════════════════ */

.gamelist-table-wrap { overflow-x: auto; }
.gamelist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.gamelist-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 5px 5px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.gamelist-table th.sortable    { cursor: pointer; user-select: none; }
.gamelist-table th.sortable:hover { color: var(--blue); background: var(--blue-pale); }
.sort-icon { opacity: 0.4; }
.gamelist-table td {
  padding: 4px 5px;
  border-bottom: 0.5px solid var(--gray-100);
  vertical-align: middle;
  color: var(--text);
}
.gamelist-table tr:last-child td { border-bottom: none; }
.gamelist-table tr:hover td      { background: var(--blue-pale); }
.gamelist-table tr.game-row      { height: 56px; }

/* Centrage automatique des th pour les colonnes icônes/données */
.gamelist-table th.col-region,
.gamelist-table th.col-etat,
.gamelist-table th.col-compl,
.gamelist-table th.col-etat-jeu,
.gamelist-table th.col-boite,
.gamelist-table th.col-notice,
.gamelist-table th.col-blister,
.gamelist-table th.col-encours,
.gamelist-table th.col-termine,
.gamelist-table th.col-note,
.gamelist-table th.col-prix,
.gamelist-table th.col-magasin,
.gamelist-table th.col-date { text-align: center; }


/* ════════════════════════════════════════════════════════════
   4. COLONNES — LARGEURS & ALIGNEMENTS
   ════════════════════════════════════════════════════════════ */

.col-cover    { width: 40px; }
.col-region   { width: 60px; text-align: center; }
.col-etat     { width: 75px; }
.col-compl    { width: 64px;  text-align: center; }
.col-etat-jeu { width: 88px;  text-align: center; }
.col-boite    { width: 36px;  text-align: center; }
.col-notice   { width: 36px;  text-align: center; }
.col-blister  { width: 36px;  text-align: center; }
.col-encours  { width: 36px;  text-align: center; }
.col-termine  { width: 36px;  text-align: center; }
.col-prix     { width: 70px;  text-align: center; }
.col-note     { width: 70px;  text-align: center; }
.col-magasin  { width: 90px;  text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-date     { width: 90px; }
.col-actions  { width: 70px; }


/* ════════════════════════════════════════════════════════════
   5. JAQUETTES & PLACEHOLDERS
   ════════════════════════════════════════════════════════════ */

.gamelist-cover {
  width: auto;
  max-height: 48px;
  object-fit: contain;
  border-radius: 3px;
  background: var(--gray-100);
  display: block;
  flex-shrink: 0;
}
.gamelist-cover-placeholder {
  width: 36px;
  height: 48px;
  background: var(--gray-100);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}


/* ════════════════════════════════════════════════════════════
   6. NOM DU JEU & MÉTADONNÉES LIGNE
   ════════════════════════════════════════════════════════════ */

.gamelist-game-link {
  font-weight: 500;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}
.gamelist-game-link:hover { color: var(--blue); }
.gamelist-game-alt {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.gamelist-region {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--blue-light);
  color: var(--blue);
  padding: 1px 6px;
  border-radius: 3px;
}
.gamelist-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--yellow-dark);
}
.gamelist-magasin {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  display: inline-block;
  vertical-align: middle;
}
.gl-annotation {
  display: block;
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}
/* Texte de date dans col-date (remplace les spans inline) */
.col-date-text {
  font-size: 12px;
  color: var(--text-muted);
}
/* Badge type d'item sous le nom du jeu */
.item-type-badge { font-size: 10px; }


/* ════════════════════════════════════════════════════════════
   7. BADGES D'ÉTAT & CONDITION PHYSIQUE
   ════════════════════════════════════════════════════════════ */

/* Neuf / Occasion dans col-etat-jeu */
.ami-neuf-badge { margin-bottom: 3px; }
.ami-neuf-badge .activity-badge { font-size: 9px; padding: 1px 4px; }

/* État physique (HS, Mauvais, Bon, Très bon, Parfait) */
.etat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  white-space: nowrap;
}
.etat-hs      { background: #E24B4A; color: #fff; }
.etat-mauvais { background: #f97316; color: #fff; }
.etat-bon     { background: #eab308; color: #000; }
.etat-trebon  { background: #86efac; color: #166534; }
.etat-parfait { background: #22c55e; color: #fff; }


/* ════════════════════════════════════════════════════════════
   8. BOUTONS D'ACTION (modifier / retirer)
   ════════════════════════════════════════════════════════════ */

.gl-actions    { display: flex; gap: 4px; }
.gl-btn-edit   { padding: 3px 8px; font-size: 11px; }
.gl-btn-delete { padding: 3px 8px; font-size: 11px; color: #E24B4A; }

/* Modal — checkboxes complétude */
.modal-checks {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}


/* ════════════════════════════════════════════════════════════
   9. TOGGLES DE VUE (liste / mur / gamethèque)
   ════════════════════════════════════════════════════════════ */

.view-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  user-select: none;
}
.view-toggle:hover  { border-color: var(--blue); color: var(--blue); }
.view-toggle-icon   { font-size: 16px; }
.view-toggle-group  { display: flex; gap: 4px; }
.view-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.view-btn:hover          { border-color: var(--blue-mid); color: var(--blue); }
.view-btn.active         { background: var(--blue-mid); color: #fff; border-color: var(--blue-mid); }
#btnGametheque.active    { background: var(--gametheque-bg); border-color: var(--gametheque-bg); color: #fff; }


/* ════════════════════════════════════════════════════════════
   10. VUE MUR D'IMAGES
   ════════════════════════════════════════════════════════════ */

.gamelist-wall-view {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--white);
  align-content: flex-start;
}
.gamelist-wall-view::after {
  content: '';
  flex: 1 1 80px;
  max-width: 80px;
  height: 0;
}
.wall-mode .gamelist-console-header { border-bottom: none; }
.wall-card {
  position: relative;
  width: 80px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
  transition: transform var(--transition);
}
.wall-card:hover { transform: scale(1.05); z-index: 2; }
.wall-card img {
  width: 80px;
  height: 107px;
  object-fit: cover;
  display: block;
}
.wall-card-placeholder {
  width: 80px;
  height: 107px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.wall-card-badge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3px 4px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.wall-card-badge .console-badge  { font-size: 8px; padding: 1px 4px; background: rgba(26,58,107,0.9); }
.wall-card-badge .gamelist-region { font-size: 8px; padding: 1px 4px; }


/* ════════════════════════════════════════════════════════════
   11. VUE GAMETHÈQUE
   ════════════════════════════════════════════════════════════ */

.gamelist-gametheque-view {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--bg);
}
.gametheque-card {
  display: block;
  flex-shrink: 0;
  width: 80px;
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.15s;
}
.gametheque-card:hover { transform: scale(1.06); z-index: 2; position: relative; }
.gametheque-card img,
.gametheque-placeholder {
  width: 80px;
  height: 107px;
  display: block;
}
.gametheque-placeholder {
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: 5px;
}
.gametheque-mode .gamelist-console-block {
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.gametheque-mode .gamelist-gametheque-view { padding: 4px; gap: 3px; }


/* ════════════════════════════════════════════════════════════
   12. PAGE HERO (en-tête de la page gamelist)
   ════════════════════════════════════════════════════════════ */

.gamelist-page-hero {
  background: var(--blue);
  padding: 28px 0;
  color: var(--white);
}
.gamelist-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.gamelist-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.gamelist-page-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}


/* ════════════════════════════════════════════════════════════
   13. COLLECTIONNEURS
   ════════════════════════════════════════════════════════════ */

.collectionneurs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.coll-row {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.coll-row:hover { background: var(--blue-light); }
.coll-row td    { padding: 5px 8px; vertical-align: middle; }
.coll-user      { width: 140px; }
.coll-user-link {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.coll-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.coll-date { width: 90px; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.coll-tags { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.ctag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  background: var(--gray-100);
  color: var(--text-muted);
  white-space: nowrap;
}
.ctag-new  { background: #dcfce7; color: #166534; }
.ctag-used { background: #f1f5f9; color: var(--text-muted); }
.ctag-play { background: #fef9c3; color: #854d0e; }
.ctag-done { background: #dcfce7; color: #166534; }


/* ════════════════════════════════════════════════════════════
   14. ADMIN — SOUS-ONGLETS ACTIONS
   ════════════════════════════════════════════════════════════ */

.jm-tab {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.jm-tab:hover          { border-color: var(--blue-mid); color: var(--blue); }
.jm-tab.active         { background: var(--blue-mid); color: #fff; border-color: var(--blue-mid); }
.jm-tab-danger.active  { background: #E24B4A; border-color: #E24B4A; }
.jm-tab-danger:hover   { border-color: #E24B4A; color: #E24B4A; }
.jm-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.jm-result-item:last-child { border-bottom: none; }
.jm-result-item:hover      { background: var(--blue-pale); }

/* État vide (liste vide, aucun résultat) */
.profile-empty       { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.profile-empty-icon  { font-size: 48px; margin-bottom: 12px; }
.profile-empty-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.profile-empty-sub   { font-size: 14px; }


/* ════════════════════════════════════════════════════════════
   15. SURCHARGES CONTEXTUELLES (onglets profil)
   ════════════════════════════════════════════════════════════ */

/* ── Onglet Wishlist ── */
#tab-wishlist .col-cover              { width: 32px; }
#tab-wishlist .col-region             { width: 50px; }
#tab-wishlist .col-date               { width: 80px; }
#tab-wishlist .col-actions            { width: 60px; }
#tab-wishlist .gamelist-game-link     { max-width: 300px; }
#tab-wishlist .gamelist-cover         { width: 24px; height: 32px; }
