/* css/index-style.css */
/* Cache le menu burger et la sidebar mobile par défaut */
#burgerMenu,
#mobileSidebar {
  display: none;
}
.search-tool {
  text-align: center;
  margin-bottom: 20px;
  margin-top: 21.44px;
}

#searchInput {
  flex-grow: 1;
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
  cursor: pointer;
}

.search-tool #filterButton,
.search-tool #resetButton {
  width: 50%;
  height: 29px;
  padding: 5px;
  margin: 5px;
  box-sizing: border-box;
  cursor: pointer;
  color: white;
  background-color: rgb(151, 151, 151);
  border-radius: 5%;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Effet au survol */
.search-tool #filterButton:hover,
.search-tool #resetButton:hover {
  background-color: rgb(100, 100, 100);
  transform: scale(1.1);
}

/* Effet au clic */
.search-tool #filterButton:active,
.search-tool #resetButton:active {
  transform: scale(0.9);
}

#containerSong {
  display: flex;
}

#leftSong {
  flex: 1;
}

#rightSong {
  flex: 1;
}

#popularSongs,
#recentSongs,
#filteredSongs {
  display: flex;
  flex-direction: column;
}

#popularSongs li,
#recentSongs li,
#filteredSongs li {
  cursor: pointer;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

#popularSongs li:last-child,
#recentSongs li:last-child,
#filteredSongs li:last-child {
  border-bottom: none;
}

#popularSongs li:hover,
#recentSongs li:hover,
#filteredSongs li:hover {
  text-decoration: underline;
  color: #007bff;
}

#titlePopular,
#titleRecentlyAdded,
#titlefiltered {
  font-weight: bold;
  font-size: 18px;
  color: #333;
  margin-top: 10px;
}

.school-logo {
  transition: transform 0.3s ease;
}

.school-logo:hover {
  transform: scale(1.1);
}

/* === Desktop layout (min-width: 769px) === */
@media screen and (min-width: 769px) {

  /* Affiche la sidebar classique à gauche */
  .sidebar {
    display: block;
    width: 200px;
    background-color: #f4f4f4;
    padding: 20px;
    height: auto;
  }

  /* Cache le menu mobile */
  #burgerMenu,
  #mobileSidebar {
    display: none !important;
  }

  /* Container principal en ligne (desktop) */
  .container {
    flex-direction: row;
  }
}

/* === Responsive mobile layout (max 768px) === */
@media screen and (max-width: 768px) { 

  /* Conteneur principal en colonne */
  #containerSong {
    flex-direction: column;
  }
  /* Sections gauche et droite pleine largeur */
  #leftSong,
  #rightSong {
    width: 100%;
  }

  #popularSongs li,
  #recentSongs li,
  #filteredSongs li {
    font-size: 18px;
    padding: 15px;
    margin: 10px auto;
    border-radius: 8px;
    background-color: #f4f4f4;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

  #popularSongs li:hover,
  #recentSongs li:hover,
  #filteredSongs li:hover {
    background-color: #ddd;
    color: #000;
    text-decoration: none;
  }

  /* Réduction du titre */
  h1 {
    font-size: 28px;
    text-align: center;
    margin-top: 10px;
  }

  /* Header compact + bouton login visible */
  header {
    padding: 10px;
  }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #nav a,
  #login a {
    font-size: 16px;
    color: white;
  }

  #login {
    order: -1;
    align-self: flex-start;
  }

  #mobileSidebar {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: #f4f4f4;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  #burgerMenu {
    position: absolute;
    top: 3.45%;
    left: 85%;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
  }
  
  /* barres fixes */
  .bar {
    height: 4px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: transform 0.4s ease, opacity 0.4s ease, top 0.4s ease;
    position: absolute;
    left: 0;
  }
  
  /* Position initiale des barres */
  .bar.top {
    top: 0;
  }
  
  .bar.middle {
    top: 50%;
    transform: translateY(-50%);
  }
  
  .bar.bottom {
    top: 100%;
    transform: translateY(-100%);
  }
  
  /* === Animation vers croix === */
  #burgerMenu.active .bar.top {
    top: 50%;
    transform: rotate(45deg) translateY(-50%);
  }
  
  #burgerMenu.active .bar.middle {
    opacity: 0;
  }
  
  #burgerMenu.active .bar.bottom {
    top: 50%;
    transform: rotate(-45deg) translateY(-50%);
  }
  
  

  #mobileSidebar.active {
    display: block;
    transform: translateX(0);
  }

  .sidebar {
    display: none;
  }
}
