/* ── Variables ─────────────────────────────────────────────── */
:root {
  --pa-primary: #0d6efd;
  --pa-card-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ── Général — layout collant header/footer ─────────────────── */
html, body {
  height: 100%;
}
body {
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1 0 auto;
}
footer {
  flex-shrink: 0;
}

/* ── Navbar sticky en haut ──────────────────────────────────── */
nav.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* ── Fond décoratif (image de la Cerise) ───────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('../img/background.webp') center top / cover no-repeat;
  opacity: .13;
  z-index: -1;
  pointer-events: none;
}

/* ── Mention "Propulsé par la Cerise" ──────────────────────── */
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: #adb5bd;
  letter-spacing: .03em;
}
.powered-by .cherry { font-size: 1.1em; }

/* ── Bandeau cookies ───────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1055;
  background: #212529;
  color: #f8f9fa;
  padding: .9rem 1.25rem;
  box-shadow: 0 -2px 12px rgba(0,0,0,.25);
  display: none;   /* affiché par JS si non encore accepté */
}
#cookie-banner a { color: #6ea8fe; }
#cookie-banner.show { display: block; }

/* ── Bandeau inscription visiteurs ────────────────────────── */
.visitor-cta {
  background: linear-gradient(135deg, #e8f0fe 0%, #f0f7ff 100%);
  border: 1px solid #b6d0f7;
  border-radius: .5rem;
  padding: 1rem 1.25rem;
}

/* ── Cartes d'annonces ─────────────────────────────────────── */
.annonce-card {
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--pa-card-shadow);
  height: 100%;
}
.annonce-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.annonce-card .card-img-top {
  height: 180px;
  object-fit: cover;
}
.annonce-card .badge-category {
  font-size: .72em;
}
.annonce-card .card-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Badge adulte ──────────────────────────────────────────── */
.badge-adulte {
  background: #dc3545;
  color: #fff;
}

/* ── Carte Google Maps ─────────────────────────────────────── */
#map-index, #map-annonce, #map-picker {
  border-radius: .5rem;
  border: 1px solid #dee2e6;
}
#map-index { height: 400px; }
#map-annonce { height: 300px; }
#map-picker { height: 350px; }

/* ── Galerie médias ────────────────────────────────────────── */
.media-gallery img, .media-gallery video {
  width: 100%;
  border-radius: .375rem;
  cursor: pointer;
}
.media-thumb {
  position: relative;
  overflow: hidden;
  border-radius: .375rem;
  background: #000;
  aspect-ratio: 16/9;
}
.media-thumb img, .media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Preview vidéos ────────────────────────────────────────── */
.preview-container { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.preview-item {
  position: relative;
  width: 120px; height: 90px;
  border-radius: .375rem;
  overflow: hidden;
  background: #e9ecef;
}
.preview-item video { width: 100%; height: 100%; object-fit: cover; }

/* ── Gestionnaire d'images avec rognage ────────────────────── */
.img-manager-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
  min-height: 0;
}
.img-manager-thumb {
  position: relative;
  width: 120px;
  height: 90px;           /* ratio 4:3 = exact rendu final */
  border-radius: .375rem;
  overflow: hidden;
  background: #e9ecef;
  border: 2px solid #dee2e6;
  transition: border-color .15s;
}
.img-manager-thumb:hover { border-color: #0d6efd; }
.img-manager-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.img-manager-delete {
  position: absolute;
  top: 3px; right: 3px;
  width: 22px; height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(220, 53, 69, .88);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.img-manager-thumb:hover .img-manager-delete { opacity: 1; }
.img-manager-delete:disabled { opacity: .4; cursor: wait; }

/* ── Modal de rognage ──────────────────────────────────────── */
#cropModal .modal-body { background: #1a1a1a; }
#crop-image { display: block; max-width: 100%; }
/* Surcharge Cropper.js pour s'intégrer avec Bootstrap */
.cropper-view-box,
.cropper-face { border-radius: 0; }
.cropper-line { background-color: #0d6efd; }

/* ── Footer ────────────────────────────────────────────────── */
footer.bg-dark { color: #ced4da; }
footer.bg-dark h6 { color: #f8f9fa; }
footer.bg-dark .text-muted,
footer.bg-dark p,
footer.bg-dark small { color: #ced4da !important; }
footer.bg-dark a,
footer.bg-dark .footer-link { color: #adb5bd; text-decoration: none; transition: color .15s; }
footer.bg-dark a:hover,
footer.bg-dark .footer-link:hover { color: #fff !important; }
footer.bg-dark .text-secondary { color: #adb5bd !important; }
footer.bg-dark hr { border-color: #495057; }
.powered-by { color: #adb5bd; }

/* ── Admin sidebar ─────────────────────────────────────────── */
.admin-sidebar .nav-link {
  color: #495057;
  border-radius: .375rem;
  margin-bottom: .2rem;
}
.admin-sidebar .nav-link.active, .admin-sidebar .nav-link:hover {
  background: var(--pa-primary);
  color: #fff;
}

/* ── TinyMCE fix ───────────────────────────────────────────── */
.tox-tinymce { border-radius: .375rem !important; }

/* ── Filtres annonces ──────────────────────────────────────── */
.filter-bar { background: #fff; border-radius: .5rem; padding: 1rem; box-shadow: var(--pa-card-shadow); }

/* ── Vue switcher ──────────────────────────────────────────── */
.view-switch .btn.active { background: var(--pa-primary); color: #fff; }

/* ── Annonce détail ────────────────────────────────────────── */
.annonce-description img { max-width: 100%; height: auto; border-radius: .375rem; }

/* Bouton IA */
.btn-outline-purple {
  color: #7c3aed;
  border-color: #7c3aed;
}
.btn-outline-purple:hover,
.btn-outline-purple:focus {
  background-color: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
