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

body {
  font-family: 'MedievalSharp', cursive;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-image: url('/img/background.webp');
  background-size: cover;
  background-position: center;
  color: #e5d2a0;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Overlay semi-transparent */
  z-index: -1; /* Position derrière le contenu du body */
}

.alert {
  padding: 15px;
  margin: 20px 0;
  border: 1px solid transparent;
  border-radius: 5px;
  position: fixed; /* Position fixe pour rendre l'alerte flottante */
  top: 20px; /* Distance du haut de la page */
  width: auto; /* Largeur automatique */
  z-index: 1000; /* S'assurer que l'alerte est au-dessus des autres éléments */
}

.alert-danger {
  background-color: rgba(255, 0, 0, 0.8); /* Fond rouge plus opaque */
  color: #fff; /* Couleur du texte blanche pour un meilleur contraste */
  border-color: rgba(255, 0, 0, 0.9); /* Bord rouge légèrement plus foncé */
}

.alert-link {
  color: #fff; /* Couleur du lien blanche pour un bon contraste */
  font-weight: bold;
}

.alert-link:hover {
  text-decoration: underline; /* Soulignement au survol */
}

.close {
  border: none;
  background: none;
  color: #fff; /* Couleur du bouton de fermeture en blanc */
  font-size: 1.5em;
  cursor: pointer;
}

.close:hover {
  color: #ccc; /* Couleur plus claire au survol */
}


.container, .register-container, .login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
}

.box, .register-box, .login-box {
  background-color: rgba(50, 50, 50, 0.9);
  padding: 20px;
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.title, .register-title, .login-title {
  font-size: 2em;
  color: #e5d2a0;
  margin-bottom: 10px;
}

.subtitle, .register-subtitle, .login-subtitle {
  color: #b0a087;
  margin-bottom: 20px;
}

form {
  display: flex;
  flex-direction: column;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  padding: 10px;
  margin-bottom: 10px;
  border: none;
  border-radius: 5px;
  font-size: 1em;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border: 2px solid #d4af37;
}

.checkbox-container {
  display: flex;
  align-items: center; /* Aligne verticalement la case à cocher et le label */
  margin-bottom: 15px; /* Espace en dessous de la case */
}

input[type="checkbox"] {
  width: 20px; /* Largeur personnalisée de la case à cocher */
  height: 20px; /* Hauteur personnalisée de la case à cocher */
  margin-right: 10px; /* Espace entre la case à cocher et le label */
  cursor: pointer; /* Affiche un curseur pointer pour indiquer que la case est cliquable */
}


.button, .register-button, .login-button, .create-button {
  background-color: #d4af37;
  color: #2e1e0f;
  padding: 10px 20px;
  font-size: 1em;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.button:hover, .register-button:hover, .login-button:hover, .create-button:hover {
  background-color: #e5d2a0;
}

.prompt, .register-prompt, .login-prompt {
  margin-top: 15px;
  color: #b0a087;
}

.prompt a, .register-prompt a, .login-prompt a {
  color: #d4af37;
  text-decoration: none;
}

.prompt a:hover, .register-prompt a:hover, .login-prompt a:hover {
  text-decoration: underline;
}

/* Styles pour la page de gestion des personnages */
.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.header h1 {
  font-size: 1.8em;
  color: #d4af37;
  text-align: center;
}

.create-button {
  margin-top: 10px;
  text-align: center;
}

.character-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  justify-content: center;
}

.character-card {
  background-color: rgba(50, 50, 50, 0.9);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 250px;
  overflow: hidden;
  text-align: center;
  padding: 15px;
  color: #b0a087;
}

.character-image {
  width: 100%;
  height: auto;
  border-radius: 5px;
  margin-bottom: 10px;
}

.character-info {
  text-align: left;
}

.character-name {
  font-size: 1.4em;
  color: #e5d2a0;
  margin-bottom: 10px;
  text-align: center;
}

.stats-list {
  list-style-type: none;
  padding: 0;
  text-align: left;
}

.stats-list li {
  margin: 5px 0;
}

.stats-list li strong {
  color: #d4af37;
}


.user-section {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 1.2em;
  color: #e5d2a0;
}

.user-name {
  margin-right: 10px;
}

.dropdown {
  display: inline-block;
  /* position: relative; */
}

.dropdown-toggle {
  background-color: #d4af37;
  color: #2e1e0f;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.dropdown-toggle:hover {
  background-color: #e5d2a0;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: rgba(50, 50, 50, 0.9);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dropdown-menu .dropdown-item {
  color: #e5d2a0;
  padding: 8px 10px;
  text-decoration: none;
  display: block;
}

.dropdown-menu .dropdown-item:hover {
  background-color: rgba(212, 175, 55, 0.8);
}

.dropdown:hover .dropdown-menu {
  display: block;
  z-index: 100;
}

/* Style des séparateurs */
.dropdown-menu hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #ccc;
    opacity: 0.7;
}

.admin-only {
  display: none; /* Affiché uniquement si l’utilisateur est admin */
}

/* Media Queries pour appareils mobiles */
@media (max-width: 768px) {
  .box, .register-box, .login-box, .character-card {
    width: 90%;
  }

  body {
    padding-top: 70px; /* Ajustez cette valeur pour laisser plus d'espace */
  }
  
  .header h1 {
    font-size: 1.6em;
  }

  .create-button {
    width: 100%;
    font-size: 1em;
  }

  .character-name {
    font-size: 1.2em;
  }
}


@media (max-width: 480px) {
  .title, .register-title, .login-title, .header h1 {
    font-size: 1.5em;
  }

  .create-button {
    font-size: 0.9em;
    padding: 8px;
  }

  .character-card {
    max-width: 100%;
  }

  .character-name {
    font-size: 1.1em;
  }
  body {
    padding-top: 70px; /* Ajustez cette valeur pour laisser plus d'espace */
  }
}
