/*-----------------------------------------------------------*/

/*var pour theme sombre et clair*/

:root {
  --primary-background-color: #121212;
  --primary-text-color: white;
  --secondary-background-color: #282828;
  --third-background-color: #412622;
  --hover-color: rgb(184, 57, 19);
}

.light-theme {
  --primary-background-color: white;
  --primary-text-color: black;
  --secondary-background-color: rgb(221, 221, 221);
  --third-background-color: #cab0ab;
  --hover-color: rgb(226, 82, 14);
}

html {
  background-color: var(--primary-background-color);
  color: var(--primary-text-color);
}

/*-----------------------------------------------------------*/

/* Reset CSS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  text-decoration: none;
  transition: all 0.2s ease-out;
  scroll-behavior: smooth;
}

/*---------------------------------------------------THEME SWITCH--------*/

/*theme label*/

.theme-switch {
  user-select: none;
  cursor: pointer;
  scale: 1.5;
  padding: 0 10px;
  border-left: solid 2px var(--primary-text-color);
}
.theme-switch:hover {
  color: var(--hover-color);
}

#theme-toggle:checked ~ .theme-switch {
  font-variation-settings: "FILL" 1;
}

/*----------------------------------------------------BODY-------*/

/* Body styles */
body {
  font-family: Arial, sans-serif;
}

/* -------------------------------------------------Loader----------- */

.loader {
  z-index: 100000;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background-color: var(--primary-background-color);
  /*animation de fade out*/

  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;

  img {
    width: 70%;
    max-width: 400px;
  }

  p {
    font-size: 24px;
    color: var(--primary-text-color);
    padding: 24px;
    font-family: "VT323", monospace;
  }
}

.loader-hidden {
  opacity: 0;
  visibility: hidden;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.blink {
  animation: blink 1.3s step-end infinite;
}

/*-----------------------------------------------HEADER------------*/

/* Header styles */
header {
  background-color: var(--secondary-background-color);
  padding: 0 3%;
  position: fixed;
  display: grid;
  grid-template-columns: 1fr 1fr 0.5fr;
  top: 0;
  width: 100%;
  height: 80px;
  z-index: 100;

  a {
    color: var(--primary-text-color);
    padding: 10px 0;
  }
  a:hover {
    color: var(--hover-color);
  }
}

header div {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

/*menu burger*/

.off-screen-menu {
  position: absolute;
  background-color: var(--secondary-background-color);
  bottom: 0px;
  opacity: 0;
  left: 0;
  width: 100%;
  height: 80px;
  border-top: solid 2px var(--primary-text-color);
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
  ul {
    display: flex;
    justify-content: center;
    align-items: center;
    li {
      padding: 0 15px;
    }
  }
}
.off-screen-menu.active {
  opacity: 100%;
  bottom: -80px;
  pointer-events: all;
}

.ham-menu {
  width: 35px;
  height: 45px;
  margin: 0 auto;
  position: relative;
  cursor: pointer;

  span {
    height: 5px;
    width: 100%;
    background-color: var(--primary-text-color);
    border-radius: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.ham-menu:hover {
  span {
    background-color: var(--hover-color);
  }
}

.ham-menu span:nth-child(1) {
  top: 25%;
}
.ham-menu span:nth-child(3) {
  top: 75%;
}

.ham-menu.active span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}
.ham-menu.active span:nth-child(2) {
  opacity: 0;
}
.ham-menu.active span:nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}
/*---------------*/

#logo-nav {
  font-family: "VT323", monospace;
  font-size: 24px;
}

#nav-mid {
  display: flex;
  justify-content: flex-end;
  padding: 0 15px;
}
#nav-side {
  display: flex;
  justify-content: end;
}

header nav ul {
  display: flex;
  justify-content: center;

  li {
    padding: 0 15px;
  }
}
/*---------------------------------------ACCUEIL------------*/

#hero {
  margin-top: 50px;
  width: 100vw;
  background-image: url("/images/autre/banner.jpg");
  background-size: cover;
  background-position: center;
  overflow: hidden;
  color: white;
  display: flex;
  gap: 20px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 700px;
}

#intro-text{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 0 20px;
  width: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5));

  h1 {
    font-size: 50px;
    margin-bottom: 20px;
  }

  p {
    margin-bottom: 20px;
    max-width: 800px;
    text-align: center;
    line-height: 1.5em;
    padding: 0 20px;
    font-size: 24px;
  }
}

#logo-anim {
  position: relative;
  max-width: 600px;
  width: 100%;
  max-height: 600px;
  height:100vw;
  animation: logoHover 5s infinite;

  img{
    position: absolute;
    top: 0;
    width: 100%;
  }

  p {
    position: absolute;
    width: 100%;
    bottom: 50%;
    text-align: center;
    font-family: "VT323", monospace;
    font-size: 80px;
    text-align: center;
    text-shadow: 0px 5px 5px black;
  }
}

@keyframes logoHover {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

.inter-text{
  margin:40px 0;
  text-align: center;
}

.desc {
  margin-bottom: 20px;
  padding: 20px;
  h2{
    text-align: center;
    margin-bottom: 20px;
  }
}

main .desc p{
  font-size: 24px;

}

#carousel {
  display: flex;
  width: 100%;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  height: fit-content;
  overflow-y: hidden;
  margin-top: 40;
}

.carousel-item {
  width: 100vw;
  max-width: 350px;
  height: 500px;
  scroll-snap-align: start;
  position: relative;
  border-radius: 20px;
  margin: 0 30px;
  margin-bottom: 20px;
  box-shadow: black 0px 5px 5px;
}

.carousel-item img {
  object-fit: cover;
  width: 100vw;
  max-width: 350px;
  height: 100%;
  border-radius: 20px;
}

.carousel-info{
  overflow: hidden;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5));
  padding: 20px;
  border-radius: 20px;
  h2{
    position: absolute;
    bottom: 20px;
    font-size: 24px;
    color: white;
  }
}

/*----------------------------------------------------MAIN-------*/

#container {
  min-height: 85vh;
}

/* Main content styles */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px auto;
  margin-top: 90px;
  text-align: center;
  width: 100%;
  max-width: 1080px;
}

.main-title {
  grid-column: 1/3;
}

main h1 {
  font-size: 36px;
  margin-bottom: 20px;
}

main p {
  font-size: 18px;
}

article {
  grid-column: 1 / 3;
  background-color: var(--secondary-background-color);
  border-radius: 20px;
  padding: 0px;
  text-align: justify;
}

#liste-jeux {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
  gap: 5px;
  grid-auto-flow: dense;
}

.large {
  grid-column: span 2;
  grid-row: span 2;
  height: 400px;
}

.moyen {
  grid-column: span 1;
  grid-row: span 1;
  height: 200px;
}

.affichage-jeu {
  position: relative;
  width: 100%;
  border-radius: 0px;
  overflow: hidden;

  img {
    object-fit: cover;
    height: 100%;
    width: 100%;
  }

  .info-jeu {
    background-color: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(5px);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    padding: 20% 0;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    gap: 10px;
    opacity: 0%;
    margin: 0;
    p {
      color: white;
      font-size: 24px;
    }
    h3 {
      color: white;
      font-size: 30px;
    }
  }
  .info-jeu:hover {
    opacity: 100%;
  }
}

.btn {
  width: 100%;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  a {
    padding: 10px 20px;
    font-size: 16px;
    background-color: var(--primary-text-color);
    color: var(--primary-background-color);
    border: none;
    border-radius: 5px;
    text-align: center;
  }

  a:hover {
    background-color: var(--hover-color);
  }
}

.pop-up {
  border: solid 2px var(--hover-color);
  border-radius: 20px;
  text-align: center;
  padding: 20px 0;
  h2 {
    margin-bottom: 20px;
  }
}

.succes {
  background-color: green;
  color: white;
  padding: 10px 0;
  font-size: 14px;
  border-radius: 5px;
  text-align: center;
  margin: 10px 0;
}

.preview {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 10px;
  img {
    margin: 0 20px;
    width: 250px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
  }
  div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 70%;
    text-align: left;
    h3 {
      font-size: 30px;
    }
    p {
      font-size: 24px;
    }
  }
}
/*--------------------------------------Tableau des jeux-----------------*/

#tableau-jeu {
  display: flex;
  flex-direction: column;
  grid-column: 1 / 3;
}

.row-jeu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  img {
    width: 30%;
    height: 90%;
    object-fit: cover;
    border-radius: 10px;
  }
}

.row-info-jeu {
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  width: 70%;
  text-align: left;
  h3 {
    font-size: 30px;
  }
  p {
    font-size: 24px;
  }

  a {
    color: var(--primary-text-color);
    padding: 10px 0;
    text-decoration: underline;
    text-underline-offset: 5px;
  }
  a:hover {
    color: var(--hover-color);
  }
}

.admin {
  grid-column: 1/3;
  width: 400px;
  margin: 0 auto;

  .btn {
    margin-top: 0;
  }

  li {
    margin: 20px;
  }
}
/*----------------------------------------------------FORM-------*/

/* Form styles */

form {
  display: grid;
  grid-column: 1/3;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 20px auto;
  width: 100%;
  max-width: 500px;
  padding: 20px;
  background-color: var(--secondary-background-color);
  border-radius: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;

  .red {
    color: red;
  }
}

.erreur {
  background-color: red;
  color: white;
  padding: 10px 0;
  font-size: 14px;
  border-radius: 5px;
}

label {
  font-size: 18px;
  text-align: left;
}

input,
select {
  padding: 10px;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid var(--primary-text-color);
}

button[type="submit"] {
  padding: 10px 20px;
  font-size: 16px;
  background-color: var(--primary-text-color);
  color: var(--primary-background-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button[type="submit"]:hover {
  background-color: var(--hover-color);
}

/*-----------------------------------------------Admin table------------*/

/* Article container */
.data-table {
  position: relative;
  max-width: 100vh;
  margin: 20px auto;
  padding: 20px;
  background-color: var(--secondary-background-color);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Button container */
.data-table .btn {
  position: absolute;
  top: -60px;
  left: 0px;
  width: fit-content;
  border-radius: 10px;
  margin: 0;
  margin-bottom: 20px;
  justify-content: center;
  align-items: start;
  background-color: var(--secondary-background-color);
  border: 20px solid var(--secondary-background-color);
}

.data-table .btn a {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-text-color);
  color: var(--primary-background-color);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.data-table .btn a:hover {
  background-color: var(--hover-color);
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  font-size: 16px;
  img {
    max-width: 100px;
    width: 10vw;
  }
}

thead {
  background-color: var(--primary-text-color);
  color: var(--primary-background-color);
}

thead td {
  font-weight: bold;
  text-align: left;
  border-left: 0;
  text-align: center;
}

tbody tr:nth-child(odd) {
  background-color: var(--primary-background-color);
}

tbody tr:nth-child(even) {
  background-color: var(--secondary-background-color);
}

td {
  text-align: center;
  border-left: 1px solid var(--primary-text-color);
  width: 40px;
  padding: 10px 0;
}

/* Links inside the table */
tbody a {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

tbody a:hover {
  color: #0056b3;
}

.red a {
  color: red;
}

.red a:hover {
  color: var(--hover-color);
}
/*--------------------------------------------------FOOTER---------*/

#scroll-top {
  opacity: 75%;
  position: fixed;
  display: flex;
  justify-content: center;
  justify-items: center;
  font-size: 6em;
  width: 80px;
  height: 80px;
  bottom: 20px;
  right: 20px;
  border: solid 4px var(--primary-text-color);
  background-color: var(--primary-background-color);
  color: var(--primary-text-color);
  padding: 10px;
  border-radius: 50%;
  overflow: hidden;
  span {
    position: absolute;
    top: -15px;
  }
}

#scroll-top:hover {
  opacity: 100%;
  background-color: var(--primary-text-color);
  color: var(--primary-background-color);
}

/* Footer styles */
footer {
  background-color: var(--secondary-background-color);
  text-align: center;
  padding: 10px 0;
  width: 100%;
}

footer p {
  font-size: 14px;
}

/*----------------------------------------------------////////////DESKTOP////////////-------*/

/* Responsive design */
@media (min-width: 576px) {
  header {
    grid-template-columns: 1fr 8fr 0.5fr;
  }

  .ham-menu {
    display: none;
  }

  .off-screen-menu {
    position: relative;
    background-color: none;
    opacity: 100%;
    border-top: none;
    pointer-events: all;
  }

  .off-screen-menu.active {
    bottom: 0;
  }

  article {
    grid-column: auto;
    padding: 40px;
  }

  #liste-jeux {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-column: 1/3;
    gap: 10px;

    .large {
      height: 800px;
    }

    .moyen {
      height: 400px;
    }

    .affichage-jeu {
      border-radius: 10px;
      img {
        object-fit: cover;
        height: 100%;
        width: 100%;
      }
    }
  }

  .pop-up {
    grid-column: 1/3;
    max-width: 800px;
    width: 80%;
    margin: 0 auto;
  }

  #tableau-jeu {
    display: flex;
    flex-direction: column;
    grid-column: 1 / 3;
  }

  .row-jeu {
    img {
      width: 30%;
      max-height: 150px;
      object-fit: cover;
      border-radius: 10px;
    }
  }

  .row-info-jeu {
    h3 {
      font-size: 24px;
    }
    p {
      font-size: 18px;
    }
  }

  #scroll-top {
    scale: 0.75;
  }

  .data-table {
    grid-column: 1/3;
    margin: 0 auto;
    max-width: fit-content;
    font-size: 24px;
    table {
      width: 100%;
    }
    td {
      width: 100px;
    }
  }
}
