/* --- friends.css --- */

:root {
  --accent-gold: #d4af37;
  --bg-dark: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --text-muted: #aaa;
  --status-online: #2ecc71;
  --status-offline: #95a5a6;
  --status-ingame: #e67e22;
}

/* Header */
.friends-header {
  text-align: center;
  padding: 4rem 2rem 2rem;
  background: radial-gradient(
    circle at center,
    rgba(46, 204, 113, 0.05) 0%,
    transparent 60%
  );
}

.badge-header {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.friends-header h1 {
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.friends-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.friends-container {
  max-width: 1000px;
  margin: 0 auto 6rem;
  padding: 0 2rem;
}

/* Toolbar & Search */
.friends-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  outline: none;
  font-family: "Inter", sans-serif;
}

.btn-add-friend {
  background: var(--accent-gold);
  color: #000;
  border: none;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.btn-add-friend:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

/* Filtres */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: #fff;
  color: #fff;
}

.filter-btn.active {
  background: #fff;
  color: #000;
  font-weight: 600;
}

/* Grille Amis */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.friend-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.friend-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.3);
}

.card-top {
  display: flex;
  gap: 15px;
  margin-bottom: 1.5rem;
}

.friend-avatar {
  width: 60px;
  height: 60px;
  position: relative;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
  border: 2px solid #111;
}

/* Couleurs statuts */
.friend-card.online .status-dot {
  background: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}
.friend-card.offline .status-dot {
  background: var(--status-offline);
}
.friend-card.ingame .status-dot {
  background: var(--status-ingame);
}

.friend-info {
  display: flex;
  flex-direction: column;
}

.friend-info h3 {
  color: #fff;
  font-size: 1.1rem;
  margin: 0;
}

.friend-elo {
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: bold;
  margin: 2px 0;
}

.friend-status {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.btn-challenge {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-challenge:hover {
  background: var(--accent-gold);
  color: #000;
}

.btn-challenge.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-challenge.disabled:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-msg {
  width: 36px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.btn-msg:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- MODALE --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: #1a1a1a;
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal:hover {
  color: #fff;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 1.5rem;
}

.modal-avatar {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
}

.status-badge {
  position: absolute;
  bottom: -10px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  color: #000;
  font-weight: bold;
  white-space: nowrap;
}
.status-badge.online {
  background: var(--status-online);
}
.status-badge.offline {
  background: var(--status-offline);
}
.status-badge.ingame {
  background: var(--status-ingame);
}

.modal-title-group h2 {
  font-size: 1.8rem;
  margin: 0;
  color: #fff;
}

.user-title {
  color: var(--accent-gold);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-bio {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  font-style: italic;
  color: #ddd;
  margin-bottom: 2rem;
  border-left: 3px solid var(--accent-gold);
}

/* SECTION RATIO (Face à Face) */
.versus-stats h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.win-count {
  color: var(--status-online);
}
.draw-count {
  color: #aaa;
}
.loss-count {
  color: #e74c3c;
}

.ratio-bar {
  height: 12px;
  background: #333;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin-bottom: 5px;
}

.bar-win {
  background: var(--status-online);
}
.bar-draw {
  background: #7f8c8d;
}
.bar-loss {
  background: #e74c3c;
}

.last-match {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 2rem;
}

/* Stats Grille */
.general-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 2rem;
}

.g-stat {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gs-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.gs-val {
  display: block;
  font-size: 1.1rem;
  color: #fff;
  font-weight: bold;
  margin-top: 5px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.full-width {
  width: 100%;
  text-align: center;
}
/* --- RECHERCHE PRÉDICTIVE (AUTOCOMPLETE) --- */
.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #1a1a1a;
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.suggestions-list.hidden {
  display: none;
}

.suggestion-item {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.suggestion-item:hover {
  background: rgba(212, 175, 55, 0.1); /* Doré léger */
  color: #fff;
}

.suggestion-item img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* --- BOUTON SUPPRIMER "MYSTÈRE" --- */
.btn-delete {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: #dbcccc;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1rem;
}

/* L'astuce : on change l'icône au survol via CSS n'est pas possible facilement avec FontAwesome sans JS, 
   donc on va jouer sur la couleur et l'opacité */

.btn-delete i {
  transition: transform 0.3s;
}

/* État par défaut : discret, ressemble à un menu ou un statut */
.btn-delete {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.02);
}

/* État Survol : Devient une zone de danger Rouge */
.btn-delete:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
  color: #d4cdcd;
  transform: scale(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 600px) {
  .friends-toolbar {
    flex-direction: column;
  }
  .btn-add-friend {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
}
