/* === Tournois.css (responsive) adapté au public === */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  background: #121212;
  color: #fff;
}

/* Conteneur principal étendu comme sur l’admin */
body > .container {
  flex: 1;
  display: block;
  width: 90%;
  max-width: 900px;
  margin: 20px auto;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
}

/* === Header & Search === */
.title-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
}
.title-search .title {
  font-size: 1.5rem;
  font-weight: bold;
  flex: 0 0 auto;
}
.search-bar {
  display: flex;
  flex: 1 1 200px;
  max-width: 100%;
  border: 1px solid #444;
  border-radius: 5px;
  overflow: hidden;
}
.search-bar button {
  background: #333;
  color: #fff;
  border: none;
  padding: 0 12px;
  cursor: pointer;
}
.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 8px 10px;
  outline: none;
  background: #1e1e1e;
  color: #fff;
}

/* === Tabs === */
.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #444;
  margin: 20px 0;
}
.tabs a {
  padding: 10px 15px;
  color: #ccc;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s;
}
.tabs a.active {
  color: #007bff;
  border-color: #007bff;
}
.tabs a:not(.active):hover {
  color: #007bff;
}

/* === Liste des tournois === */
.tournaments-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 20px;
}
.empty-state {
  text-align: center;
  color: #777;
}

/* Carte de tournoi (desktop) */
.tournament-card {
  display: grid;
  grid-template-columns: 60px 2fr auto auto;
  align-items: center;
  padding: 15px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  gap: 15px;
  transition: background .2s;
}
.tournament-card:hover {
  background: #2a2a2a;
}
.tournament-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: #333;
}
.tournament-details h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tournament-players,
.tournament-registration {
  font-size: 0.9rem;
  text-align: right;
  white-space: nowrap;
}

/* Couleurs de statut */
.status-upcoming { color: #FFA000; }
.status-ongoing  { color: #388E3C; }
.status-finished { color: #D32F2F; }

/* === Responsive @ 768px === */
@media (max-width: 768px) {
  .tournament-card {
    grid-template-columns: 50px 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "logo title players"
      "logo status status";
  }
  .tournament-logo {
    grid-area: logo;
    width: 50px;
    height: 50px;
  }
  .tournament-details { grid-area: title; }
  .tournament-players { grid-area: players; }
  .tournament-registration { grid-area: status; }
}

/* === Responsive @ 480px === */
@media (max-width: 480px) {
  .title-search {
    flex-direction: column;
    align-items: stretch;
  }
  .search-bar {
    flex: 1 1 100%;
  }
  .tournament-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "logo"
      "title"
      "players"
      "status";
    text-align: center;
  }
  .tournament-logo {
    margin: 0 auto 10px;
    width: 50px;
    height: 50px;
  }
  .tournament-details h2 {
    font-size: 1rem;
    white-space: normal;
  }
  .tournament-players,
  .tournament-registration {
    text-align: center;
  }
}
