/* Fonts */
@font-face {
  font-family: 'SouthPark';
  src: url("southpark.ttf");
}

/* Global Styles */
body {
  background-color: rgb(40, 47, 75) !important;
}
/* Empêcher le scroll horizontal sur mobile */
body, html {
  overflow-x: hidden; /* Cache tout défilement horizontal */
  width: 100%; /* S'assure que le body et html prennent toute la largeur de l'écran */
  margin: 0; /* Éviter toute marge excédentaire sur le body */
  padding: 0; /* Enlever tout padding qui pourrait entraîner un dépassement */
  box-sizing: border-box; /* Inclure bordures et padding dans la largeur totale */
}

div {
  color: aliceblue !important;
}

a {
  color: aliceblue !important;
  text-decoration: none !important;
}

a:hover,
button:hover {
  color: cadetblue !important;
}

button,
.button {
  padding: 5px;
  color: aliceblue !important;
  border: solid !important;
}

label {
  font-weight: bold !important;
}

.alert {
  color: black !important;
}

/* Heading Styles */
h1, h2, h3, h4, h5, h6, .font-southpark {
  font-family: 'SouthPark' !important;
  color: aliceblue !important;
}

h1 {
  font-size: 300% !important;
}


/* Layout Utilities */
.width-30, .width-40, .width-50, .width-100 {
  margin: auto;
}

.width-30 { width: 30% !important; }
.width-40 { width: 40% !important; }
.width-50 { width: 50% !important; }
.width-100 { width: 100% !important; }

/* List Styling */
.list-group-item {
  background-color: transparent !important;
  border: none !important;
  color: aliceblue !important;
}

.list-group {
  height: 200px !important;
  overflow-y: auto !important;
}

/* Scrollable Character Section */
.characters-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  width: 90%;
  max-width: 90%;
  margin: auto;
}

.characters-container {
  display: flex;
  gap: 30px;
  overflow: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  width: 100%;
  padding: 10px;
  cursor: grab;
  user-select: none;
}

/* Character Card Styles */
.character-card {
  text-align: center;
  min-width: 140px;
  transition: transform 0.1s ease-in-out;
  user-select: none;
  cursor: pointer;
  border-radius: 8%;
}

.character-name {
  text-align: center;
  display: inline-block;
  max-width: 140px;
  overflow-wrap: break-word;
  white-space: normal;
}

.character-card.active {
  background-color: rgba(0, 0, 0, 0.336);
  transition: 0.3s;
}

.character-card:hover {
  background-color: rgba(0, 0, 0, 0.171);
}

/* Navigation Arrows */
.scroll-btn {
  background: none !important;
  color: white;
  border: none !important;
  cursor: pointer;
  padding: 10px 15px;
  font-size: 24px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  transition: background 0.3s;
}

.scroll-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.scroll-btn.left { left: -40px; }
.scroll-btn.right { right: -40px; }

/* Media Queries */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem !important; margin: 10px 0; }
  .characters-wrapper { width: 100%; }
  .characters-container { gap: 10px; padding: 5px; }
  .character-card { min-width: 120px; font-size: 0.8rem; }
  .character-card img { width: 100px; }
  .sound-block img { width: 80px; }
  .scroll-btn { display: none; }
  .global-div { margin: auto !important; }
}


/* Modification de #sounds-container pour s'assurer que la grille est bien contenue */
#sounds-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 colonnes sur grand écran */
  gap: 16px;
  width: 100%;  /* S'assurer que le conteneur prend toute la largeur disponible */
  max-width: 100vw;  /* Limiter la largeur à 100% de la vue (100vw pour inclure la largeur de l'écran) */
  box-sizing: border-box; /* Inclure le padding dans la largeur totale */
  margin: 0 auto; /* Centrer le conteneur */
}

/* Assurer que les éléments dans la grille prennent 100% de la largeur sans déborder */
.sound-item {
  width: 100%;  /* Éléments prennent 100% de la largeur */
  max-width: 100%;  /* Pas de dépassement */
  padding: 0 8px;  /* Ajuster un peu les paddings pour éviter l'espace excédentaire */
  box-sizing: border-box; /* Inclure padding et bordure dans la largeur totale */
}

/* Assurer que la liste de sons prend toute la largeur sans débordement */
.sounds-list {
  margin-top: 40px;
  padding: 0 8px; /* Petit padding pour la liste */
  width: 100%;
  box-sizing: border-box; /* Ne pas dépasser */
  overflow-x: hidden; /* Empêcher le débordement horizontal de la liste */
}

@media (max-width: 992px) {
  #sounds-container {
    grid-template-columns: repeat(3, 1fr);  /* 3 éléments par ligne pour tablettes */
  }
}

@media (max-width: 768px) {
  #sounds-container {
    grid-template-columns: repeat(2, 1fr);  /* 2 éléments par ligne pour petits écrans */
  }
}

@media (max-width: 576px) {
  #sounds-container {
    grid-template-columns: repeat(1, 1fr);  /* 1 élément par ligne pour très petits écrans */
  }
}

.row {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Sound & Modal Styles */
.sounds-list { margin-top: 40px; padding: 20px; }
.sounds-list .list-group-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sounds-list audio { width: 100%; max-width: 300px; }
.block { background-color: rgba(0, 0, 0, 0.301); padding: 20px; height: 140px; border-radius: 10px; align-content: center !important;}
.sentence { margin: 0 10px; font-weight: bold; width: 100%; }
.modal-content { background-color: rgb(43, 51, 71) !important; }
#search-bar { width: 80%; background-color: #343a40; color: white; border: 1px solid #495057; padding: 10px; }
#search-bar::placeholder { color: #adb5bd; }
#search-bar:focus { background-color: #212529; outline: none; border-color: #17a2b8; }
.sort select { background-color: #343a40; color: white; border: 1px solid #495057; padding: 10px; width: min-content;}


.favorite-icon {
  color: #ccc;
  transition: color 0.3s;
}

.favorite-icon.fas {
  color: gold;
}