/* BindiNetwork — site vitrine (complément Tailwind) */

/* Nav / footer injectés par fetch : réserve la hauteur pour limiter le saut de mise en page */
#site-nav:empty {
  min-height: 5.5rem;
  background: linear-gradient(180deg, rgba(0, 27, 61, 0.55) 0%, rgba(2, 6, 23, 0.35) 100%);
}
@media (min-width: 768px) {
  #site-nav:empty {
    min-height: 4.5rem;
  }
}

:root {
  --bn-navy: #001b3d;
  --bn-blue: #1800ad;
  --bn-green: #003d20;
  --bn-amber: #f59e0b;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.45) rgba(15, 23, 42, 0.75);
}

/* Scrollbar moderne (Firefox + WebKit) */
body.bn-offer-detail::-webkit-scrollbar,
body.bn-profile-detail::-webkit-scrollbar,
body.bn-legal-page::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
body.bn-offer-detail::-webkit-scrollbar-track,
body.bn-profile-detail::-webkit-scrollbar-track,
body.bn-legal-page::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
  background: rgba(2, 6, 23, 0.85);
  border-radius: 999px;
}
body.bn-offer-detail::-webkit-scrollbar-thumb,
body.bn-profile-detail::-webkit-scrollbar-thumb,
body.bn-legal-page::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.55), rgba(99, 102, 241, 0.45));
  border-radius: 999px;
  border: 2px solid rgba(2, 6, 23, 0.85);
}
body.bn-offer-detail::-webkit-scrollbar-thumb:hover,
body.bn-profile-detail::-webkit-scrollbar-thumb:hover,
body.bn-legal-page::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.75), rgba(129, 140, 248, 0.55));
}

/* Header fixe : réserve anti-chevauchement avant hydratation JS */
.bn-nav-spacer {
  width: 100%;
  min-height: 6.5rem;
}
@media (min-width: 768px) {
  .bn-nav-spacer {
    min-height: 4rem;
  }
}

/* Barre de progression de lecture (scroll) — style premium */
.bn-scroll-progress {
  --bn-scroll-p: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 3px;
  overflow: visible;
  pointer-events: none;
}
.bn-scroll-progress__track {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04)
  );
}
.bn-scroll-progress__fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(
    90deg,
    #fbbf24 0%,
    #f59e0b 22%,
    #ea580c 55%,
    #6366f1 100%
  );
  box-shadow:
    0 0 14px rgba(245, 158, 11, 0.55),
    0 0 28px rgba(99, 102, 241, 0.25);
}
/* Reflet sur le bord actif de la barre (suit --bn-scroll-p) */
.bn-scroll-progress__edge {
  position: absolute;
  top: 50%;
  left: calc(var(--bn-scroll-p, 0) * 100% - 2px);
  width: 4px;
  height: 5px;
  margin-top: -2.5px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 50%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.25) 55%,
    transparent 72%
  );
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  .bn-scroll-progress__fill {
    box-shadow: none;
  }
  .bn-scroll-progress__edge {
    opacity: 0.35;
  }
}

/* Page détail annonce (redirection/offer.html) */
.bn-offer-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: bn-offer-shimmer-move 1.35s ease-in-out infinite;
}
@keyframes bn-offer-shimmer-move {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.bn-offer-gallery-item {
  aspect-ratio: 4 / 3;
  min-height: 6.5rem;
}
@media (prefers-reduced-motion: reduce) {
  .bn-offer-shimmer {
    animation: none;
    background: rgba(255, 255, 255, 0.06);
  }
}

/* Barre de recherche — fond sombre (évite le rendu blanc WebKit / focus) */
.bn-site-header {
  color-scheme: dark;
}
.bn-nav-search-input {
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
  background-color: rgba(6, 14, 28, 0.78) !important;
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.045) 0%,
    rgba(255, 255, 255, 0.015) 100%
  ) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 28px -12px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.96);
}
.bn-nav-search-input::placeholder {
  color: transparent;
}
.bn-nav-search-input:focus {
  background-color: rgba(8, 18, 38, 0.88) !important;
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(245, 158, 11, 0.22),
    0 12px 36px -14px rgba(245, 158, 11, 0.18);
  outline: none;
}
.bn-nav-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
}
.bn-nav-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 0;
  width: 0;
}
/* Autofill Safari / Chrome : garder le thème sombre */
.bn-nav-search-input:-webkit-autofill,
.bn-nav-search-input:-webkit-autofill:hover,
.bn-nav-search-input:-webkit-autofill:focus {
  -webkit-text-fill-color: rgba(255, 255, 255, 0.96);
  caret-color: #fff;
  transition: background-color 99999s ease-out;
  box-shadow: 0 0 0 1000px rgba(6, 14, 28, 0.92) inset !important;
}

/* Barre de recherche — machine à écrire (placeholder animé) */
.bn-nav-search-typewriter {
  position: absolute;
  left: 2.75rem;
  right: 1rem;
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 1.25rem;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.22s ease;
}
.bn-nav-search-typewriter--drawer {
  left: 2.5rem;
  right: 0.75rem;
}
.bn-nav-search-wrap.is-focused .bn-nav-search-typewriter,
.bn-nav-search-wrap.has-value .bn-nav-search-typewriter {
  opacity: 0;
}
.bn-nav-tw-caret {
  display: inline-block;
  flex-shrink: 0;
  width: 2px;
  height: 0.95em;
  margin-left: 3px;
  border-radius: 1px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  vertical-align: -0.1em;
  animation: bn-caret-blink 0.95s step-end infinite;
}
.bn-nav-tw-caret--static {
  animation: none;
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .bn-nav-tw-caret {
    animation: none;
    opacity: 0.45;
  }
}

/* Footer — rendu premium */
.bn-footer {
  position: relative;
}
.bn-footer-grid {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.04'%3E%3Cpath d='M0 .5h48M0 24.5h48M24 0v48'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 48px 48px;
}
.bn-footer-link {
  border-radius: 0.5rem;
  padding: 0.2rem 0.35rem;
  margin: -0.2rem -0.35rem;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.bn-footer-link:hover {
  background: rgba(255, 255, 255, 0.06);
}
.bn-footer-trust {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 20px 50px -28px rgba(0, 0, 0, 0.5);
}

/* Grain subtil sur le hero */
.bn-bg-grain {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* Lottie containers */
[data-lottie] {
  width: 100%;
  max-width: 420px;
  min-height: 220px;
}

/* Caret typewriter */
.typewriter-caret::after {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1.1em;
  margin-left: 4px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  vertical-align: -0.12em;
  animation: bn-caret-blink 0.95s step-end infinite;
}

@keyframes bn-caret-blink {
  50% {
    opacity: 0;
  }
}

/* Ticker vertical (comme le chat app — BindiVerticalTextTicker) */
.bn-vertical-ticker-track {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  will-change: transform;
}
.bn-vertical-ticker-line {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

/* Ticker seul (plusieurs sections) — pas d’UI type chat */
.bn-vertical-ticker--center .bn-vertical-ticker-track {
  align-items: center;
}
.bn-vertical-ticker--center .bn-vertical-ticker-line {
  text-align: center;
}
.bn-vertical-ticker--accent .bn-vertical-ticker-line {
  font-size: 14px;
  font-weight: 500;
  color: rgba(253, 224, 71, 0.85);
}
.bn-vertical-ticker--section .bn-vertical-ticker-line {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.52);
}
.bn-vertical-ticker--cta .bn-vertical-ticker-line {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.68);
}

/* Cartes feed Firestore (entrée) */
@keyframes bn-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bandeau mots-clés : défilement horizontal (≠ révélation verticale au scroll, gérée en JS). */
@keyframes bn-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
.bn-marquee-track {
  display: inline-flex;
  align-items: center;
  animation: bn-marquee 38s linear infinite;
}
.bn-marquee-track:hover {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .bn-marquee-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
  }
}

/* Pilules catégories (marquee) + Lucide */
.bn-marquee-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  padding: 0.45rem 0.95rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.bn-marquee-pill:hover {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(255, 255, 255, 0.08);
}
.bn-marquee-ic,
.bn-marquee-pill [data-lucide] svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Cohérence stroke Lucide (nav / landing) */
[data-lucide] svg {
  stroke-width: 1.65;
}
.bn-lucide-nav svg {
  width: 100%;
  height: 100%;
}
.bn-lucide-footer svg {
  stroke-width: 1.5;
}

/* Material-like elevation */
.bn-elev-1 {
  box-shadow:
    0 1px 2px rgba(0, 27, 61, 0.06),
    0 4px 24px rgba(0, 27, 61, 0.08);
}
.bn-elev-2 {
  box-shadow:
    0 4px 24px rgba(0, 27, 61, 0.1),
    0 12px 48px rgba(24, 0, 173, 0.12);
}

/* Tiroir mobile : entrées en cascade à l’ouverture */
#nav-drawer:not(.-translate-x-full) .bn-drawer-item {
  animation: bn-drawer-item-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(40ms + var(--i, 0) * 55ms);
}

@keyframes bn-drawer-item-in {
  from {
    opacity: 0;
    transform: translateX(-0.75rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Safe area iOS pour le bloc bas du tiroir */
#nav-drawer .bn-drawer-footer {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
