/* ============================================
   ligues-new.css - Styles spécifiques aux ligues
   ============================================ */

/* --- Variables et héritage --- */
:root {
  --drawer-bg: #111823; /* fond opaque */
}

/* --- Hero allégé --- */
.ligue-hero {
  min-height: auto !important;
  padding: 30px var(--container-padding) 20px !important;
  background: linear-gradient(135deg, rgba(99, 195, 255, 0.05) 0%, rgba(14, 7, 102, 0.1) 100%);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  position: relative;
}

.ligue-hero .hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.ligue-hero .hero-logo {
  height: 80px;
  width: auto;
  margin: 0 auto;
}

/* --- Étiquette de statut des paris --- */
.bet-status-label {
  display: block;
  width: fit-content;   /* la largeur s'adapte au contenu */
  margin-left: auto;
  margin-right: 0;
  /* conservez toutes les autres propriétés existantes */
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--c-text);
  margin-bottom: 5%;
  margin-top: 0.5%;
  /* supprimez align-self: center (inutile) */
}

.bet-status-label.ended {
  background: rgba(244, 67, 54, 0.2);
  border-color: #f44336;
  color: #f44336;
}

.bet-status-label.active {
  background: rgba(76, 175, 80, 0.2);
  border-color: #4CAF50;
  color: #4CAF50;
}

/* --- Section principale (light) --- */
.section-light {
  background: #f5f7fa;
  color: #1a1a1a;
}

.section-light .group-title {
  color: #0e0766;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  border-left: 4px solid var(--c-accent);
  padding-left: 15px;
}

/* --- Grille des équipes --- */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* --- Carte d'équipe --- */
.team-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;
  cursor: pointer;
  color: #1a1a1a;
}

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

.team-card.disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(1);
}

.team-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.team-odds {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--c-accent);
  padding: 4px 10px;
}

.team-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.team-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.team-actions .micro-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

.team-actions .micro-btn.primary {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: white;
}

.team-actions .micro-btn:hover {
  filter: brightness(0.9);
}

/* --- Section "Ne concours plus" --- */
.zero-odds-section {
  margin-top: 40px;
  border-top: 2px dashed rgba(0, 0, 0, 0.1);
  padding-top: 30px;
}

.zero-odds-section .team-card {
  background: #f0f0f0;
  border-color: #ccc;
}

/* --- Message "Tournois terminé" --- */
.tournament-finished {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius);
  margin: 40px 0;
}

.tournament-finished h3 {
  font-size: 2rem;
  color: var(--c-accent);
  margin-bottom: 15px;
}

.tournament-finished p {
  color: #666;
  font-size: 1.1rem;
}

/* ================= DRAWER (opaque, hauteur ajustée) ================= */
.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 de base */
.drawer {
  position: fixed;
  z-index: 1000;
  background: var(--drawer-bg, #111823); /* opaque */
  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;
}

/* Conteneur interne scrollable */
.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;
}

/* En-tête, corps, pied */
.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; /* hauteur proche de l'appbar */
}
.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-handle {
  display: block;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px auto 0;
  flex-shrink: 0;
}

/* --- Mobile : tiroir par le bas (plus haut) --- */
@media (max-width: 800px) {
  .drawer {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 92vh; /* plus de hauteur */
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    padding-top: 6px;
  }
  .drawer-handle {
    margin-top: 6px;
  }
  .drawer.open {
    transform: translateY(0);
  }
  .drawer-footer {
    flex-direction: column;
    gap: 12px;
  }
  .drawer-footer .btn {
    min-width: 100% !important;
  }
}

/* --- Desktop : panneau latéral droit --- */
@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);
  }
}

/* --- Éléments internes du drawer --- */
#drawer-team-name {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}
.odds-box {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 10px;
  border-radius: 12px;
  width: max-content;
}
.odds-box .label {
  color: var(--c-text-dim);
}
#drawer-odds {
  color: var(--c-accent) !important;
}
.bet-title {
  margin: 10% 0 6%;
}
.bet-input {
  width: 100%;
  max-width: 420px;
  height: 6rem;
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 2.5px solid var(--c-accent);
  outline: none;
  background: #08121d;
  color: var(--c-text);
  margin-bottom: 7%;
}
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spinner {
  -moz-appearance: textfield;
}
.bet-calculation-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: inline-block;
}
.bet-caution-text {
  color: var(--c-text-dim);
  font-size: 0.9rem;
  margin-top: 6px;
}
.calc-part {
  opacity: 0.9;
}
.calc-result {
  font-size: 1.15em;
}

/* --- Notifications globales (copiées depuis votre exemple) --- */
.global-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10000;
  max-width: 300px;
  animation: slideInRight 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}
.global-notification.error {
  background: #f44336;
}
.global-notification.success {
  background: #4CAF50;
}
.global-notification.info {
  background: #2196F3;
}
.global-notification .close-notification {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
  margin-left: auto;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* --- Utilitaires --- */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.hidden {
  display: none !important;
}

/* Ajustements généraux */
.main-content {
  padding-top: calc(var(--header-height, 70px) + var(--nav-height, 50px) + 80px) !important;
}
.appbar {
  background: #15191f !important;
}

/* Texte de limite sous l'input */
.bet-limit-text {
  font-size: 0.8rem;
  margin-top: 4px;
  margin-bottom: 12px;
  color: var(--c-text-dim);
}

/* Boutons du drawer avec meilleur contraste */
.add-to-cart-btn {
  background: transparent;
  color: white;
  margin: 0 !important;
}
.pay-now-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  margin: 0 !important;
}

/* Réduction des marges sur drawer mobile (non latéraux) */
@media (max-width: 800px) {
  .drawer-body {
    padding: 12px;
  }
  .drawer-footer {
    padding: 0px;
  }
  .bet-limit-text {
    margin-bottom: 8px;
  }
}

.detail-section {
  margin-bottom: 24px;
}
.detail-section h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: var(--c-accent);
}
.detail-item {
  margin-bottom: 12px;
}
.detail-label {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.detail-value {
  line-height: 1.5;
}

.drawer.details-mode .drawer-footer {
  display: none;
}

/* --- Style commun à tous les boutons du footer --- */
.drawer-footer .btn {
  flex: 1 1 0;                /* chaque bouton prend une part égale */
  border-radius: 0;
  border: none;
  font-weight: 600;
  padding: 22px 32px;
  transition: background 0.2s;
  cursor: pointer;
  text-align: center;
  margin: 0;
}

/* --- Mobile : les boutons passent en colonne et prennent toute la largeur --- */
@media (max-width: 800px) {
  .drawer-footer {
    flex-direction: column;
    gap: 0;
  }
  .drawer-footer .btn {
    width: 100%;
    flex: none;               /* évite que flex 1 ne l'emporte */
    padding: 22px 30px;
  }
}

/* Effet hover (optionnel) */
.add-to-cart-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}
.pay-now-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
