/* ==========================================================================
   calendar.css — Page Calendrier des matchs CDM 2026
   ==========================================================================
   Contenu :
     15. CALENDRIER — Compte à rebours, filtres, liste des matchs par jour
     16. CALENDRIER — Engagement temps réel
         (bannière LIVE sticky, prompt notif, bouton 🔔 par match,
          compte à rebours individuel pour les matchs des 24h à venir)

   Requiert :
     - base.css   (variables, .btn, .user-widget)
     - games.css  (.page-game, .game-topbar, .back-link, .game-main)

   À charger sur calendrier/index.html :
     <link rel="stylesheet" href="../css/base.css" />
     <link rel="stylesheet" href="../css/games.css" />
     <link rel="stylesheet" href="../css/calendar.css" />
   ========================================================================== */


/* ==========================================================================
   15. CALENDRIER
   ========================================================================== */

/* Compte à rebours */
.cal-countdown {
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.18) 0%, rgba(244, 196, 48, 0.06) 100%);
  border: 1px solid rgba(244, 196, 48, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.cal-countdown__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.cal-countdown__timer {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-sm) 0 var(--space-md);
}

.cal-countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 70px;
}

.cal-countdown__num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--color-gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cal-countdown__suffix {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-top: 4px;
}

.cal-countdown__sub {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}

/* Filtres */
.cal-filters {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.cal-filter {
  flex-shrink: 0;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}
.cal-filter:hover {
  background: rgba(255, 255, 255, 0.18);
}
.cal-filter--active {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-ink);
}

/* Filtre par équipe */
.cal-team-filter {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.cal-team-filter__label {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 600;
}

.cal-team-filter__input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-ink);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.cal-team-filter__input:focus {
  border-color: var(--color-gold);
}

/* Liste des jours */
.cal-day {
  margin-bottom: var(--space-lg);
}

.cal-day__title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gold);
  margin: 0 0 var(--space-sm);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cal-day__today {
  background: var(--color-red);
  color: var(--color-white);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  text-transform: none;
}

.cal-day__matches {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Carte match */
.cal-match {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s var(--ease);
}
.cal-match:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(244, 196, 48, 0.3);
}

.cal-match--live {
  background: rgba(230, 57, 70, 0.15);
  border-color: rgba(230, 57, 70, 0.4);
  position: relative;
}
.cal-match--live::before {
  content: '🔴 EN COURS';
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--color-red);
  color: var(--color-white);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
}

.cal-match__time {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.cal-match__hour {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-gold);
  font-variant-numeric: tabular-nums;
}

.cal-match__badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-match__badge--groups {
  background: rgba(26, 143, 84, 0.4);
  color: var(--color-white);
}
.cal-match__badge--knockout {
  background: rgba(244, 196, 48, 0.3);
  color: var(--color-gold);
}
.cal-match__badge--final {
  background: var(--color-gold);
  color: var(--color-ink);
}

.cal-match__relative {
  margin-left: auto;
  font-size: 0.78rem;
  opacity: 0.75;
  font-style: italic;
}

.cal-match__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-sm);
  align-items: center;
  padding: 8px 0;
}

.cal-match__team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}
.cal-match__team--right {
  flex-direction: row;
  justify-content: flex-end;
  text-align: right;
}
.cal-match__team--tbd {
  opacity: 0.6;
  font-style: italic;
  font-weight: 500;
}

.cal-match__flag {
  font-size: 1.4rem;
  line-height: 1;
}

.cal-match__name {
  /* permet le wrap sur petits mobiles */
  word-break: break-word;
}

.cal-match__vs {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.25);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-match__venue {
  font-size: 0.78rem;
  opacity: 0.7;
  margin-top: 6px;
}

/* État vide */
.cal-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.15);
}
.cal-empty__icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}
.cal-empty p { margin: 4px 0; }

/* Note */
.cal-note {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
  margin: var(--space-xl) 0 var(--space-md);
  font-style: italic;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Lien "Calendrier" dans le header du hub
   -------------------------------------------------------------------------- */
.hub-nav {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 10;
}

.hub-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--color-white);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s var(--ease);
  min-height: 40px;
}
.hub-nav__link:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 480px) {
  .hub-nav { top: 12px; left: 12px; }
  .hub-nav__link { padding: 6px 12px; font-size: 0.85rem; }
}

/* ==========================================================================
   16. CALENDRIER — Engagement temps réel
   ========================================================================== */

/* --------------------------------------------------------------------------
   Bannière LIVE (sticky en haut, sous la topbar)
   -------------------------------------------------------------------------- */
.live-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
  color: var(--color-white);
  padding: 10px var(--space-md);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
  animation: live-banner-in 0.4s var(--ease);
  /* S'adapte si une pub est présente au dessus */
  margin-bottom: 0;
}

@keyframes live-banner-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.live-banner__match {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 0.95rem;
  flex-wrap: wrap;
  justify-content: center;
}

.live-banner__match + .live-banner__match {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.live-banner__pulse {
  width: 12px;
  height: 12px;
  background: var(--color-white);
  border-radius: 50%;
  animation: pulse-red 1.2s infinite;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}

@keyframes pulse-red {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70%  { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.live-banner__label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.live-banner__teams {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.live-banner__vs {
  opacity: 0.7;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 4px;
}

/* --------------------------------------------------------------------------
   Prompt d'activation des notifications (en haut, dismissable)
   -------------------------------------------------------------------------- */
.notif-prompt {
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.18), rgba(244, 196, 48, 0.08));
  border: 1px solid rgba(244, 196, 48, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: var(--space-md);
  animation: pop 0.4s var(--ease);
}

.notif-prompt__content {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.notif-prompt__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  animation: bell-shake 2s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes bell-shake {
  0%, 80%, 100% { transform: rotate(0); }
  85%           { transform: rotate(-12deg); }
  90%           { transform: rotate(12deg); }
  95%           { transform: rotate(-6deg); }
}

.notif-prompt__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-prompt__text strong {
  font-size: 0.95rem;
  color: var(--color-gold);
}
.notif-prompt__text span {
  font-size: 0.8rem;
  opacity: 0.85;
}

.notif-prompt__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-white);
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.notif-prompt__close:hover { background: rgba(255, 255, 255, 0.2); }

.notif-prompt .btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  min-height: 36px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .notif-prompt__content { gap: 10px; }
  .notif-prompt__text strong { font-size: 0.88rem; }
  .notif-prompt__text span   { font-size: 0.74rem; }
}

/* --------------------------------------------------------------------------
   Bouton notification sur chaque match
   -------------------------------------------------------------------------- */
.cal-match__notif {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 1rem;
  color: var(--color-white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.cal-match__notif:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(244, 196, 48, 0.5);
  transform: scale(1.08);
}
.cal-match__notif--on {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-ink);
  animation: bell-shake 0.6s var(--ease);
}
.cal-match__notif--on:hover {
  background: var(--color-gold-dark);
  border-color: var(--color-gold-dark);
  color: var(--color-white);
}

/* Si pas de relative à afficher (match imminent), on garde le bouton à droite quand même */
.cal-match__time { position: relative; }

/* --------------------------------------------------------------------------
   Compte à rebours individuel (matchs dans 24h)
   -------------------------------------------------------------------------- */
.cal-match--imminent {
  border-color: rgba(244, 196, 48, 0.5);
  background: rgba(244, 196, 48, 0.08);
  /* Léger glow doré pour attirer l'œil */
  box-shadow: 0 0 0 1px rgba(244, 196, 48, 0.25), 0 4px 16px rgba(244, 196, 48, 0.15);
}

.cal-match__countdown {
  font-size: 1.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--color-gold);
  text-align: center;
  padding: 8px 0;
  margin: 4px 0 6px;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

.cal-match__countdown--starting {
  font-size: 1.2rem;
  color: var(--color-white);
  background: var(--color-red);
  animation: starting-pulse 1s infinite;
}

@keyframes starting-pulse {
  0%, 100% { background: var(--color-red); }
  50%      { background: #b91c1c; }
}
