/* =========================================================
   SATURDAY PAGE
   ========================================================= */

/* Page parallax layout */
#sdr-page .parallax-item:nth-child(1) {
	position: relative;
	min-height: 600px;
	overflow: hidden;
}

#sdr-page .parallax-item:nth-child(2) {
	min-height: 30vh;
	height: auto;
	margin-top: 10vh;
	margin-bottom: 10vh;
	z-index: 2;
}

#sdr-page .parallax-item:nth-child(3) {
  min-height: 50vh;
  justify-content: flex-start;
  height: auto;
  z-index: 2;
}

/*============================
  Modal score
============================*/
.modal-score {
  --sdr-accent-rgb: 59, 130, 246;
  --sdr-second-rgb: 20, 184, 166;
}

.modal-score .sdr-modal-content {
  background:
    radial-gradient(460px 170px at 95% -20%, rgba(var(--sdr-accent-rgb), 0.32), transparent 60%),
    radial-gradient(320px 160px at 5% 0%, rgba(var(--sdr-second-rgb), 0.26), transparent 58%),
    #1f232d;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-score .sdr-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-score .sdr-modal-date {
  font-family: var(--font-family-base, Urbanist, sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
}

.modal-score .modal-body {
  flex: 1 1 auto;
  min-height: 0; /* Permet au bloc de rétrécir sans dépasser de l'écran */
  display: flex;
  flex-direction: column;
}

.modal-score .nav-tabs {
    border-bottom: none;
}

.modal-score .nav-link {
    border: none;
    margin-bottom: 5px;
    color: #757575;
    border-radius: var(--border-radius-10);;
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, transform 0.12s ease;
}

.modal-score .nav-link:hover {
    background-color: rgba(223, 223, 223, 0.45);
    color: #4f4f4f;
}

.modal-score .nav-link:active {
    transform: scale(0.97);
}

[data-bs-theme="dark"] .modal-score .nav-link {
    color: #b0b0b0;
}

[data-bs-theme="dark"] .modal-score .nav-link:hover {
    background-color: rgba(58, 58, 58, 0.65);
    color: #d8d8d8;
}

.modal-score .nav-link.active {
    background-color: #dfdfdf;
    border-radius: var(--border-radius-10);;
    color: black !important;
}

[data-bs-theme="dark"] .modal-score .nav-link.active {
    background-color: #3a3a3a;
    color: white !important;
}

/* Layout Sidebar/Scores modal */
.modal-score .sdr-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-score .sdr-grid-scores {
  min-height: 0;
}

@media (min-width: 768px) {
  .modal-score .sdr-modal-grid {
    grid-template-columns: minmax(100px, 15%) 1fr;
    grid-template-rows: 1fr auto;
    gap: 0 1.5rem;
  }
  .modal-score .sdr-grid-tabs {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }
  .modal-score .sdr-grid-vod {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    align-self: end;
  }
  .modal-score .sdr-grid-scores {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
  }
  .modal-score #dynamic-tabs-container .nav-tabs {
    flex-direction: column;
  }
  .modal-score #dynamic-tabs-container .nav-link {
    text-align: left;
    width: 100%;
  }
}

.modal-score .tab-content {
    background-color: #dfdfdf;
    border-radius: var(--border-radius-10);;
    padding: .5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-score #dynamic-content-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

[data-bs-theme="dark"] .modal-score .tab-content {
    background-color: #2a2a2a;
    color: white;
}

.modal-score.sdr-team-modal .tab-content {
    background: transparent;
    padding: 0;
}

.modal-score #score-table tbody tr td {
    background: transparent;
    border-bottom: 1px solid #a0a0a0;
}

[data-bs-theme="dark"] .modal-score #score-table tbody tr td {
    border-bottom: 1px solid #444;
}

.modal-score #score-table thead {
  border-bottom: none;
}

[data-bs-theme="dark"] .modal-score #score-table thead {
  border-bottom: none;
}

/* Les panes restent simples et n'affichent que l'onglet actif */
.modal-score .tab-content > .tab-pane {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-score .tab-content > .tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* Bouton close plus doux */
.modal-score .btn-close {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.modal-score .btn-close:hover,
.modal-score .btn-close:focus-visible {
  opacity: 1;
}

.modal-score #dynamic-vod-link {
  background-color: var(--bentocolor-youtube);
  border-color: var(--bentocolor-youtube);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.modal-score #dynamic-vod-link:hover,
.modal-score #dynamic-vod-link:focus-visible {
  background-color: var(--bentocolor-hover-youtube);
  border-color: var(--bentocolor-hover-youtube);
}

.modal-score .sdr-team-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .modal-score .sdr-team-board {
    grid-template-columns: repeat(var(--team-count, 1), minmax(220px, 1fr));
  }

  /* Force l'affichage des équipes sur Desktop (Désactive le collapse) */
  .modal-score .sdr-team-column-header {
    pointer-events: none;
    cursor: default;
  }
  .modal-score .sdr-team-chevron {
    display: none;
  }
  .modal-score .sdr-team-column-body.collapse {
    display: flex !important;
  }
}

.modal-score .sdr-team-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
}

.modal-score .sdr-team-column-header {
  padding: 0.55rem 1rem;
  cursor: pointer;
  user-select: none;
}

.modal-score .sdr-team-chevron {
  transition: transform 0.3s ease;
}

.modal-score .sdr-team-column-header[aria-expanded="false"] .sdr-team-chevron {
  transform: rotate(-90deg);
}

.modal-score .sdr-team-column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-score .sdr-team-column-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0px 0px 10px #0000005c;
}

.modal-score .sdr-team-column-count {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.88;
  white-space: nowrap;
}

.modal-score .sdr-team-column-body {
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: transparent;
}

.modal-score .sdr-team-column-body.show {
  display: flex;
}

.modal-score .sdr-team-table-wrap {
  width: 100%;
  overflow: hidden;
}

/* --- Fluidité absolue de l'animation collapse --- */
.modal-score .sdr-team-column-body.collapsing .sdr-score-table {
  overflow: hidden; /* Empêche le clignotement de la scrollbar */
}

.modal-score .sdr-team-column-body.collapsing .sdr-score-table thead th {
  position: relative; /* Empêche l'en-tête de bugger pendant le déroulement */
}

/*============================
  Card image
============================*/
.card-sdr {
  transition: box-shadow 0.35s ease, scale 0.35s ease;
  contain: layout style paint;
  will-change: transform, opacity, scale;
}

/* Date range compact spacing */
.date-range {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-range h2,
.date-range h6 {
  margin-bottom: 0.35rem;
}

.date-range-label {
  margin-bottom: 0;
  line-height: 1.1;
  text-align: left;
  flex: 0 0 auto;
}

.date-range-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.date-range-row .form-control {
  flex: 1 1 auto;
}

.card-sdr-img {
  overflow: hidden;
  object-fit: contain;
  cursor: pointer;
  position: relative;
  padding: 0;
  user-select: none;
  display: grid;
  transition: transform 0.35s ease;
  backface-visibility: hidden;
  transform: translateZ(0);
  contain: paint;
}

.card-sdr-img button {
  padding: 0 !important;
}

.card-sdr-img img {
  width: 100%;
  display: inherit;
  backface-visibility: hidden;
  transform: translateZ(0) scale(1.05);
  will-change: transform;
  -webkit-mask: linear-gradient(0deg, #0000 0%, #000 35% 100%, #0000);
  mask: linear-gradient(0deg, #0000 0%, #000 35% 100%, #0000);
  background: linear-gradient(-135deg, rgba(0, 0, 0, 1) 0%, transparent 50%);

}

.card-sdr-img::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, transparent 50%);
  background-size: 200%;
  transition: 0.2s all ease-in-out;
}

@media (hover: hover) {
  .card-sdr:hover {
    box-shadow: var(--xds-shadow-mini);
    scale: 1.02;
    z-index: 10;
  }

  .card-sdr:not(.dimmed):hover:before {
    background-position: 50%;
  }
}

.card-sdr .text-secondary {
  font-family: Hanson;
  color: white !important;
  font-size: 1.3rem;
  line-height: 22px;
  display: block;
  width: 20%;
}

.card-sdr.dimmed {
  filter: brightness(0.5);
  pointer-events: none;
  transition: filter 0.3s;
}

.highlight {
  border-radius: 6px;
  padding: 2px;
  animation: pulseGlowOffset 2.5s ease-in-out infinite;
}

@keyframes pulseGlowOffset {
  0% { box-shadow: 0 0 0 3px rgba(0, 103, 255, 1); }
  70% { box-shadow: 0 0 0 9px rgba(0, 103, 255, 0); }
  100% { box-shadow: 0 0 0 3px rgba(0, 103, 255, 1); }
}

.toggle-icon {
  float: right;
  font-size: 1.5rem;
  background: #b1b1b170;
  border-radius: var(--border-radius-10);;
  padding: 0px 6px;
  box-shadow: 0px 6px 12px 1px #00000032;
}

[data-bs-theme="dark"] .toggle-icon {
    background: #00000070;
    color: white;
}

.toggle-icon i {
    top: 3px;
}

/*============================
  Card typography
============================*/
.game-title {
  font-family: Hanson;
}

/*============================
  Table styles
============================*/
#score-table table,
.sdr-score-table table {
  margin-bottom: 0;
}

.modal-score #score-table,
.modal-score .sdr-score-table {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
}

.modal-score #score-table::-webkit-scrollbar,
.modal-score .sdr-score-table::-webkit-scrollbar {
  display: block;
  width: 6px;
  height: 6px;
}

.modal-score #score-table::-webkit-scrollbar-track,
.modal-score .sdr-score-table::-webkit-scrollbar-track {
  background: transparent;
  margin-top: 32px; /* La scrollbar commence sous l'en-tête (thead) fixe */
  margin-bottom: 8px;
}

.modal-score #score-table::-webkit-scrollbar-thumb,
.modal-score .sdr-score-table::-webkit-scrollbar-thumb {
  background-color: rgba(150, 150, 150, 0.5);
  border-radius: var(--border-radius-10);;
}

#score-table table tbody,
#score-table table thead,
.sdr-score-table table tbody,
.sdr-score-table table thead {
  vertical-align: middle;
}

#score-table thead th,
.sdr-score-table thead th {
  padding: 0.25rem;
  color: #747474;
  font-size: 14px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #dfdfdf;
  box-shadow: 0 2px 0 0 #a0a0a0;
}

[data-bs-theme="dark"] #score-table thead th,
[data-bs-theme="dark"] .sdr-score-table thead th {
    color: #a0a0a0;
    background-color: #2a2a2a;
    box-shadow: 0 2px 0 0 #444;
}

.modal-score #score-table thead th:last-child,
.modal-score #score-table tbody td:last-child,
.modal-score .sdr-score-table thead th:last-child,
.modal-score .sdr-score-table tbody td:last-child {
  padding-right: 8px; /* Décalage à droite pour aérer les points par rapport à la scrollbar */
}

#score-table tbody td,
.sdr-score-table tbody td {
  padding: 0.8vh;
  font-size: 16px;
  box-shadow: none;
}

#score-table tbody tr:last-child td,
.sdr-score-table tbody tr:last-child td {
  border-bottom: none;
}

#score-table tbody tr td,
.sdr-score-table tbody tr td {
  color: #747474;
}

[data-bs-theme="dark"] #score-table tbody tr td,
[data-bs-theme="dark"] .sdr-score-table tbody tr td {
    color: #dcdcdc;
}

#score-table tbody tr:first-child td,
.sdr-score-table tbody tr:first-child td {
  color: #686ef9 !important;
}

/*============================
  Mobile responsive
============================*/
@media screen and (max-width: 769px) {
  .card-sdr .text-secondary {
    font-size: 4.5vw;
    line-height: 20px;
  }
}
