/* === Variables de thème === */
:root {
  --color-primary: #F26A5A;
  --color-background: #FFF9F6;
  --color-accent: #004B8D;
  --color-footer: #F47C61;
  --font-main: 'Segoe UI', system-ui, sans-serif;
  --font-title: 'Poppins', sans-serif;
}

/* === Réinitialisation === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Base === */
body {
  font-family: var(--font-main);
  background-color: var(--color-background);
  background-image: url("../img/bg-pattern.png");
  background-repeat: repeat;
  background-size: auto;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem 2rem;
  background: transparent;
}

.header-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.logo {
  width: 85px;
  height: auto;
  margin-bottom: 0.8rem;
}

.app-name {
  font-size: 1.1rem;
  color: var(--color-accent);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.slogan {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--color-accent);
  font-weight: 700;
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}

#intro-text {
  font-size: 1.05rem;
  color: #333;
  margin-top: 1.2rem;
  font-style: italic;
}

/* === Main === */
main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  gap: 2.5rem;
}

/* === Section actions === */
.action-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
}

/* === Champ de recherche === */
#search-bar {
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  width: 100%;
  max-width: 320px;
  font-size: 1rem;
  outline: none;
  transition: box-shadow 0.3s;
}

#search-bar:focus {
  box-shadow: 0 0 0 3px rgba(242, 106, 90, 0.2);
}

/* === Boutons === */
button {
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s, transform 0.2s;
  margin-bottom: 1rem;
}

button:hover {
  background-color: #e45849;
  transform: scale(1.02);
}

/* === Formulaire de dépôt d’annonce === */
form {
  background: white;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
}

form h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

form label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 1rem;
  margin-top: 0.5rem;
  font-family: var(--font-main);
}

form textarea {
  resize: vertical;
  min-height: 80px;
}

form input[type="file"] {
  padding: 0.5rem;
  background: #f9f9f9;
  border: 1px dashed #bbb;
  cursor: pointer;
}

/* === Liste des annonces === */
#announcement-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

/* === Carte d'annonce === */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  padding: 1.5rem;
  max-width: 300px;
  width: 100%;
  min-height: 520px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

/* === Image carrée compatible mobile-first === */
.img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1rem;
  margin: 1rem 0;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-wrapper img.annonce {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 1rem;
  transition: transform 0.3s ease;
}

.img-wrapper:hover img.annonce {
  transform: scale(1.05);
}

/* === Titre et texte de l’annonce === */
.card h3 {
}

  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

.card p {
  margin: 0.2rem 0;
  font-size: 1rem;
  color: #333;
}


/* === Image WhatsApp === */
.whatsapp-icon {
  width: 42px;
  height: 42px;
  margin-top: 10px;
}

.whatsapp-btn {
  display: inline-block;
  margin-top: 10px;
  transition: transform 0.2s ease;
}

.whatsapp-btn:hover {
  transform: scale(1.1);
}

/* === Alignement vertical === */
#search-section,
#announcement-list,
#no-result {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Footer === */
footer {
  background-color: var(--color-footer);
  text-align: center;
  padding: 1rem;
  font-size: 0.95rem;
  color: white;
  margin-top: auto;
}

footer a {
  color: white;
  text-decoration: underline;
}

/* === Fenêtre Pop-up pour le lien de suppression === */
.token-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid var(--color-primary);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 1.5rem 1rem;
  z-index: 9999;
  max-width: 90%;
  width: 380px;
  text-align: center;
  animation: fadeInPop 0.4s ease-out;
}

.token-alert p {
  font-size: 0.95rem;
  color: #222;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.token-alert a {
  color: var(--color-accent);
  word-break: break-word;
  font-weight: 500;
}

.token-alert button {
  margin-top: 1rem;
  background-color: var(--color-accent);
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  width: auto;
  max-width: 90%;
}

@keyframes fadeInPop {
  from { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 480px) {
  .token-alert {
    padding: 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  /* Liste d’annonces en colonne bien espacée */
  #announcement-list {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  /* Cartes élargies à ~85 % de l’écran */
  .card {
    width: 85vw;
    max-width: 85vw;
    margin-bottom: 2rem;
  }

  /* Wrapper d’image forcé en carré même si aspect-ratio non pris en charge */
  .img-wrapper {
    width: 100%;
    height: 0;
    padding-top: 100%; /* carré parfait */
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background-color: #f5f5f5;
    margin: 1rem 0;
  }

  .img-wrapper img.annonce {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 1rem;
    transition: transform 0.3s ease;
  }

  .img-wrapper:hover img.annonce {
    transform: scale(1.05);
  }
}
.badge-trusted { height: 36px; margin-bottom: 12px; object-fit: contain; }
