/* --------------------------------------------------
   STYLES "MATCHES" — ADAPTÉ AU STYLE LIGUE
   - Titre de section avec bord gauche bleu
   - Cartes blanches, texte sombre, ombre légère
   - Affichage des équipes avec logos
   - Drawer unifié (identique à ligues)
-------------------------------------------------- */

/* --- Titre de section (comme .group-title) --- */
.section-title {
  color: #0e0766;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
  border-left: 4px solid var(--c-accent);
  padding-left: 15px;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
}

/* --- Grille des matchs --- */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

/* --- Carte de match (style identique à .team-card) --- */
.match-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 15px;
  color: #1a1a1a;
}

.match-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--c-accent);
}

/* En-tête du match (lieu / date) */
.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #666;
  border-bottom: 1px dashed rgba(0,0,0,0.1);
  padding-bottom: 8px;
}

/* Équipes */
.match-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40%;
}

.team-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 8px;
}

.team-name {
  font-weight: 600;
  text-align: center;
  font-size: 1rem;
  color: #1a1a1a;
}

.match-vs {
  font-weight: 700;
  color: #999;
  text-align: center;
  width: 20%;
}

/* Cotes */
.match-odds {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  margin-bottom: 20px;
  align-items: stretch;
  flex-wrap: wrap;
}

.odds-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f5f7fa;
  border: 1px solid rgba(0,0,0,0.05);
  min-width: 80px;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 6px;
  color: #333;
}

.odds-option:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  border-color: var(--c-accent);
}

.odds-label {
  font-size: 0.8rem;
  color: #666;
}

.odds-value {
  font-weight: 800;
  color: var(--c-accent);
  font-size: 1.1rem;
}

/* Bouton d'action sur la carte (style similaire à .micro-btn.primary) */
.bet-match-btn {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.bet-match-btn:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
}

/* --- DRAWER (strictement identique à ligues-new.css) --- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

body.drawer-open .drawer-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  z-index: 1000;
  background: var(--drawer-bg, #111823);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  color: var(--c-text);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform;
}

.drawer-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.drawer-container::-webkit-scrollbar {
  display: none;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  min-height: 64px;
}
.drawer-body {
  padding: 18px;
  flex: 1 1 auto;
  overflow: auto;
}
.drawer-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0;
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.drawer-footer .btn {
  flex: 1 1 0;
  border-radius: 0;
  border: none;
  font-weight: 600;
  padding: 22px 32px;
  transition: background 0.2s;
  cursor: pointer;
  text-align: center;
  margin: 0;
}

.add-to-cart-btn {
  background: transparent;
  color: white;
}
.pay-now-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* --- Sélection des issues dans le drawer --- */
.outcome-selection {
  display: flex;
  gap: 10px;
  margin: 10px auto 20px auto;
  justify-content: space-between;
  width: 100%;
}
.outcome-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 1;
  cursor: pointer;
  transition: all 0.18s ease;
  gap: 6px;
  color: var(--c-text);
}
.outcome-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
.outcome-btn.selected {
  background: rgba(0,231,214,.15);
  border-color: var(--c-accent);
}
.outcome-team {
  font-weight: 600;
  font-size: 0.9rem;
}
.outcome-odds {
  font-weight: 800;
  color: var(--c-accent);
  font-size: 1.1rem;
}

/* Messages d'erreur / limites */
.error-message {
  color: #ff6b6b;
  margin-top: 10px;
  font-size: 14px;
  display: none;
}
.bet-limit-text {
  font-size: 12px;
  margin-top: 5px;
  color: #aaa;
}

/* --- Responsive --- */
@media (max-width: 800px) {
  .drawer {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 92vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    padding-top: 6px;
  }
  .drawer.open {
    transform: translateY(0);
  }
  .drawer-footer {
    flex-direction: column;
    gap: 0;
  }
  .drawer-footer .btn {
    width: 100%;
    flex: none;
    padding: 22px 30px;
  }
  .outcome-selection {
    flex-direction: column;
  }
  .outcome-btn {
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
  }
  .match-card {
    padding: 15px;
  }
  .match-vs {
    display: none;
  }
}

@media (min-width: 801px) {
  .drawer {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(440px, 40vw);
    border-radius: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
  }
  .drawer.open {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .matches-grid {
    grid-template-columns: 1fr;
  }
  .match-teams {
    margin-bottom: 15px;
  }
}
