/* StyleCarteAnnonce-ANN.css
   Module d'annonces isolé avec préfixe ANN-
   Charger après les autres feuilles de style du site
*/

/* Variables couleurs par défaut */
:root {
  --ann-radius: 6px;
  --ann-gap: 1rem;
  --ann-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --ann-muted: #666;
  --ann-bg: #ffffff;
  --ann-border: #e6e6e6;
  --ann-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Conteneur liste */
.ANN-liste-annonces {
  display: flex;
  flex-direction: column;
  gap: var(--ann-gap);
  margin: 0;
  padding: 0;
}

/* Légende catégories */
.ANN-legende-categories {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.ANN-legende-categories li {
  padding: .25rem .6rem;
  border-radius: 4px;
  font-size: .85rem;
  color: #fff;
  font-weight: 600;
}

/* Article annonce */
.ANN-annonce {
  /* couleur de bordure et accent dynamique */
  border-left: 10px solid var(--ann-module-couleur, #ccc);
  background: color-mix(in srgb, var(--ann-module-couleur, #ccc) 6%, #fff);
  display: flex;
  gap: 1rem;
  align-items: stretch;
  background: color-mix(in srgb, var(--ann-module-couleur, #000) 6%, var(--ann-bg));
  border-left: 10px solid var(--ann-module-couleur, #ccc);
  border-radius: var(--ann-radius);
  overflow: hidden;
  box-shadow: var(--ann-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  padding: 0;
      margin: 10px;
}

/* Hover */
.ANN-annonce:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Image */
.ANN-image {
  min-width: 240px;
  max-width: 320px;
  height: auto;
  overflow: hidden;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ANN-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Contenu principal */
.ANN-contenu {
  padding: 1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 0;
  font-family: var(--ann-font);
}

/* Header */
.ANN-contenu > header {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: space-between;
}
.ANN-contenu header h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  font-weight: 700;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Etiquettes */
.ANN-etiquette {
  display: inline-block;
  padding: .2rem .5rem;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 3px;
  margin-right: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
}
.ANN-categorie { background: var(--ann-module-couleur, #333); }
.ANN-sous-categorie { background: #ddd; color: #222; font-weight: 600; padding: .18rem .45rem; }

/* Statut (placé à droite dans header) */
.ANN-statut {
  font-size: .72rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.12);
}
.statut-actif .ANN-statut { background: #2EC4B6; color: #fff; }
.statut-expire .ANN-statut { background: #E63946; color: #fff; }
.statut-brouillon .ANN-statut { background: #6C757D; color: #fff; }

/* Prix */
.ANN-prix {
  margin-top: .35rem;
}
.ANN-valeur {
  display: inline-block;
  padding: .35rem .6rem;
  font-size: .98rem;
  font-weight: 800;
  border-radius: 6px;
  background: #fff3b0;
  border: 1px solid #e6d58a;
  color: #333;
}
.ANN-gratuit { background: #2EC4B6; color: #fff; border-color: #2EC4B6; }
.ANN-debat { background: #FF9F1C; color: #fff; border-color: #FF9F1C; }

/* Texte descriptif */
.ANN-texte {
  margin: .5rem 0 0;
  color: var(--ann-muted);
  font-size: .95rem;
  line-height: 1.45;
  overflow: hidden;
  
}

/* Footer module */
.ANN-annonce .ANN-footer {
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid var(--ann-border);
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: space-between;
  width: 100%;
  color: var(--ann-muted);
  font-size: .88rem;
}

/* Meta group left */
.ANN-meta-group {
  display: flex;
  gap: .6rem;
  align-items: center;
}
.ANN-meta { color: var(--ann-muted); font-size: .85rem; }

/* Actions group right */
.ANN-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

/* Boutons */
.ANN-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem;
  border-radius: 6px;
  border: 1px solid #dcdcdc;
  background: #fff;
  color: #222;
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
}
.ANN-btn:hover { background: #fafafa; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }

/* Boutons accent */
.ANN-btn.ANN-voir { background: transparent; border-color: #cfcfcf; }
.ANN-btn.ANN-modifier { background: #fffbe6; border-color: #f0e1a8; }
.ANN-btn.ANN-supprimer { background: #ffecec; border-color: #f2b6b6; color: #a33; }

/* CTA (lien d'action principal) */
.ANN-cta {
  display: inline-block;
  padding: .5rem .9rem;
  background: var(--ann-module-couleur, #333);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  margin-left: .5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .ANN-annonce { flex-direction: column; }
  .ANN-image { width: 100%; min-width: 0; max-width: 100%; height: 220px; }
  .ANN-contenu header h2 { white-space: normal; -webkit-line-clamp: 2; display: block; }
  .ANN-annonce .ANN-footer { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* Accessibilité focus */
.ANN-btn:focus, .ANN-cta:focus, .ANN-voir:focus {
  outline: 3px solid color-mix(in srgb, var(--ann-module-couleur, #333) 30%, white);
  outline-offset: 2px;
}

/* Couleurs dynamiques par catégorie (ne pas préfixer cat- classes) */
.cat-OBJ { --ann-module-couleur: #3A86FF; }
.cat-SRV { --ann-module-couleur: #FF9F1C; }
.cat-EVT { --ann-module-couleur: #8338EC; }
.cat-COM { --ann-module-couleur: #2EC4B6; }
.cat-LOG { --ann-module-couleur: #1D3557; }
.cat-TRV { --ann-module-couleur: #E63946; }
.cat-ANI { --ann-module-couleur: #8D99AE; }
.cat-DIV { --ann-module-couleur: #6C757D; }
.ANN-legende-categories .cat-OBJ { background: var(--ann-module-couleur); }
.ANN-legende-categories .cat-SRV { background: var(--ann-module-couleur); }
/* ... mais comme .cat-OBJ définit déjà --ann-module-couleur, tu peux faire : */
.ANN-legende-categories li { padding: .25rem .6rem; border-radius: 4px; color: #fff; font-weight:700; }
.ANN-legende-categories li::before {
  content: "";
  display:inline-block;
  width:10px;height:10px;border-radius:3px;margin-right:.5rem;
  background: currentColor; opacity: .95;
}
/* et forcer la couleur via la classe cat-XXX (déjà définie plus haut) */
.ANN-legende-categories .cat-OBJ { color: var(--ann-module-couleur); }
.ANN-info {
    background: #f5f7fa;          /* léger fond administratif */
    border-left: 4px solid #3b82f6; /* marqueur vertical clair */
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 0.95rem;
    color: #1f2937;               /* gris anthracite lisible */
    line-height: 1.4;
    border-radius: 4px;
}


/* --- LÉGENDE --- */
.legende-categories {
  list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    text-align: center;
    align-content: center;
    justify-content: center;
}

.legende-categories li {
  padding: .3rem .6rem;
  border-radius: 4px;
  font-size: .85rem;
  color: #fff;
}

/* Couleurs */
/* Légende des catégories : réutilise les couleurs des catégories */
.legende-categories .cat-OBJ { background-color: #3A86FF; }
.legende-categories .cat-SRV { background-color: #FF9F1C; }
.legende-categories .cat-EVT { background-color: #8338EC; }
.legende-categories .cat-COM { background-color: #2EC4B6; }
.legende-categories .cat-LOG { background-color: #1D3557; }
.legende-categories .cat-TRV { background-color: #E63946; }
.legende-categories .cat-ANI { background-color: #8D99AE; }
.legende-categories .cat-DIV { background-color: #6C757D; }




/* ============================================================
   FILTRE DES ANNONCES — Style ANN‑ (premium, minimal, élégant)
   ============================================================ */

.filtre-annonces {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    margin: 25px 0;
    background: #fafafa;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
}

/* --- SELECTS --- */
.filtre-annonces select {
    appearance: none;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    min-width: 190px;
    transition: 0.25s ease;

    /* Flèche personnalisée */
    background-image:
        linear-gradient(45deg, transparent 50%, #666 50%),
        linear-gradient(135deg, #666 50%, transparent 50%);
    background-position:
        calc(100% - 14px) calc(50% - 4px),
        calc(100% - 9px) calc(50% - 4px);
    background-size: 6px 6px;
    background-repeat: no-repeat;
}

.filtre-annonces select:hover {
    border-color: #999;
}

.filtre-annonces select:focus {
    outline: none;
    border-color: var(--ann-module-couleur, #444);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ann-module-couleur, #444) 30%, transparent);
}

/* --- BOUTON FILTRER --- */
.filtre-annonces button {
    padding: 10px 20px;
    background: var(--ann-module-couleur, #444);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: 0.25s ease;
}

.filtre-annonces button:hover {
    background: color-mix(in srgb, var(--ann-module-couleur, #444) 80%, black);
    transform: translateY(-1px);
}
.ANN-like {
    background: #eee;
    border: 1px solid #ccc;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.2s;
}

.ANN-like.liked {
    background: #ffd4d4;
    border-color: #ff7a7a;
    color: #c40000;
    font-weight: bold;
}
.ANN-like.liked {
    animation: pulse 0.25s ease-out;
}

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.ANN-like span {
    transition: opacity 0.2s;
}

.ANN-like.updating span {
    opacity: 0.3;
}
