/* ==========================================
   COMPOSANTS SPÉCIFIQUES À LA PLATEFORME
   ========================================== */

/* === AI ASSISTANT WIDGET === */
.ai-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
}
/* Quand le bouton « Publier » (FAB) est présent, on remonte le widget IA au-dessus
   pour qu'ils ne se chevauchent pas (surtout sur mobile). */
body.has-pro-fab .ai-widget { bottom: 6rem; }
.ai-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(27,67,50,0.35);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ai-btn:hover { transform: scale(1.1); }
.ai-btn .ai-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-accent-strong);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid #fff;
}
.ai-panel {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 380px;
  height: 520px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 0.25s ease;
  transform-origin: bottom right;
  border: 1px solid var(--color-border);
}
.ai-panel.hidden { display: none; }
.ai-panel-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.ai-panel-header .ai-avatar { font-size: 1.5rem; width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-panel-header h4 { font-size: 0.95rem; margin: 0; }
.ai-panel-header p { font-size: 0.75rem; opacity: 0.8; margin: 0; }
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ai-message { display: flex; gap: 0.5rem; }
.ai-message.user { flex-direction: row-reverse; }
.ai-message-bubble {
  max-width: 82%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}
.ai-message.ai .ai-message-bubble { background: var(--color-surface-2); color: var(--color-text); border-bottom-left-radius: 4px; }
.ai-message.user .ai-message-bubble { background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-quick-replies { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.75rem 1rem; border-top: 1px solid var(--color-border); }
.ai-quick-reply { font-size: 0.78rem; padding: 0.35rem 0.75rem; background: var(--color-surface-2); border-radius: 100px; border: 1px solid var(--color-border); cursor: pointer; transition: all 0.2s; font-family: var(--font-body); color: var(--color-text); }
.ai-quick-reply:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.ai-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.ai-input-bar input { flex: 1; border: 1px solid var(--color-border); border-radius: 100px; padding: 0.5rem 1rem; font-size: 0.88rem; font-family: var(--font-body); }
.ai-input-bar input:focus { border-color: var(--color-primary); }
.ai-typing { display: flex; gap: 4px; align-items: center; padding: 0.25rem 0; }
.ai-typing span { width: 6px; height: 6px; background: var(--color-text-muted); border-radius: 50%; animation: typingDot 1.4s ease infinite; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

@media (max-width: 440px) {
  .ai-panel { width: calc(100vw - 2rem); right: 0; }
}

/* === GALLERY === */
.gallery { position: relative; overflow: hidden; border-radius: var(--radius-lg); }
.gallery-track { display: flex; transition: transform 0.3s ease; }
.gallery-slide { width: 100%; flex-shrink: 0; aspect-ratio: 16/9; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.gallery-btn:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.gallery-btn-prev { left: 0.75rem; }
.gallery-btn-next { right: 0.75rem; }
.gallery-dots { position: absolute; bottom: 0.75rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.35rem; }
.gallery-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s; }
.gallery-dot.active { background: #fff; width: 18px; border-radius: 3px; }
.gallery-counter { position: absolute; bottom: 0.75rem; right: 0.75rem; background: rgba(0,0,0,0.5); color: #fff; padding: 0.25rem 0.6rem; border-radius: 100px; font-size: 0.78rem; }

/* === MAP CONTAINER === */
.map-container { border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.map-container #map, .map-container .map { width: 100%; height: 100%; }
.map-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 400;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  font-family: var(--font-body);
  color: var(--color-text);
}
.map-toggle:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* === FILTER PANEL === */
.filter-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.filter-panel-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.filter-panel-body { padding: 1.25rem; }
.filter-section { margin-bottom: 1.5rem; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section-title { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 0.75rem; }

/* === PRICE SLIDER === */
.price-range { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.price-range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.75rem; }
.price-range-input { padding: 0.45rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 0.85rem; width: 100%; text-align: center; font-family: var(--font-mono); }

/* === SAVED SEARCH PILL === */
.saved-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.saved-search-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.saved-search-pill .pill-del { color: var(--color-danger); font-size: 0.7rem; margin-left: 0.25rem; }

/* === CONVERSATION LIST ITEM === */
.conv-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--color-border-light);
}
.conv-item:hover, .conv-item.active { background: var(--color-surface-2); }
.conv-item-avatar { flex-shrink: 0; position: relative; }
.conv-item-unread { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; background: var(--color-accent); border-radius: 50%; border: 2px solid #fff; }
.conv-item-content { flex: 1; min-width: 0; }
.conv-item-name { font-weight: 600; font-size: 0.9rem; }
.conv-item-preview { font-size: 0.8rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-time { font-size: 0.72rem; color: var(--color-text-light); flex-shrink: 0; }
.conv-item-count { background: var(--color-accent-strong); color: #fff; width: 20px; height: 20px; border-radius: 50%; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* === TRACKING TIMELINE === */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--color-border); }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.15rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-border);
  border: 3px solid var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #fff;
  z-index: 1;
}
.timeline-item.done .timeline-dot { background: var(--color-success); }
.timeline-item.active .timeline-dot { background: var(--color-accent); animation: pulse 2s infinite; }
.timeline-title { font-weight: 600; font-size: 0.9rem; }
.timeline-desc { font-size: 0.82rem; color: var(--color-text-muted); }
.timeline-time { font-size: 0.75rem; color: var(--color-text-light); margin-top: 0.15rem; }

/* === BOOKING CALENDAR === */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-day-name { text-align: center; font-size: 0.72rem; font-weight: 600; padding: 0.3rem; color: var(--color-text-muted); text-transform: uppercase; }
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.calendar-day:hover:not(.disabled):not(.other-month) { background: rgba(27,67,50,0.1); color: var(--color-primary); }
.calendar-day.today { font-weight: 700; color: var(--color-primary); }
.calendar-day.selected { background: var(--color-primary); color: #fff; }
.calendar-day.booked { background: rgba(230,57,70,0.1); color: var(--color-danger); cursor: not-allowed; }
.calendar-day.available { background: rgba(45,198,83,0.1); color: var(--color-success); }
.calendar-day.other-month { color: var(--color-text-light); cursor: default; }
.calendar-day.disabled { color: var(--color-text-light); cursor: not-allowed; opacity: 0.4; }

/* === VEHICLE CAPACITY BAR === */
.capacity-bar { margin: 0.5rem 0; }
.capacity-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.3rem; }
.capacity-track { height: 8px; background: var(--color-surface-2); border-radius: 4px; overflow: hidden; }
.capacity-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.capacity-fill.low { background: var(--color-success); }
.capacity-fill.medium { background: var(--color-warning); }
.capacity-fill.high { background: var(--color-danger); }

/* === ESCROW STEPS === */
.escrow-steps { display: flex; gap: 0; }
.escrow-step {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-bottom: 3px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  position: relative;
}
.escrow-step.active { border-bottom-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }
.escrow-step.done { border-bottom-color: var(--color-success); color: var(--color-success); }
.escrow-step-icon { font-size: 1.2rem; display: block; margin-bottom: 0.25rem; }

/* === FRAUD WARNING BANNER === */
.fraud-banner {
  border: 2px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(230,57,70,0.06);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.fraud-banner .fraud-icon { font-size: 1.5rem; flex-shrink: 0; }
.fraud-banner.medium { border-color: var(--color-warning); background: rgba(244,162,97,0.08); }
.fraud-banner.low { border-color: var(--color-success); background: rgba(45,198,83,0.06); }

/* === QUICK COMPARISON === */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 400;
}
.compare-bar.visible { transform: translateY(0); }
.compare-bar .compare-items { display: flex; gap: 0.5rem; flex: 1; }
.compare-item { background: rgba(255,255,255,0.2); border-radius: var(--radius-sm); padding: 0.35rem 0.75rem; font-size: 0.82rem; display: flex; align-items: center; gap: 0.5rem; }

/* === PAYMENT METHODS === */
.payment-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.payment-method.selected { border-color: var(--color-primary); background: rgba(27,67,50,0.04); }
.payment-method-logo { font-size: 1.75rem; width: 40px; text-align: center; }
.payment-method-info h4 { font-size: 0.9rem; margin: 0; }
.payment-method-info p { font-size: 0.78rem; color: var(--color-text-muted); margin: 0; }
.payment-method-radio { margin-left: auto; width: 20px; height: 20px; accent-color: var(--color-primary); }

/* Orange Money & MTN Colors */
.pm-orange { color: #FF6600; }
.pm-mtn { color: #FFCC00; }
.pm-stripe { color: #635BFF; }
.pm-cash { color: var(--color-success); }

/* === SUBSCRIPTION PLAN CARDS === */
.plan-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
}
.plan-card.popular {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(255,107,53,0.1);
}
.plan-card.selected { border-color: var(--color-primary); }
.plan-card .popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: #fff;
  padding: 0.2rem 0.75rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.plan-price { font-size: 2rem; font-family: var(--font-mono); font-weight: 700; color: var(--color-primary); }
.plan-price sup { font-size: 0.9rem; vertical-align: top; margin-top: 0.35rem; }
.plan-features { list-style: none; margin-top: 1rem; }
.plan-features li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; padding: 0.35rem 0; }
.plan-features li::before { content: '✓'; color: var(--color-success); font-weight: 700; }
.plan-features li.disabled { color: var(--color-text-muted); }
.plan-features li.disabled::before { content: '✕'; color: var(--color-text-light); }

/* === NEIGHBORHOOD CARD === */
.neighborhood-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
}
.neighborhood-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.neighborhood-card:hover img { transform: scale(1.08); }
.neighborhood-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  color: #fff;
}
.neighborhood-card-name { font-weight: 700; font-size: 1.1rem; }
.neighborhood-card-stats { font-size: 0.8rem; opacity: 0.9; }

/* === PRINT STYLES === */
@media print {
  .navbar, .ai-widget, .toast-container, .btn-float { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
