/* ======================================
   Corps de la page et animations
   ====================================== */
body {
  margin: 0;
  padding: 0px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(120deg, #e0f7fa, #ffffff);
  color: #333333;
  overflow-x: hidden;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Titre principal animé */
h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  margin-top: 70px;
  color: #00796b;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  text-align: center;
}

/* ======================================
   Formulaire
   ====================================== */
form {
  width: 100%;
  max-width: 500px;
  background-color: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

form label {
  font-size: 1rem;
  color: #555555;
}

form input,
form select,
form textarea {
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #cccccc;
  border-radius: 6px;
  background-color: #f9f9f9;
  color: #333333;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: #009688;
  box-shadow: 0 0 8px rgba(0, 150, 136, 0.3);
  outline: none;
}

/* ======================================
   Bouton Ajouter
   ====================================== */
.btn_add {
  align-self: center;
  padding: 12px 24px;
  margin: 15px 0 10px;
  background-color: #ff8a65;
  color: #ffffff;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn_add:hover,
.btn_add:focus {
  background-color: #ff7043;
  transform: translateY(-2px);
  outline: none;
}

/* Au bas du fichier (ou dans la section Formulaire) */
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;              /* petit espace entre les boutons */
}

/* Pour que les deux boutons aient la même largeur (optionnel) */
.form-actions .btn_add,
.form-actions .btn-action {
  flex: 1;                /* prend toute la place disponible */
}

/* Si tu veux un petit padding interne différent : */
.form-actions .btn_add  { margin-right: 10px; }
.form-actions .btn-action { margin-left: 10px; }


/* ======================================
   Tableau principal
   ====================================== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.4s;
  opacity: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

thead {
  background-color: #f1f1f1;
}

th,
td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid #eeeeee;
  font-size: 1rem;
  color: #333333;
}

th {
  font-weight: 600;
}

tbody tr {
  transition: background-color 0.3s ease;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

tbody tr:hover {
  background-color: #f9f9f9;
}

tbody tr:nth-child(odd) {
  animation-delay: 0.5s;
}

tbody tr:nth-child(even) {
  animation-delay: 0.6s;
}

/* ======================================
   Barre de recherche
   ====================================== */
.search-container {
  width: 100%;
  max-width: 1100px;
  margin: 20px auto 30px;
  display: flex;
  justify-content: center;
  animation: none;
  opacity: 1;
}

#searchInput {
  width: 250px;
  padding: 10px 16px;
  font-size: 1rem;
  border: 1px solid #cccccc;
  border-radius: 20px;
  background-color: #f9f9f9;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#searchInput:focus {
  border-color: #009688;
  box-shadow: 0 0 8px rgba(0, 150, 136, 0.3);
  outline: none;
}

/* ======================================
   Flex container pour les deux cartes
   ====================================== */
.cards-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
}

/* ======================================
   Styles communs aux cartes
   ====================================== */
.detail-card,
.general-card,
.stats-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: left;
  flex: 1;
}

/* Centrage de l’image dans chaque carte */
.general-card .poke-image,
.stats-card .poke-image {
  text-align: center;
  margin-bottom: 20px;
}

.poke-image img {
  max-width: 200px;
  width: 100%;
  height: auto;
}

/* ======================================
   Infos générales
   ====================================== */
.poke-info {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.poke-info li {
  margin-bottom: 8px;
  font-size: 1rem;
}

.poke-info strong {
  display: inline-block;
  width: 100px;
}

/* ======================================
   Statistiques
   ====================================== */
.stats-card h2 {
  font-size: 1.5rem;
  color: #00796b;
  text-align: center;
  margin-top: 0;
  margin-bottom: 12px;
}

.stats-card .poke-stats {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.stats-card .poke-stats li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eeeeee;
}

.stats-card .poke-stats li:last-child {
  border-bottom: none;
}

.stats-card .poke-stats .label {
  font-weight: bold;
  color: #e91e63;
}

.stats-card .poke-stats .value {
  background: #ffeb3b;
  padding: 2px 8px;
  border-radius: 4px;
  color: #000;
}

/* Bouton de retour en bas de chaque carte */
.detail-card .btn-action {
  display: block;
  margin: 20px auto 0;
}

.detail-card .btn_add .btn-save.btn_add {
  display: block;       /* Passe en block pour que margin auto fonctionne */
  margin: 20px auto 20px;  /* 20px de marge au‑dessus, auto à gauche et droite, 0 en dessous */
}

/* ======================================
   Badges de type
   ====================================== */
.type-badge {
  font-weight: bold;
}

.type-badge[data-type="plante"]    { color: #7AC74C; }
.type-badge[data-type="poison"]    { color: #A33EA1; }
.type-badge[data-type="feu"]       { color: #FF4500; }
.type-badge[data-type="vol"]       { color: #00CED1; }
.type-badge[data-type="eau"]       { color: #1E90FF; }
.type-badge[data-type="insecte"]   { color: #A6B91A; }
.type-badge[data-type="normal"]    { color: #7f8c8d; }
.type-badge[data-type="electrique"]{ color: #F7D02C; }
.type-badge[data-type="sol"]       { color: #E2BF65; }
.type-badge[data-type="combat"]    { color: #8B0000; }
.type-badge[data-type="psy"]       { color: #9932CC; }
.type-badge[data-type="roche"]     { color: #A0522D; }
.type-badge[data-type="glace"]     { color: #ADD8E6; }
.type-badge[data-type="spectre"]   { color: #9932CC; }
.type-badge[data-type="dragon"]    { color: #C0C0C0; }

/* ======================================
   Style unifié pour td button et <a class="btn-action">
   (ne pas toucher, c’est ta config originale)
   ====================================== */
td button,
td a.btn-action {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 5px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
  border: 1px solid #009688;
  background: transparent;
  color: #009688;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-sizing: border-box;
}

td button:hover,
td button:focus,
td a.btn-action:hover,
td a.btn-action:focus {
  background-color: #009688;
  color: #ffffff;
  outline: none;
}

/* ======================================
   Responsive
   ====================================== */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }
  h1 {
    font-size: 2rem;
  }
  form {
    padding: 20px;
    gap: 15px;
  }
  form input,
  .btn_add {
    font-size: 0.95rem;
  }
  th,
  td {
    padding: 12px;
    font-size: 0.85rem;
  }
  td button {
    padding: 6px 12px;
  }
  .cards-container {
    flex-direction: column;
    margin: 20px auto;
  }
}S