@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── UI Feedback: Spinner + Toast ── */
.btnSpinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

.uiToast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: "Inter", system-ui, sans-serif;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.uiToast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.uiToast--success { background: #059669; color: #fff; }
.uiToast--error   { background: #dc2626; color: #fff; }
.uiToastIcon { font-weight: 700; margin-right: 4px; }

body.dark-mode .uiToast--success { background: #065f46; }
body.dark-mode .uiToast--error   { background: #991b1b; }

/* ── Language switcher ── */
.langProfileBtn {
  padding: 8px 16px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 0.9rem;
  transition: all 0.15s;
  &:hover { border-color: #1a6b8a; background: #f0f9ff; }
}
.langProfileBtnActive {
  border-color: #1a6b8a; background: #f0f9ff; font-weight: 600; color: #1a6b8a;
}
body.dark-mode .langProfileBtn { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-mode .langProfileBtn:hover { border-color: #38bdf8; background: #1e293b; }
body.dark-mode .langProfileBtnActive { border-color: #38bdf8; background: #1e293b; color: #38bdf8; }
.langBtn {
  background: none; border: 1.5px solid transparent; border-radius: 6px;
  font-size: 1.2rem; cursor: pointer; padding: 2px 6px;
  opacity: 0.5; transition: opacity 0.2s, border-color 0.2s;
  &:hover { opacity: 0.8; }
}
.langBtnActive { opacity: 1; border-color: #1a6b8a; }

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  transition: background-color 0.5s ease;
}

header,
footer {
  flex: none;
}

main{
  position: relative;
  width: 100%;

  flex: auto;
}

th, td {
  border: 0.5px solid #e2e8f0;
}

.title2{
  position: relative;
  padding-bottom: 25px;
  padding-top: 50px;
}

.title2 h2{
  margin: 0;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
}

td:not(.time){
  height: 20px;
  width: 13%;
  position: relative;
}


header{
  position: relative;
  background: linear-gradient(135deg, #1a6b8a 0%, #0f5068 100%);
  width: 100%;
  height: 68px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}


#loginform{
  position: relative;
  height: fit-content;
  display: block;
  margin-top: 0em;
  unicode-bidi: isolate;
  top: 6%;
}

.nametag{
  position: absolute;
  top: 15%;
  left: 20px;
  color: rgba(255,255,255,0.9);
  font-size: 0.82rem;
}


#date{
  position: absolute;
  bottom: 15%;
  left: 20px;
  color: rgba(255,255,255,0.9);
  font-size: 0.82rem;
}


.periode{
  position: absolute;
  top: 7px;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  width: 100%;
  text-align: center;
}


#eventButton{
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

#eventButton button{
  background-color: #141414;
  border: 1px solid rgba(54, 54, 54, 0.6);
  font-weight: 600;
  position: relative;
  outline: none;
  border-radius: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  height: 50px;
  width: 200px;
  opacity: 1;
  color: white;
  font-size: 15px;
  text-align: center;
}

@media only screen and (max-width: 600px) {
  #eventButton{
    top: auto;
  }
}


#signinform{
  position: relative;
  height: fit-content;
  top: 5%;
  display: block;
  margin-top: 0em;
  unicode-bidi: isolate;
}

#addEvent{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 16px;
  height: fit-content; /* Hauteur de 200 pixels */
  padding: 32px 36px;
  background-color: #ffffff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  display: none;
}

/* Sélectionner tous les div sauf celui avec l'id "exclusion" */
div:not(#addEvent), header, footer  {
  /*opacity: 0.15;*/
}


.time{
  position:relative;
  width: 7%;
  border:none;
}

@media only screen and (max-width: 600px) {
/* Conteneur principal */
#addEvent {
  background: #e6f0f0;         /* fond doux */
  border-radius: 12px;         /* coins arrondis */
  padding: 30px 40px;
  max-width: 400px;
  // margin: 40px auto;
  width: 50%;
  top: 45%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

#addEvent br {
  display: none;
}

#addEvent #name {
    width: -webkit-fill-available;
}

/* Titre */
#addEvent h2 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: #2c3e50;
}
.addEventDayLabel {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a6b8a;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}
body.dark-mode .addEventDayLabel { color: #38bdf8; }

/* Labels */
#addEvent label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 15px;
  color: #444;
}

/* Champs input et select */
#addEvent input[type="text"],
#addEvent select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  background-color: #fff;
  transition: all 0.2s ease-in-out;
}

#addEvent input[type="text"]:focus,
#addEvent select:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Bouton */
#addEvent button {
  display: block;
  width: 100%;
  margin-top: 25px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a6b8a, #0f5068);
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#addEvent button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#addEvent button:active {
  transform: translateY(0);
  box-shadow: none;
}

}

@media only screen and (max-width: 600px) {

  header{
    display: none;
    position: absolute;
  }

  footer{
    display: none;
    position: absolute;
  }
  .time{
    position:relative;
    width: 4%;
    border:none;
  }
}

.timeDiv{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  text-align: center;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}
td.time {
  vertical-align: top;
}


table{
  border-collapse: collapse;
  position: relative;
  width: 100%;
  animation: fadein 0.5s;

}

/* Empêche le zoom automatique iOS sur les inputs (font-size < 16px) */
@media only screen and (max-width: 600px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

@media only screen and (max-width: 600px) {
  /* Main en flex-column de hauteur fixe : évite tout scroll de page */
  main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 68px);
  }
  /* #terrainToggle et #mobileDayNav ne se compriment pas */
  #terrainToggle { flex-shrink: 0; }
  #mobileDayNav  { flex-shrink: 0; }
  #mobileWeekSlider { flex-shrink: 0; display: block; }
  /* #tableLocation prend tout l'espace restant et scrolle en interne */
  #tableLocation {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
    overscroll-behavior-x: contain;
    touch-action: pan-y;
    padding-bottom: 80px;
    box-sizing: border-box;
  }
  /* thead : invisible visuellement mais présent dans le layout pour table-layout:fixed */
  #tableLocation[data-col] thead th {
    height: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden;
    visibility: hidden;
  }
  /* Mode single-day : pas de scale, pleine largeur */
  #tableLocation[data-col] table {
    transform: none;
    width: 100%;
    min-width: unset;
  }
  /* Sans data-col (fallback) : ancien comportement scroll horizontal */
  #tableLocation:not([data-col]) {
    overflow-x: auto;
    touch-action: pan-x pan-y;
  }
  #tableLocation:not([data-col]) table{
    width: max-content;
    min-width: 100%;
    transform: scale(0.5);
    transform-origin: top left;
  }

  /* Reset de base */
#sous_mobile {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  display: block;
  width: 0;
  height: 0;
}

/* Les items */
#sous_mobile li {
  background: #f8fafc;
  margin: 8px 12px;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  font-size: 16px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

/* Effet au toucher */
#sous_mobile li:active {
  transform: scale(0.97);
  background: #e9ecef;
}

/* Le lien (même si tu n'utilises pas href) */
#sous_mobile li a#menu {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  display: block;
}

/* Spécial pour le bouton "Se déconnecter" */
#sous_mobile li:last-child {
  background: #dc2626;
  color: #fff;
}

#sous_mobile li:last-child a#menu {
  color: #fff;
}

}


.title{
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1;
  color: white;
  font-weight: 700;
  letter-spacing: -0.01em;
}

body{
  background-color: #f8fafc;
  font: 1rem "Inter", "Segoe UI", system-ui, sans-serif;
  scrollbar-gutter: stable;

  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;

  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);

  display: flex;
  flex-direction: column;

  min-height: 100vh;


}


.planningButtons{
  position: relative;
  align-content: center;
  height: 100px;

}

@media only screen and (max-width: 600px) {
  .planningButtons{
    position: fixed;
    height: 64px;
    bottom: 0;
    left: 0;
    transform: none;
    background: linear-gradient(135deg, #1a6b8a 0%, #0f5068 100%);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 100%;
    border-radius: 0;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  /* Reset positionnement absolu des boutons sur mobile */
  #homeButton, #eventButton, #my_account_button {
    position: relative;
    top: auto; left: auto; right: auto;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    flex-shrink: 0;
  }
  #homeButton {
    font-size: 1.45rem;
    color: rgba(255,255,255,0.9);
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
    letter-spacing: 0.05em;
  }
  /* "+" dessiné en CSS pour contrôler l'épaisseur exacte */
  #eventButton button {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative !important;
    &::before, &::after {
      content: '';
      position: absolute;
      background: rgba(255,255,255,0.9);
      border-radius: 1px;
    }
    &::before { width: 15px; height: 1.5px; }
    &::after  { width: 1.5px; height: 15px; }
  }
  #my_account_button img {
    width: 22px;
    height: 20px;
    object-fit: fill;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.9;
  }
  /* Feedback tactile — :active + ontouchstart pour iOS */
  #homeButton:active,
  #eventButton:active,
  #my_account_button:active {
    background: rgba(255,255,255,0.3) !important;
  }
}

thead{
  background-color: #e2e8f0;
  height: 44px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: #475569;
}

.removeCell {
  visibility: hidden;
  border:none;
}

.trainingCell{
  background-color: #dcfce7;
  color: #166534;
}

.trainingCell:hover{
  background-color: #bbf7d0;
  transition: background-color 0.15s ease;
}

.championshipCell{
  background-color: #fee2e2;
  color: #991b1b;
}

.championshipCell:hover{
  background-color: #fecaca;
  transition: background-color 0.15s ease;
}
.matchCell{
  background-color: #ede9fe;
  color: #5b21b6;
}

.matchCell:hover{
  background-color: #ddd6fe;
  transition: background-color 0.15s ease;
}

#weekButton{
  position: absolute;
  top: 50%;
  left: 90%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  display: flex;
}

#homeButton {
  display: none;
}
@media only screen and (max-width: 600px) {
  #homeButton {
    display: flex;
  }
}

#dark_sous_mobile{
  display: none;
}

@media only screen and (max-width: 600px) {
#dark_sous_mobile{
 position: absolute;
 display: block;
 top: 500px;
 right: 55%;
}
}

@media only screen and (max-width: 600px) {
  #weekButton{
    display: none;
  }
  #my_account_button{
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    display: flex;
    padding: 0;
  }
  #my_account_button:hover{
    .sous_mobile{
      display: block;
    }
  }

  #sous_mobile {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;              /* pas cliquable tant qu'invisible */
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  #sous_mobile.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    width: auto;
  }
}


.arrowRight{
  width: 0px;
  height: 0px;

  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;

  border-left: 15px solid black;
  position: relative;

}

.arrowLeft{
  width: 0;
  height: 0;

  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;

  border-right: 15px solid black;
}

@media only screen and (max-width: 600px) {
  .arrowRight { border-left-color: rgba(255,255,255,0.9); }
  .arrowLeft  { border-right-color: rgba(255,255,255,0.9); }
}


#deroulantArrow {
  width: 0;
  height: 0;

  border-right: 7px solid transparent;
  border-left: 7px solid transparent;

  border-top: 11px solid black;
  position: relative;
}


@media only screen and (min-width: 600px) {
#weekButton:hover{
  cursor: pointer;
  .arrowLeft{
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-right: 22px solid black;
  }
  .arrowRight{
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-left: 22px solid black;

  }
}
}



#delogButton{
  position: absolute;
  top: 18px;
  right: 20px;
}

#logButton{
  position: absolute;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  margin-top: 20px;
}

#signButton{
  position: absolute;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  margin-top: 0px;
}

button{
  background-color: #1a6b8a;
  border: none;
  font-weight: 600;
  position: relative;
  outline: none;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  height: 45px;
  width: 130px;
  opacity: 1;
  color: white;
  font-family: "Inter", system-ui, sans-serif;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

button:hover{
  background-color: #0f5068;
  color: white;
  transform: translateY(-1px);
}

button:active{
  cursor: wait;
}

button:not(:hover){
  background-color: #1a6b8a;
  transition: 0.15s;
}

#signinFailureMessage{
  color: #D40000;
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#loginFailureMessage{
  color: #D40000;
  position: absolute;
  bottom: 280px;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;

}

select{
  width: 150;
  font-size: 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  background-color: #ffffff;
  color: #1e293b;
  transition: border-color 0.15s ease;
}

select option{
  font-size: 25px;
}

input{
  height: 36px;
  width: 150;
  font-size: 15px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: #1e293b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

input:hover{
  box-shadow: 0 0 0 3px rgba(26,107,138,0.1);
  border-color: #1a6b8a;
}

/* ── Popup détail évènement ── */
#eventDetailPopup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
#eventDetailBox {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  max-width: 380px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
#eventDetailClose {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
  &:hover { color: #000; }
}
.epDay {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
  color: #1a6b8a;
  letter-spacing: 0.03em;
}
.epTitle {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
}
.epPeriode, .epUser, .epRecurrent {
  margin: 4px 0;
  font-size: 0.9rem;
  color: #444;
}
.epActions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.epDeleteBtn {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  &:hover { background: #a93226; }
}
.epPauseBtn {
  background: #e67e22;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  &:hover { background: #ca6f1e; }
}

.deletePicture{
  position: absolute;
  width: 10px;
  left: 5px;
  bottom: 5px;
  z-index: 1;
}

.pauseEvent{
  position: absolute;
  width: 12px;
  left: 25px;
  bottom: 5px;
  z-index: 1;
}

.recurrentEvent{
  position: absolute;
  width: 12px;
  right: 5px;
  top: 5px;
  z-index: 1;
}

h1:hover{
  cursor: pointer;
  opacity: 0.85;
}


.deletePicture:hover{
  cursor: -webkit-grab;
  width: 14px;
}

.deletePicture:active{
  cursor: -webkit-grabbing;
}

.deleteText{
  position: absolute;
  bottom: 5px;
  width: 75%;
  left: 42px;
  font-size: 13px;
  font-style: oblique;
  opacity: 0;
  background-color: azure;
  text-align: center;
  z-index: 1;
  border: 1px solid black;
}

.pauseEvent:hover{
  cursor: -webkit-grab;
  width: 16px;
}

// .pauseEvent:active{
//   cursor: -webkit-grabbing;
// }

.pauseText{
  position: absolute;
  bottom: 0px;
  width: 100%;
  left: 50px;
  font-size: 13px;
  font-style: oblique;
  opacity: 0;
  background-color: azure;
  text-align: center;
  z-index: 1;
  border: 1px solid black;
}

// .recurrentEvent:hover{
//   cursor: -webkit-grab;
//   width: 14px;
// }

// .recurrentEvent:active{
//   cursor: -webkit-grabbing;
// }

.recurrentText{
  position: absolute;
  top: 30px;
  width: 75%;
  right: -50px;
  font-size: 13px;
  font-style: oblique;
  opacity: 0;
  background-color: azure;
  text-align: center;
  z-index: 1;
  border: 1px solid black;
}


::-webkit-scrollbar {
  width: 6px;
}

/* Track */
::-webkit-scrollbar-track {
  background: #f1f5f9;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


input[type="checkbox"] {
  width: 20px; /* Largeur souhaitée */
  height: 20px; /* Hauteur souhaitée */
}

#cgu{
  display: flex;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.indexButton{
  background-color: #1a6b8a;
  border: none;
  font-weight: 600;
  position: relative;
  outline: none;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  height: 150px;
  width: 300px;
  opacity: 1;
  color: white;
  margin-bottom: 0px;
  font-size: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Inter", system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(26,107,138,0.25);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.indexLogo {
  display: none;
}

@media only screen and (max-width: 600px) {
  .indexMain {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28vh 24px 0;
    box-sizing: border-box;
  }
  .indexLogo {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
  }
  .indexLogo img {
    width: 180px;
    height: auto;
  }
  .indexButtons {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0;
    width: 100%;
  }
  .indexButtons br { display: none; }
  .indexButton {
    width: 100% !important;
    max-width: 320px;
    height: 56px !important;
    font-size: 17px !important;
    border-radius: 14px;
    left: auto !important;
    transform: none !important;
    margin-bottom: 0 !important;
  }
  .indexButton:not(:hover) {
    transform: none !important;
  }
  .indexButton:hover {
    transform: none !important;
    box-shadow: 0 4px 16px rgba(26,107,138,0.25);
  }
  .indexButton:active {
    opacity: 0.85;
  }
}

.indexButtons{
  position: relative;
  width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

}


.container {
  justify-content: center; /* Centrer horizontalement */
  text-align: center; /* Centrer verticalement */
  height: 100vh;
}


.progressive-image {
  opacity: 0;
  transition: opacity 1s ease-in-out;
  width: 600px;
  height: auto;
}


#trainingConfirm {
  font-size: 24px; /* Taille de la police */
  transition: color 0.1s ease-in-out; /* Transition pour le changement de couleur */
  align-items: center; /* Centrer verticalement */

}

.indexButton:hover{
  background-color: #0f5068;
  color: white;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,107,138,0.35);
}

.indexButton:active{
  cursor: wait;
}

.indexButton:not(:hover){
  background-color: #1a6b8a;
  transform: translateX(-50%);
  transition: 0.15s;
}

footer{
  position: relative;
  width: 100%;
  height: 56px;
  background-color: #1e293b;
  margin-top: auto;
  align-content: center;
}


.footerTitle{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}

.privacyPolicy{
  position: absolute;
  top: 50%;
  left: 30%;
  transform: translate(-50%, -50%);
  text-align: center;
  text-decoration: none;
  color: #94a3b8;
}


.privacyPolicy a{
  text-decoration: none;
  color: #94a3b8;
  &:hover { color: #e2e8f0; }
}


.termsOfUse{
  position: absolute;
  top: 50%;
  left: 70%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}


.termsOfUse a{
  text-decoration: none;
  color: #94a3b8;
  &:hover { color: #e2e8f0; }
}




.login{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

main.loginPage, main.historyPage {
  background: #f8fafc;
  padding: 32px 16px;
  box-sizing: border-box;
  height: calc(100vh - 68px - 56px);
  overflow-y: auto;
}

/* ── History page ── */
.historyCard {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 28px 32px;
  max-width: 600px;
  margin: 0 auto;
  box-sizing: border-box;
}
.historyCard h2 { margin: 0 0 20px; font-size: 1.5rem; color: #0f172a; }
.historyStats { margin-bottom: 24px; }
.historyStatTotal {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0;
}
.historyStatNum { font-size: 1.8rem; font-weight: 700; color: #1a6b8a; }
.historyStatLabel { font-size: 0.85rem; color: #64748b; }
.historyStatMonths { display: flex; flex-wrap: wrap; gap: 12px; }
.historyStatMonth {
  display: flex; flex-direction: column; align-items: center;
  background: #f0f9ff; border-radius: 10px; padding: 10px 16px; min-width: 80px;
}
.historyStatMonth .historyStatNum { font-size: 1.3rem; }
.historyStatMonth .historyStatLabel { font-size: 0.75rem; }
.historyMonthTitle { font-size: 1rem; font-weight: 600; color: #334155; margin: 20px 0 8px; }
.historyEvent {
  display: flex; gap: 14px; padding: 10px 0;
  border-bottom: 1px solid #f1f5f9; align-items: flex-start;
}
.historyEvent:last-child { border-bottom: none; }
.historyPast { opacity: 0.6; }
.historyEventDate {
  min-width: 60px; font-size: 0.8rem; font-weight: 600;
  color: #1a6b8a; text-transform: capitalize;
}
.historyEventTime { font-size: 0.9rem; font-weight: 500; color: #0f172a; }
.historyEventType { font-size: 0.82rem; color: #64748b; }
.historyEventTerrain { font-size: 0.78rem; color: #94a3b8; }

@media only screen and (max-width: 600px) {
  main.historyPage { height: auto; min-height: 100vh; padding: 12px; }
  .historyCard { padding: 20px 16px; }
}

/* Dark mode history */
body.dark-mode .historyCard { background: #1e293b; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
body.dark-mode .historyCard h2 { color: #e2e8f0; }
body.dark-mode .historyStatTotal { border-color: #334155; }
body.dark-mode .historyStatMonth { background: #0f172a; }
body.dark-mode .historyMonthTitle { color: #cbd5e1; }
body.dark-mode .historyEvent { border-color: #334155; }
body.dark-mode .historyEventTime { color: #e2e8f0; }
body.dark-mode .historyEventDate { color: #38bdf8; }

@media only screen and (max-width: 600px) {
  main.loginPage {
    height: auto;
    min-height: 100vh;
    padding: 24px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
  }
  .loginCard {
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 100%;
    width: 100%;
    margin-top: 16px;
  }
  .loginCard h2 {
    font-size: 1.4rem;
  }
}

.loginCard {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 32px 40px;
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;

  h2 {
    margin: 0;
    font-size: 1.6rem;
    color: #0f172a;
    text-align: center;
  }

  form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: static;
    height: auto;
  }

  #logButton {
    position: static;
    transform: none;
    width: 100%;
    height: 48px;
    font-size: 1rem;
    margin-top: 4px;
  }

  #loginFailureMessage {
    position: static;
    transform: none;
    text-align: center;
    min-height: 20px;
  }
}

.loginCard form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: static !important;
  height: auto !important;
  transform: none !important;
  left: auto !important;
  width: 100% !important;
}

.loginField {
  display: flex;
  flex-direction: column;
  gap: 7px;

  label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
  }

  input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;

    &:focus {
      border-color: #1a6b8a;
    }
  }
}

.forgotPassword {
  text-align: center;
  font-size: 0.875rem;
  color: #1a6b8a;
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

.loginField select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  outline: none;
  box-sizing: border-box;
  cursor: pointer;

  &:focus {
    border-color: #1a6b8a;
  }
}

.cguRow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: #374151;

  input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
  }

  a {
    color: #1a6b8a;
    &:hover { text-decoration: underline; }
  }
}

.loginCard #signButton,
.loginCard #logButton,
.loginCard #signinFailureMessage,
.loginCard #loginFailureMessage {
  position: static !important;
  transform: none !important;
  left: auto !important;
}

.loginCard #signButton,
.loginCard #logButton {
  width: 100%;
  height: 48px;
  font-size: 1rem;
  margin-top: 4px;
}

form{
  position: relative;
  height: fit-content;
}

.signin{
  position: absolute;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  margin-top: 20px;
  padding-top: 300px;
}


.monCompte{
  height: 68px;
  position: absolute;
  top: 0;
  right: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

#deroulant{
  position: relative;
  width: 100%;
  text-align: center;
  color: black;
  text-decoration: none;
  z-index: 9001;
}


#sous{
  margin: 0;
  position: absolute;
  background-color: #ffffff;
  width: 240px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);

  top: 68px;
  right: 16px;

  padding: 0;
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  list-style: none;
}


ul:not(.ulNotif){
  list-style: none;
}

li:not(.liNotif){
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
  list-style: none;
}


li:hover:not(.liNotif) #menu{
  color: #1a6b8a;
}


li:hover:not(.liNotif){
  border-color: transparent;
  background-color: #f0f9ff;
  cursor: pointer;
}

#menu{
  position: static;
  transform: none;
  text-decoration: none;
  color: #1e293b;
  font-size: 0.9rem;
}


#suggestion{
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 16px;
  height: auto; /* Hauteur de 200 pixels */
  padding-left: 20px;
  padding-right: 20px;
  background-color: #ffffff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  display: none;
}

#suggestion div{
  position: relative;
  height: 50%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 20px;
}

#suggestion div textarea{
  width: 100%;
  position: relative;
}

#suggestion div button{
  position: relative;
}

#suggestion div label{
  position: relative;
}


#confirmMessage{
  position: absolute;
  bottom: 10%;
}


#bug{
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 16px;
  height: auto; /* Hauteur de 200 pixels */
  padding-left: 20px;
  padding-right: 20px;
  background-color: #ffffff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  display: none;
}

#bug div{
  position: relative;
  height: 50%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 20px;
}

#bug div textarea{
  width: 100%;
  position: relative;
}

#bug div button{
  position: relative;
}

#bug div label{
  position: relative;
}


#confirmMessage{
  position: absolute;
  bottom: 10%;
}



.myInfo{
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ── My Info page (new layout) ── */
.myInfoPage {
  max-width: 560px;
  margin: 30px auto;
  padding: 0 16px 40px;
}
.myInfoPage h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.4rem;
  color: #1a1a1a;
}
.myInfoCard {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.myInfoCard h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #334155;
}
.myInfoRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.myInfoRow:last-child { border-bottom: none; }
.myInfoLabel {
  font-size: 0.9rem;
  color: #64748b;
}
.myInfoValue {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}
.myInfoTerrain {
  display: inline-flex;
  align-items: center;
  margin: 4px 6px 4px 0;
  padding: 5px 12px;
  background: #f0f4f8;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #334155;
}
.myInfoTerrain small {
  color: #94a3b8;
  margin: 0 6px;
}
.myInfoTerrainRemove {
  cursor: pointer;
  color: #cbd5e1;
  font-size: 0.75rem;
  margin-left: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.myInfoTerrainRemove:hover { color: #ef4444; }
.myInfoSubLabel {
  font-size: 0.85rem;
  color: #64748b;
}
.myInfoJoinBtn {
  margin: 4px 6px 4px 0;
  padding: 5px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.myInfoJoinBtn:hover { border-color: #1a6b8a; background: #f0f9ff; }
.myInfoJoinRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.myInfoInput {
  padding: 7px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 150px;
}
.myInfoSelect {
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
}
.myInfoJoinKeyBtn {
  padding: 7px 16px;
  background: #1a6b8a;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.myInfoJoinKeyBtn:hover { background: #145a74; }

/* Dark mode */
body.dark-mode .myInfoPage h2 { color: #e2e8f0; }
body.dark-mode .myInfoCard { background: #1e293b; border-color: #334155; }
body.dark-mode .myInfoCard h3 { color: #cbd5e1; }
body.dark-mode .myInfoRow { border-bottom-color: #334155; }
body.dark-mode .myInfoLabel { color: #94a3b8; }
body.dark-mode .myInfoValue { color: #e2e8f0; }
body.dark-mode .myInfoTerrain { background: #0f172a; color: #e2e8f0; }
body.dark-mode .myInfoTerrain small { color: #64748b; }
body.dark-mode .myInfoTerrainRemove { color: #475569; }
body.dark-mode .myInfoJoinBtn { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-mode .myInfoJoinBtn:hover { border-color: #38bdf8; background: #1e293b; }
body.dark-mode .myInfoInput { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-mode .myInfoSelect { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-mode .myInfoJoinKeyBtn { background: #38bdf8; color: #0f172a; }
body.dark-mode .myInfoSubLabel { color: #64748b; }


.blockConfirmation{
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  flex-direction: column;
}

.blockConfirmation div{
  text-align: center;
}

#addEvent form button{
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 5%;
}

#addEvent h2{
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

@media only screen and (max-width: 600px) {
  #addEvent h2{
    display: none;
    position: absolute;
  }
}

#addEventErrorImg, #addEventErrorTxt{
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}



// darkmode button
body {
  background-color: #f8fafc;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
/* ── Availability popup ── */
.availOverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 2000; display: flex; justify-content: center; align-items: center;
}
.availBox {
  background: #fff; border-radius: 14px; padding: 24px 28px;
  max-width: 420px; width: 90%; position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2); max-height: 80vh; overflow-y: auto;
}
.availBoxWide { max-width: 560px; }
.availClose {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #666;
  &:hover { color: #000; }
}
.availBox h3 { margin: 0 0 4px; font-size: 1.1rem; color: #0f172a; }
.availSubtitle { font-size: 0.8rem; color: #64748b; margin: 0 0 16px; }
.availSlotRow {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap;
}
.availSlotRow select {
  padding: 6px 8px; border: 1.5px solid #e2e8f0; border-radius: 6px;
  font-size: 0.85rem; background: #fff; outline: none;
  &:focus { border-color: #1a6b8a; }
}
.availDay { flex: 1; min-width: 90px; }
.availStart, .availEnd { width: 70px; }
.availDash { color: #94a3b8; font-weight: 500; }
.availRemoveBtn {
  background: none; border: none; color: #dc2626; font-size: 1.1rem;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  &:hover { background: #fef2f2; }
}
.availAddBtn {
  display: block; width: 100%; padding: 8px; margin: 8px 0;
  background: none; border: 1.5px dashed #cbd5e1; border-radius: 8px;
  color: #64748b; cursor: pointer; font-size: 0.85rem;
  &:hover { border-color: #1a6b8a; color: #1a6b8a; }
}
.availSaveBtn {
  display: block; width: 100%; padding: 10px; margin-top: 8px;
  background: linear-gradient(135deg, #1a6b8a, #0f5068); color: #fff;
  border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  &:hover { opacity: 0.9; }
}
.availAdminDay { margin-bottom: 14px; }
.availAdminDay h4 { margin: 0 0 6px; font-size: 0.95rem; color: #334155; }
.availAdminSlot { display: flex; gap: 8px; padding: 4px 0; font-size: 0.85rem; }
.availAdminName { font-weight: 500; color: #0f172a; min-width: 100px; }
.availAdminTime { color: #64748b; }

/* Dark mode availability */
body.dark-mode .availBox { background: #1e293b; }
body.dark-mode .availBox h3 { color: #e2e8f0; }
body.dark-mode .availSubtitle { color: #94a3b8; }
body.dark-mode .availSlotRow select { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.dark-mode .availRemoveBtn { color: #f87171; }
body.dark-mode .availRemoveBtn:hover { background: #1e293b; }
body.dark-mode .availAddBtn { border-color: #334155; color: #94a3b8; }
body.dark-mode .availAddBtn:hover { border-color: #38bdf8; color: #38bdf8; }
body.dark-mode .availClose { color: #94a3b8; }
body.dark-mode .availClose:hover { color: #e2e8f0; }
body.dark-mode .availAdminDay h4 { color: #cbd5e1; }
body.dark-mode .availAdminName { color: #e2e8f0; }

body.dark-mode {
  background-color: #0f172a;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
.dark-mode-toggle {
  position: absolute;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin: 10px;
  border-radius: 15px;
  background-color: #cbd5e1;
  transition: background-color 0.3s;
  top: 0px;
  margin: 0;
  left: 0;
}
.dark-mode-toggle:before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #fff;
  transition: left 0.3s;
}
.dark-mode-toggle.checked {
  background-color: #1a6b8a;
}
.dark-mode-toggle.checked:before {
  left: 32px;
}


.dark-mode-togglee {
  position: absolute;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin: 10px;
  border-radius: 15px;
  background-color: #cbd5e1;
  transition: background-color 0.3s;
  top: 0px;
  margin: 0;
  left: 0;
}
.dark-mode-togglee:before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #fff;
  transition: left 0.3s;
}
.dark-mode-togglee.checked {
  background-color: #1a6b8a;
}
.dark-mode-togglee.checked:before {
  left: 32px;
}

input#dark-mode-switch{
    display: none;
}

#darkModePic{
  width: 30px;
  position: absolute;
  right: 0px;

}

@media only screen and (max-width: 600px) {
#darkModePic{
  width: 30px;
  position: absolute;
  right: 10px;
}
}

#dark{
  position: absolute;
  left: 18%;
  top: 25px;
  margin: 0;
  height: 30px;
  width: 100px;
}




/* ── Terrain picker ── */
#terrainToggle {
  position: relative;
  height: 36px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

#terrainSlider {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  &::-webkit-scrollbar { display: none; }
  &.dragging { cursor: grabbing; user-select: none; }
}

.tPad {
  flex-shrink: 0;
  /* width set by JS to allow first/last items to center */
}

.terrainSlide {
  flex-shrink: 0;
  scroll-snap-align: center;
  padding: 0 18px;
  font-size: 0.78rem;
  color: #b0bec5;
  white-space: nowrap;
  transition: color 0.2s, font-size 0.2s, font-weight 0.2s;
  pointer-events: none; /* drag only, click handled on container */
}

.terrainSlide.active {
  color: #1a6b8a;
  font-size: 0.88rem;
  font-weight: 700;
}

/* Fixed center indicator bar */
#terrainBar {
  position: absolute;
  bottom: 0;
  height: 2.5px;
  background: #1a6b8a;
  border-radius: 2px;
  pointer-events: none;
  transition: left 0.25s ease, width 0.25s ease;
}

body.dark-mode .terrainSlide        { color: #475569; }
body.dark-mode .terrainSlide.active { color: #38bdf8; }
body.dark-mode #terrainBar          { background: #38bdf8; }

/* ── Terrain search popup ── */
#terrainSearchPopup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 9000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tspInner {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.tspHeader {
  padding: 16px 16px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.tspHeader input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  &:focus { border-color: #1a6b8a; }
}
.tspList {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}
.tspItem {
  padding: 12px 20px;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s;
  &:hover, &:active { background: #f1f5f9; }
}
.tspItem.tspActive {
  color: #1a6b8a;
  font-weight: 600;
}
body.dark-mode .tspInner       { background: #1e293b; }
body.dark-mode .tspHeader      { border-color: #334155; }
body.dark-mode .tspHeader input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.dark-mode .tspItem        { color: #cbd5e1; }
body.dark-mode .tspItem:hover  { background: #334155; }
body.dark-mode .tspItem.tspActive { color: #38bdf8; }

body.dark-mode header {
  background: linear-gradient(135deg, #0f3d52 0%, #0a2a38 100%);
}
body.dark-mode #sous {
  background-color: #1e293b;
}
body.dark-mode li:not(.liNotif) {
  border-bottom-color: #334155;
}
body.dark-mode li:hover:not(.liNotif) {
  background-color: #1e3a4a;
}
body.dark-mode #menu {
  color: #e2e8f0;
}
body.dark-mode button:not(.epDeleteBtn):not(.epPauseBtn):not(#eventDetailClose) {
  background-color: #1a6b8a;
  color: white;
}
body.dark-mode thead {
  background-color: #1e293b;
  color: #94a3b8;
}
body.dark-mode td:not(.trainingCell):not(.matchCell):not(.championshipCell) {
  background-color: #0f172a;
}
body.dark-mode th, body.dark-mode td {
  border-color: #1e293b;
}
body.dark-mode .timeDiv {
  color: #94a3b8;
}
body.dark-mode footer {
  background-color: #0f172a;
  color: #94a3b8;
}
body.dark-mode footer a { color: #64748b; }

/* ── Dark mode: Login / Signup ── */
body.dark-mode main.loginPage { background: #0f172a; }
body.dark-mode .loginCard { background: #1e293b; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
body.dark-mode .loginCard h2 { color: #e2e8f0; }
body.dark-mode .loginField label { color: #cbd5e1; }
body.dark-mode .loginField input,
body.dark-mode .loginField select {
  background: #0f172a; color: #e2e8f0; border-color: #334155;
}
body.dark-mode .loginField input:focus,
body.dark-mode .loginField select:focus { border-color: #38bdf8; }
body.dark-mode .loginField input::placeholder { color: #64748b; }
body.dark-mode .forgotPassword { color: #38bdf8; }
body.dark-mode .cguRow { color: #cbd5e1; }
body.dark-mode .cguRow a { color: #38bdf8; }
body.dark-mode #signinFailureMessage,
body.dark-mode #loginFailureMessage { color: #f87171; }

/* ── Dark mode: Index page ── */
body.dark-mode .indexMain { background: #0f172a; }
body.dark-mode .indexButton {
  background: #1e293b; color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-color: #334155;
}
body.dark-mode .indexButton:hover { background: #334155; }

/* ── Dark mode: Add Event form ── */
body.dark-mode #addEvent {
  background: #1e293b; color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
body.dark-mode #addEvent h2 { color: #e2e8f0; }
body.dark-mode #addEvent label { color: #cbd5e1; }
body.dark-mode #addEvent input[type="text"],
body.dark-mode #addEvent select {
  background: #0f172a; color: #e2e8f0; border-color: #334155;
}
body.dark-mode #addEvent input[type="text"]:focus,
body.dark-mode #addEvent select:focus {
  border-color: #38bdf8; box-shadow: 0 0 5px rgba(56,189,248,0.3);
}

/* ── Dark mode: Event detail popup ── */
body.dark-mode #eventDetailBox {
  background: #1e293b; color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
body.dark-mode #eventDetailClose { color: #94a3b8; }
body.dark-mode #eventDetailClose:hover { color: #e2e8f0; }
body.dark-mode .epDay { color: #38bdf8; }
body.dark-mode .epPeriode,
body.dark-mode .epUser,
body.dark-mode .epRecurrent { color: #94a3b8; }

/* ── Dark mode: Mobile menu ── */
body.dark-mode #sous_mobile li {
  background: #1e293b; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
body.dark-mode #sous_mobile li:active { background: #334155; }
body.dark-mode #sous_mobile li a#menu { color: #e2e8f0; }

/* ── Dark mode: Terrain picker ── */
body.dark-mode #terrainSlider { background: #0f172a; }
body.dark-mode .terrainSlide { color: #64748b; }
body.dark-mode .terrainSlide.active { color: #38bdf8; }

/* ── Dark mode: general ── */
body.dark-mode main { background: #0f172a; color: #e2e8f0; }
body.dark-mode a { color: #38bdf8; }
body.dark-mode #addEventErrorTxt { color: #f87171; }

/* ── Navigation jour mobile ── */
#mobileDayNav {
  display: none;
}
#mobileWeekSlider {
  display: none;
}
@media only screen and (max-width: 600px) {
  #mobileDayNav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 200;
  }
  #mobileDayLabel {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    text-transform: capitalize;
    letter-spacing: -0.01em;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background 0.12s;
    &:active { background: #e2e8f0; }
  }
  .mobileDayBtn {
    background: none !important;
    border: none !important;
    -webkit-appearance: none;
    appearance: none;
    font-size: 2rem;
    color: #1a6b8a;
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    &:hover { background: none !important; }
    &:focus { background: none !important; outline: none !important; }
    &:active { background: rgba(26,107,138,0.12) !important; }
  }
  .mobileWeekToggle {
    font-size: 1.1rem !important;
    width: 32px !important;
    height: 32px !important;
    color: #94a3b8 !important;
    position: static !important;
    transform: none !important;
    flex-shrink: 0;
    margin-left: 4px;
  }
  .mobileWeekToggle:active {
    background: none !important;
  }
  .mobileWeekToggle.weekActive {
    color: #1a6b8a !important;
    background: rgba(26,107,138,0.10) !important;
  }
  #mobileWeekSlider {
    display: block !important;
    padding: 6px 12px 8px;
    background: #f8fafc;
    flex-shrink: 0;
  }
  .weekSliderTrack {
    position: relative;
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    height: 32px;
    overflow: hidden;
  }
  .weekSliderThumb {
    position: absolute;
    top: 2px;
    left: 0;
    width: 50%;
    height: calc(100% - 4px);
    background: white;
    border-radius: 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: left 0.25s ease;
    z-index: 0;
  }
  .weekSliderOption {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    z-index: 1;
    cursor: pointer;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .weekSliderOption.weekSliderActive {
    color: #1e293b;
    font-weight: 600;
  }

  /* Masquer toutes les colonnes jour sauf l'active (via data-day attr) */
  #tableLocation[data-col] td[data-day="0"],
  #tableLocation[data-col] th[data-day="0"] {
    width: 52px;
    min-width: 52px;
  }
  #tableLocation[data-col] td:not([data-day="0"]),
  #tableLocation[data-col] th:not([data-day="0"]) {
    display: none;
  }
  #tableLocation[data-col="1"] td[data-day="1"],
  #tableLocation[data-col="1"] th[data-day="1"] { display: table-cell; }
  #tableLocation[data-col="2"] td[data-day="2"],
  #tableLocation[data-col="2"] th[data-day="2"] { display: table-cell; }
  #tableLocation[data-col="3"] td[data-day="3"],
  #tableLocation[data-col="3"] th[data-day="3"] { display: table-cell; }
  #tableLocation[data-col="4"] td[data-day="4"],
  #tableLocation[data-col="4"] th[data-day="4"] { display: table-cell; }
  #tableLocation[data-col="5"] td[data-day="5"],
  #tableLocation[data-col="5"] th[data-day="5"] { display: table-cell; }
  #tableLocation[data-col="6"] td[data-day="6"],
  #tableLocation[data-col="6"] th[data-day="6"] { display: table-cell; }
  #tableLocation[data-col="7"] td[data-day="7"],
  #tableLocation[data-col="7"] th[data-day="7"] { display: table-cell; }

  /* Hauteur uniforme par slot de 15min sur mobile */
  #tableLocation[data-col] td:not([data-day="0"]) {
    height: 22px;
    min-height: 22px;
  }
  /* Les cellules de temps aussi, pour que les lignes internes aux rowspan soient 22px */
  #tableLocation[data-col] td.time {
    height: 22px;
    min-height: 22px;
  }
  /* Heure dans cellule event : flow normal, plus d'absolu */
  #tableLocation[data-col] td.trainingCell .periode,
  #tableLocation[data-col] td.matchCell .periode,
  #tableLocation[data-col] td.championshipCell .periode {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
  }
  /* Event cells : centré, overflow caché, même box-model que les cellules vides */
  #tableLocation[data-col] td.trainingCell,
  #tableLocation[data-col] td.matchCell,
  #tableLocation[data-col] td.championshipCell {
    vertical-align: middle;
    text-align: center;
    padding: 2px 4px;
    box-sizing: border-box;
    font-size: 0.78rem;
    overflow: hidden;
  }
  #tableLocation[data-col] td .timeDiv {
    font-size: 0.68rem;
  }

  body.dark-mode #mobileDayNav {
    background: #0f172a;
    border-bottom-color: #1e293b;
  }
  body.dark-mode #mobileDayLabel { color: #e2e8f0; }
  body.dark-mode .mobileDayBtn { color: #38bdf8; }
  body.dark-mode #mobileWeekSlider { background: #0f172a; }
  body.dark-mode .weekSliderTrack { background: #1e293b; }
  body.dark-mode .weekSliderThumb { background: #334155; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
  body.dark-mode .weekSliderOption { color: #64748b; }
  body.dark-mode .weekSliderOption.weekSliderActive { color: #e2e8f0; }
}

/* ── Date picker mobile ── */
#mobileDatePicker {
  display: none;
}
@media only screen and (max-width: 600px) {
  #mobileDatePicker {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 3000;
    align-items: flex-end;
    animation: fadein 0.15s ease;
  }
  .mdpInner {
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 32px;
    width: 100%;
  }
  .mdpTitle {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 14px;
  }
  .mdpWeekLabel {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 10px 0 6px;
  }
  .mdpGrid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  .mdpDay {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: none !important;
    border-radius: 10px;
    padding: 6px 2px;
    cursor: pointer;
    width: auto !important;
    height: auto !important;
    gap: 2px;
    -webkit-tap-highlight-color: transparent;
    &:active { background: #e2e8f0; }
  }
  .mdpDayName {
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: capitalize;
  }
  .mdpDayNum {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
  }
  .mdpDay.mdpActive {
    background: #1a6b8a;
    .mdpDayName { color: rgba(255,255,255,0.7); }
    .mdpDayNum  { color: #fff; }
  }
  body.dark-mode .mdpInner { background: #1e293b; }
  body.dark-mode .mdpDay { background: #0f172a; }
  body.dark-mode .mdpDayNum { color: #e2e8f0; }
}
