/* styles.css */

/* --- Règles globales --- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #fff7f9;  /* Fond clair et doux */
  color: #444;
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Animation d'apparition pour le contenu --- */
main {
  padding: 20px 0;
  animation: fadeIn 1s ease-in-out;
  min-height: calc(100vh - 120px);
  background-color: #fff7f9;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Header et Navigation --- */
header {
  background: linear-gradient(135deg, #a8edea, #fed6e3);
  padding: 15px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: padding 0.3s;
}

header.scrolled {
  padding: 8px 0;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.nav-menu li {
  margin-left: 20px;
}

.nav-menu li a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-menu li a:hover {
  color: #ff8a80;
}

/* --- Liens customisés --- */
/* Ces règles s'appliquent à tous les liens ayant la classe clean-link ou dashboard-link */
a.clean-link,
a.dashboard-link {
  color: #444 !important;       /* Couleur gris foncé */
  text-decoration: none !important; /* Pas de soulignement */
  transition: color 0.3s;
}

a.dashboard-link:hover {
  color: #e74c3c !important;  /* Changement de couleur au survol */
}

/* --- Formulaires --- */
form {
  background-color: #ffffff;
  padding: 20px;
  border: none;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="url"],
form select {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.3s;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="url"]:focus,
form select:focus {
  border-color: #a8edea;
  outline: none;
}

form button {
  background-color: #a8edea;
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

form button:hover {
  background-color: #fed6e3;
}

/* --- Tableaux --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background-color: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

table th,
table td {
  padding: 12px 15px;
  text-align: left;
  vertical-align: middle;
}

table th {
  background-color: #fed6e3;
  color: #fff;
}

table tbody tr:nth-child(even) {
  background-color: #fff7f9;
}

/* --- Messages d'erreur --- */
.error-messages {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* --- Footer --- */
footer {
  background-color: #ffffff;
  border-top: 1px solid #ddd;
  text-align: center;
  padding: 20px 0;
  margin-top: 20px;
  color: #444;
}

/* --- Bouton "Retour en haut" --- */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #a8edea;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background-color 0.3s;
  z-index: 1001;
}

#backToTop:hover {
  background-color: #fed6e3;
}

/* --- Modal de confirmation pour la suppression --- */
.modal {
  display: none;  /* Caché par défaut */
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px;
  border: none;
  width: 80%;
  max-width: 400px;
  border-radius: 8px;
  text-align: center;
}

.modal-content button {
  margin: 10px;
  padding: 10px 20px;
  border: none;
  background-color: #a8edea;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.modal-content button:hover {
  background-color: #fed6e3;
}

/* --- Bouton "Supprimer" dans le dashboard --- */
.delete-form button.delete-button {
  background: none;
  border: none;
  color: #e74c3c;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
}

.delete-form button.delete-button:hover {
  text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
  }
  .nav-menu {
    flex-direction: column;
    margin-top: 10px;
  }
  .nav-menu li {
    margin: 10px 0;
  }
}
