/* ==================================================
   🏷️ GESTION DES CATÉGORIES — version corrigée
================================================== */

/* --- Zone principale --- */
#zone-categories {
  position: relative;
}
#categories-container {
  min-height: 520px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  justify-content: flex-start;
}

/* --- Menu flottant --- */
#category-menu {
  position: absolute;
  top: 50px; /* un peu sous le titre */
  left: 15px;
  right: 15px;
  z-index: 1000;
  background: #111;
  border: 2px solid #ff69b4;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 0 20px rgba(255,105,180,0.4);
  animation: fadeIn 0.3s ease;
}
#category-menu.hidden {
  display: none;
}

.category-search-bar {
  display: flex;
  gap: 6px;
}
#category-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ff69b4;
  background: #222;
  color: #fff;
  border-radius: 8px;
}
#add-category-btn {
  background: #ff69b4;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  color: #000;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
}
#add-category-btn:hover {
  background: #ff85c1;
}

/* --- Liste des catégories --- */
#category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}
.category-item:hover {
  background: #222;
}
.category-item.selected {
  border-color: #ff69b4;
  background: #222;
  box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}
.category-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.category-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cat-icon {
  cursor: pointer;
  font-size: 18px;
  opacity: 0.7;
  transition: transform 0.2s, opacity 0.2s;
}
.cat-icon.active {
  opacity: 1;
  color: #ff69b4;
}
.cat-icon:hover {
  transform: scale(1.2);
}

/* --- Animation --- */
@keyframes fadeIn {
  from {opacity:0; transform:scale(0.95);}
  to {opacity:1; transform:scale(1);}
}
#add-category-modal .modal-content {
  background: #111;
  color: white;
  border: 2px solid #ff69b4;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255,105,180,0.5);
  text-align: center;
}

#add-category-modal input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ff69b4;
  background: #222;
  color: #fff;
  margin-top: 10px;
}

#add-category-modal input:focus {
  outline: none;
  box-shadow: 0 0 10px #ff69b4;
}

#add-category-modal .modal-buttons button {
  background: #ff69b4;
  color: #111;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s;
}

#add-category-modal .modal-buttons button:hover {
  background: #ff85c1;
}
#category-modal .modal-content {
  background: #111;
  color: white;
  border: 2px solid #ff69b4;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255,105,180,0.5);
  text-align: center;
  animation: popIn .25s ease-out;
}

#category-modal input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ff69b4;
  background: #222;
  color: #fff;
  margin-top: 10px;
}

#category-modal input:focus {
  outline: none;
  box-shadow: 0 0 10px #ff69b4;
}

#category-modal .modal-buttons button {
  background: #ff69b4;
  color: #111;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s;
}

#category-modal .modal-buttons button:hover {
  background: #ff85c1;
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
