/* ============================================================
   COCOLOVE — Publier une annonce
   Fichier : Publication/publication.css
   Style aligné sur Inscription/inscription.css : sobre,
   fond transparent, séparateurs fins, police Inter.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-dark:        #0d0d14;
  --bg-card:        #161622;
  --primary-pink:   #ff3366;
  --primary-orange: #ff6666;
  --text-light:     #ffffff;
  --text-secondary: #b8b8c8;
  --text-muted:     #8e8e9f;
  --border-color:   #2a2a35;
  --success:        #10B981;
  --danger:         #ff5577;
  --radius:         10px;
  --radius-md:      14px;
  --radius-lg:      18px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
}

/* ─── Header ──────────────────────────────────────────────── */
.pub-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.pub-back-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.pub-back-btn:hover { background: rgba(255,255,255,.08); }
.pub-back-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

.pub-header h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0;
}

/* ─── Form layout ─────────────────────────────────────────── */
.pub-form {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 20px 110px;
}

.pub-section {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
}
.pub-section:last-child { border-bottom: none; }

.pub-section h2 {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 0 0 18px;
}

/* ─── Photos ──────────────────────────────────────────────── */
.pub-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pub-photo-slot {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.pub-photo-slot:hover { border-color: var(--primary-pink); }

.pub-photo-slot .pub-photo-icon {
  width: 26px;
  height: 26px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s;
}
.pub-photo-slot:hover .pub-photo-icon { stroke: var(--primary-pink); }

.pub-photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-photo-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Champs texte (style inscription) ───────────────────── */
.pub-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.pub-field:last-child { margin-bottom: 0; }
.pub-field:focus-within label { color: var(--text-light); }

.pub-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color .2s;
}

.pub-input,
.pub-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border-color);
  border-radius: 0;
  color: var(--text-light);
  padding: 10px 2px;
  font-size: 14.5px;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, border-bottom-width .2s;
}
.pub-input:focus,
.pub-textarea:focus {
  outline: none;
  border-bottom-color: var(--primary-pink);
  border-bottom-width: 2px;
}
.pub-input::placeholder,
.pub-textarea::placeholder { color: var(--text-muted); opacity: .7; }

.pub-textarea { resize: vertical; min-height: 100px; }

.pub-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.pub-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ─── Catégories (chips) ──────────────────────────────────── */
.pub-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all .15s;
}
.pub-chip:hover { border-color: var(--primary-pink); color: var(--text-light); }
.pub-chip.selected {
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-orange));
  border-color: transparent;
  color: #fff;
}

/* ─── Localisation : recherche autocomplétée ─────────────── */
.pub-search-wrap {
  position: relative;
}

.pub-search-icon {
  position: absolute;
  left: 2px;
  top: 12px;
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.8;
  pointer-events: none;
  transition: stroke .2s;
}
.pub-search-wrap:focus-within .pub-search-icon { stroke: var(--primary-pink); }

.pub-search-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border-color);
  color: var(--text-light);
  padding: 10px 2px 10px 26px;
  font-size: 14.5px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s, border-bottom-width .2s;
}
.pub-search-input:focus { border-bottom-color: var(--primary-pink); border-bottom-width: 2px; }
.pub-search-input::placeholder { color: var(--text-muted); opacity: .7; }

.pub-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 260px;
  overflow-y: auto;
  z-index: 15;
  display: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.pub-search-results.open { display: block; }

.pub-search-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.pub-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background .15s;
}
.pub-search-item:last-child { border-bottom: none; }
.pub-search-item:hover { background: rgba(255,255,255,.04); }

.pub-search-item-label {
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pub-search-item-label small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.pub-search-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.pub-search-item.checked .pub-search-check {
  background: linear-gradient(135deg, var(--primary-pink), var(--primary-orange));
  border-color: transparent;
}
.pub-search-check svg {
  width: 12px; height: 12px;
  stroke: #fff; fill: none;
  stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
  transition: opacity .15s;
}
.pub-search-item.checked .pub-search-check svg { opacity: 1; }

/* ─── Tags sélectionnés ───────────────────────────────────── */
.pub-selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.pub-selected-tags:empty { margin-top: 0; }

.pub-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 12.5px;
  color: var(--text-light);
}

.pub-tag-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.pub-tag-remove:hover { background: var(--danger); color: #fff; }

/* ─── Bouton flottant ─────────────────────────────────────── */
.pub-submit-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 14px 20px;
  z-index: 20;
}

.pub-submit-btn {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: block;
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-orange));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.pub-submit-btn:active { transform: scale(.98); }
.pub-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Toast ───────────────────────────────────────────────── */
.pub-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.pub-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pub-toast.error { border-color: var(--danger); color: var(--danger); }
.pub-toast.success { border-color: var(--success); color: var(--success); }

@media (max-width: 380px) {
  .pub-photos-grid { gap: 8px; }
  .pub-row-2 { grid-template-columns: 1fr; gap: 20px; }
}
