/* ============================
   STYLE_RECHERCHE.css - GameLink
   Version responsive optimisée
   ============================ */

:root {
  --bg: #0f1115;
  --bg-grad1: #11151c;
  --bg-grad2: #0c0f14;
  --panel: #1a1e27;
  --panel-2: #171b23;
  --panel-3: #141820;
  --border: #2a3140;
  --hoverBorder: #3a4559;
  --text: #E7E9ED;
  --muted: #8c95a3;
  --accent: #6ea8ff;
  --accent-soft: rgba(110, 168, 255, .15);
  --danger: #ff6b7a;
  --placeholder: #606774;
  --g: 16px;
  --radius: 14px;
}

/* Décalage pour le header */
body > main,
.page-recherche {
  margin-top: 6rem;
  margin-left: 1%;
  margin-right: 1%;
  padding: 16px 0 32px;
  max-width: 1400px;
  margin-inline: auto;
  font-size: clamp(14px, .9vw + 12px, 16px);
  color: var(--text);
}

/* Conteneur principal */
.page-recherche {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* =============================
   Barre de recherche
   ============================= */
.search-bar-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-bar-section h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
}

/* Barre de recherche */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--panel), var(--panel-3));
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 8px 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  transition: border-color .2s ease;
}

.search-bar:focus-within {
  border-color: var(--accent);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: .95rem;
}

.search-bar input::placeholder {
  color: var(--placeholder);
}

.search-bar button {
  border-radius: 999px;
  border: none;
  padding: 7px 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  font-size: .9rem;
  transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}

.search-bar button:hover {
  background: rgba(110, 168, 255, .25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45);
}

/* Message d'erreur */
.error-message {
  margin-top: 6px;
  font-size: .85rem;
  color: var(--danger);
  min-height: 20px;
}

/* =============================
   Afficher tous les jeux
   ============================= */
.all-games-section {
  display: flex;
  justify-content: center;
  margin: 0;
}

.show-all-button {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px 24px;
  background: linear-gradient(180deg, var(--panel), var(--panel-3));
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  font-size: .95rem;
  transition: all .15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

.show-all-button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
}

/* =============================
   Panneau de filtres
   ============================= */
.filters-panel {
  background: radial-gradient(circle at top, #202536 0, #141822 55%, #0e1118 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .03);
  padding: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .35);
}

.filters-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}

.filters-panel-header span {
  font-size: .9rem;
  color: var(--muted);
}

.filters-reset {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  padding: 6px 12px;
  margin-top: 8px;
  border-radius: 8px;
  transition: all .15s ease;
}

.filters-reset:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
}

/* Groupes de filtres */
.filters-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.filter-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
}

/* Filtres type chips */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04)), var(--panel-2);
  color: var(--muted);
  font-size: .78rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease, color .12s ease;
  white-space: nowrap;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--hoverBorder);
  color: var(--text);
}

.chip--active {
  background: linear-gradient(180deg, rgba(110, 168, 255, .25), rgba(110, 168, 255, .1)), var(--panel);
  border-color: var(--accent);
  color: var(--accent);
}

/* =============================
   Section des jeux
   ============================= */
.games-section {
  margin-top: .5rem;
}

.games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.games-count {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
}

.loading-text {
  font-size: .9rem;
  color: var(--accent);
  margin: 0;
  display: none;
}

/* Grille des jeux */
#Game-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--g);
}

/* Carte jeu */
.game-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel-3));
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  height: 100%;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  border-color: rgba(110, 168, 255, .35);
}

.game-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Image de couverture */
.game-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

/* Titre */
.game-title {
  font-size: .95rem;
  margin: 10px 11px 6px;
  font-weight: 600;
  line-height: 1.3;
}

/* Infos (note, date) */
.game-info {
  margin: 0 11px 12px;
  font-size: .78rem;
  color: var(--muted);
}

/* =============================
   RESPONSIVE - MOBILE
   ============================= */

/* Tablette (900px et moins) */
@media (max-width: 900px) {
  body > main,
  .page-recherche {
    margin-left: 0;
    margin-right: 0;
    padding: 16px 20px 32px;
  }

  .filters-groups {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem 1rem;
  }

  #Game-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
}

/* Mobile portrait (768px et moins) */
@media (max-width: 768px) {
  body > main,
  .page-recherche {
    padding: 12px 15px 24px;
  }

  .search-bar-section h1 {
    font-size: 1.3rem;
  }

  .search-bar {
    padding: 6px 12px;
    gap: 8px;
  }

  .search-bar input {
    font-size: .9rem;
  }

  .search-bar button {
    padding: 6px 14px;
    font-size: .85rem;
  }

  .filters-panel {
    padding: 12px;
  }

  .filters-groups {
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  .filter-group {
    gap: .4rem;
  }

  .filters {
    gap: 5px;
  }

  .chip {
    font-size: .75rem;
    padding: 4px 10px;
  }

  .show-all-button {
    padding: 10px 20px;
    font-size: .9rem;
  }

  #Game-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .game-title {
    font-size: .9rem;
    margin: 8px 10px 5px;
  }

  .game-info {
    font-size: .75rem;
    margin: 0 10px 10px;
  }
}

/* Petit mobile (480px et moins) */
@media (max-width: 480px) {
  body > main,
  .page-recherche {
    margin-top: 5rem;
    padding: 10px;
    gap: 1rem;
  }

  .search-bar-section h1 {
    font-size: 1.2rem;
  }

  .search-bar {
    flex-wrap: wrap;
    border-radius: 12px;
    padding: 8px;
  }

  .search-bar input {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
  }

  .search-bar button {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
  }

  .filters-panel {
    padding: 10px;
  }

  .filters-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .filters-reset {
    align-self: flex-start;
    padding: 4px 8px;
    margin-top: 4px;
  }

  .chip {
    font-size: .72rem;
    padding: 4px 8px;
  }

  .show-all-button {
    padding: 8px 16px;
    font-size: .85rem;
  }

  #Game-list {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .game-title {
    font-size: .85rem;
    margin: 8px 8px 5px;
  }

  .game-info {
    font-size: .72rem;
    margin: 0 8px 8px;
  }

  .games-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .games-count {
    font-size: .85rem;
  }
}

/* Très petit mobile (360px et moins) */
@media (max-width: 360px) {
  .search-bar-section h1 {
    font-size: 1.1rem;
  }

  #Game-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .game-card {
    border-radius: 10px;
  }

  .game-title {
    font-size: .8rem;
  }

  .game-info {
    font-size: .7rem;
  }
}