/* Reset + Base */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  text-decoration: none;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: url('../../images/mael.jpeg') no-repeat center center fixed;
  background-size: cover;
  color: #000;
  padding-top: 60px;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: -1;
}

h2 {
  margin-bottom: 1.5rem;
}

h2:not(:first-child) {
  margin: 2rem 0 1.5rem;
}

h2:not(:first-child)::before {
  content: "";
  display: block;
  height: 1px;
  background-color: rgb(209, 209, 209);
  width: 100%;
  margin-bottom: 0.8rem; /* espace entre la ligne et le h2 */
}

/* Header commun */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  gap: 10px;
}

#burger {
  display: none;
}

header h1 {
  color: #d4af37;
  font-size: 1.8rem;
  cursor: pointer;
}

nav.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav.menu a {
  background: #d4af37;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 5px;
  font-weight: bold;
}

nav.menu a:hover {
  background: #c09e30;
}

nav.menu a.active {
  background: #8e7523;
}

nav.menu a.disable {
  background: #382f12;
  cursor: not-allowed;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 10vh auto auto;
  padding: 2rem;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  max-height: 75vh;
  overflow-y: auto;
}

.container.admin {
  width: 95%;
  margin: auto;
  padding: 1rem;
  max-height: 95vh;
  overflow-y: scroll;
  overflow-x: hidden;
}

.container.jeu ul {
  margin: 0 0 1rem 2rem;
}

.container.classement .nb {
  padding: 8px 12px;
  border-radius: 5px;
  width: fit-content;
  margin-bottom: 1.2rem;
  color: white;
  background-color: rgb(31, 31, 31);
}

.container.classement .info {
  font-style: italic;
  font-size: 0.7rem;
  margin-bottom: 10px;
}

.container.classement table {
  border-radius: 8px;
}

.container.classement table td {
  border: 1px solid #d4af37;
  padding: 6px;
  font-size: 0.7rem;
}

.container.classement table th {
  border: 1px solid #ffffff;
  padding: 10px;
  background-color: #d4af37;
  color: white;
  font-size: 1rem;
  font-weight: 800;
}

.container.classement table tbody tr {
  cursor: pointer;
}

.container.classement table tbody tr:nth-child(1) {
  background-color: rgb(255, 243, 176);
}

.container.classement table tbody tr:nth-child(2) {
  background-color: rgb(223, 223, 223);
}

.container.classement table tbody tr:nth-child(3) {
  background-color: rgb(170, 158, 155);
}

.container.classement table tbody tr:nth-child(1) td {
  padding-top: 1rem;
  padding-bottom: 0.8rem;
}

.container.classement table tbody tr:nth-child(2) td {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.container.classement table tbody tr:nth-child(3) td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.container.classement table tbody tr:nth-child(1) td {
  font-size: 1rem;
  font-weight: 800;
}

.container.classement table tbody tr:nth-child(2) td {
  font-size: 0.9rem;
  font-weight: 800;
}

.container.classement table tbody tr:nth-child(3) td {
  font-size: 0.8rem;
  font-weight: 800;
}

@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 1rem;
    margin-top: 6vh;
    overflow-y: auto;
  }
}


/* Formulaires */

/* Messages d'erreur */
.error-message {
  color: #c0392b;
  background-color: #fbeee8;
  padding: 0.8rem 1rem;
  border: 1px solid #e0b4b4;
  border-left: 5px solid #c0392b;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Champ fichier stylé */
form input[type="file"] {
  padding: 0.6rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  color: #444;
}

input[type="file"]::after {
  content: attr(multiple);
}

form input[type="file"]::file-selector-button {
  background: #d4af37;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 1rem;
}

form input[type="file"]::file-selector-button:hover {
  background: #c09e30;
}

form input, form textarea, form select {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

form button,
.pagination-btn,
#popup button {
  width: 100%;
  background: #d4af37;
  color: #fff;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

#popup {
  max-height: 80%;
  overflow-y: auto;
  position: relative;
}

#popup button {
  width: fit-content;
}

#popup h3 {
  margin-bottom: 1rem;
}

#popup ul {
  margin-left: 0.8rem;
  overflow-y: auto;
  max-height: 80%;
}

#popup ul li {
  margin-bottom: 8px;
}

.pagination-btn {
  margin: 5px auto 20px;
}

form button:hover {
  background: #c09e30;
}

form .champ {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 5px;
}

/* Grille photos */
.photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .photos {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin .photos {
    max-width: 95%;
  }
}

.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  width: 100%;
  cursor: pointer;
}

.admin .photos {
  overflow-y: scroll;
  background-color: #c7c7c7;
}

.admin .photo {
  overflow: visible;
  width: 70%;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.admin .photo form {
  width: 100%;
}

.admin .table-container {
  width: 100%;
  overflow-x: auto;
}

.admin .table-container table {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px; /* Obligé de fixer un min sinon le scroll ne se déclenche pas */
}

.admin .table-container table td {
  border: 1px solid rgb(106, 106, 106);
}

.overlay {
  position: absolute;
  bottom: 5px;
  left: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Liste musiques */
li.music {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d5d5d5;
  background-color: #f1f1f1;
  list-style: none;
  margin: 10px 0;
  position: relative;
}

li.music .title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

li.music .name {
  font-size: 0.6rem;
  color: #414141;
  font-style: italic;
}

li.music span {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

li.music.refus {
  border: 1px solid #b69d9d;
  background-color: #dac0c0;
}

li.music.valide {
  border: 1px solid #aacdae;
  background-color: #c0e9c5;
}

/* Commentaire */
.comment {
  background: linear-gradient(135deg, #fff, #f9f9f9);
  border: 1px solid #ddd;
  border-left: 5px solid gold;
  border-radius: 12px;
  padding: 1.2rem;
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  color: #333;
  font-family: 'Georgia', serif;
  position: relative;
}

.comment .message {
  font-size: 1.2rem;
  line-height: 1.6;
  padding: 0 1.2rem;
  color: #555;
}

.comment .message::before,
.comment .message::after {
  font-size: 3rem;
  color: silver;
  position: absolute;
  font-family: serif;
}

.comment .message::before {
  content: "“";
  left: 10px;
  top: -15px;
}

.comment .message::after {
  content: "”";
  right: 10px;
  bottom: -30px;
}

.comment .author {
  text-align: right;
  margin-top: 1rem;
  font-size: 1rem;
  font-style: italic;
  color: goldenrod;
  padding-right: 40px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

.lightbox .nav {
  position: absolute;
  width: 100%;
  top: 50%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.lightbox .prev,
.lightbox .next {
  color: white;
  font-size: 3rem;
  padding: 1rem;
  cursor: pointer;
}

ul.programme li {
  list-style: none;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d5d5d5;
  background-color: #f1f1f1;
  list-style: none;
  margin: 10px 0;
  position: relative;
}

.programme li.passe {
  opacity: 0.5;
  text-decoration: line-through;
  color: #888;
}

.programme li.avenir {
  font-weight: bold;
}

.jeu-box {
  background: #fff9e6;
  border-left: 5px solid #f4c542;
  padding: 1.2rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.jeu-box a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.jeu-box h2 {
  margin: 0 0 10px;
}
.jeu-box a {
  text-decoration: none !important;
  color: black !important;
}
.jeu-box a:visited {
  color: inherit; /* ou une autre couleur de ton choix */
}

.jeu-box .time {
  font-style: italic;
  font-size: 0.8rem;
  margin-bottom: 10px;
  text-align: center;
}

.jeu-box #compte-a-rebours {
  background-color: rgb(41, 41, 41);
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 8px;
}

.accordion {
  background-color: #eee;
  color: #444;
  cursor: pointer;
  padding: 1rem;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  transition: background-color 0.2s ease;
  font-weight: bold;
  margin-top: 1rem;
  border-radius: 5px;
}
.accordion:hover {
  background-color: #ccc;
}
.accordion:after {
  content: '+';
  float: right;
}
.accordion.active:after {
  content: '-';
}
.panel {
  padding: 0 1rem;
  display: none;
  overflow: hidden;
  background-color: #f9f9f9;
  border-left: 3px solid #ccc;
}

/* Responsive ajustements */
@media (max-width: 768px) {

  nav.menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
  }

  nav.menu.active {
    display: flex;
  }

  #burger {
    display: block;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    z-index: 1000;
  }

  header {
    align-items: flex-start;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    background-color: rgb(228, 228, 228, 0.8);
  }

  header.admin {
    padding-top: 1rem;
    padding-bottom: 1rem;
    background-color: rgb(228, 228, 228, 0);
  }

  header h1 {
    font-size: 1.4rem;
    text-align: center;
  }

  header.admin h1 {
    font-size: 1.2rem;
  }

  nav.menu {
    flex-direction: column;
    align-items: center;
  }

  nav.menu a {
    width: 100%;
    text-align: center;
  }

  .container {
    padding: 1rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  ul li, .comment .message {
    font-size: 0.95rem;
  }

  .overlay {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .jeu-box a {
    flex-direction: column;
  }
}
