/* NekoTrip — Cookie Consent Banner (CNIL-compliant) */

#nt-cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
#nt-cookie-banner.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Backdrop (modal uniquement) ─────────────────────────────────────────── */
.ntcb-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  z-index: -1;
}
#nt-cookie-banner:has(#ntcb-modal:not([hidden])) .ntcb-backdrop {
  display: block;
}

/* ── Boîte principale ────────────────────────────────────────────────────── */
.ntcb-box {
  width: 100%;
  max-width: 900px;
  background: #1a1530;
  border: 1px solid rgba(139, 92, 246, .22);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 92, 246, .08);
  overflow: hidden;
  pointer-events: all;
}

/* ── Bannière principale ─────────────────────────────────────────────────── */
.ntcb-main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  flex-wrap: wrap;
}

.ntcb-icon {
  flex-shrink: 0;
  color: #8b5cf6;
  display: flex;
}

.ntcb-text { flex: 1; min-width: 240px; }

.ntcb-title {
  font-size: .95rem;
  font-weight: 700;
  color: #f4f0ff;
  margin: 0 0 4px;
}

.ntcb-desc {
  font-size: .82rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.55;
}

.ntcb-link {
  color: #a78bfa;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ntcb-link:hover { color: #c4b5fd; }

.ntcb-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.ntcb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.ntcb-btn--primary {
  background: #7c3aed;
  color: #fff;
}
.ntcb-btn--primary:hover { background: #6d28d9; }

.ntcb-btn--ghost {
  background: transparent;
  color: #9ca3af;
  border: 1px solid rgba(255,255,255,.12);
}
.ntcb-btn--ghost:hover { color: #f4f0ff; border-color: rgba(255,255,255,.25); }

.ntcb-btn--outline {
  background: transparent;
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,.35);
}
.ntcb-btn--outline:hover { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.6); }

/* ── Panneau personnalisation ────────────────────────────────────────────── */
.ntcb-modal {
  padding: 0;
}

.ntcb-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.ntcb-back {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .12s;
}
.ntcb-back:hover { color: #f4f0ff; }

.ntcb-modal-title {
  font-size: .95rem;
  font-weight: 700;
  color: #f4f0ff;
}

/* ── Catégories ──────────────────────────────────────────────────────────── */
.ntcb-categories {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ntcb-category {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 16px;
}

.ntcb-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ntcb-category-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ntcb-category-name {
  font-size: .88rem;
  font-weight: 700;
  color: #f4f0ff;
}

.ntcb-category-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(139,92,246,.15);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,.25);
}
.ntcb-badge--required {
  background: rgba(34,197,94,.12);
  color: #4ade80;
  border-color: rgba(34,197,94,.25);
}

.ntcb-category-desc {
  font-size: .8rem;
  color: #9ca3af;
  line-height: 1.55;
  margin: 0 0 10px;
}

.ntcb-cookie-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  background: rgba(0,0,0,.2);
  border-radius: 7px;
  font-size: .76rem;
}

.ntcb-cookie-name {
  font-family: 'Courier New', monospace;
  color: #a78bfa;
  font-weight: 600;
}

.ntcb-cookie-dur { color: #6b7280; }

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.ntcb-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.ntcb-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ntcb-toggle-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  border-radius: 24px;
  transition: background .2s;
}
.ntcb-toggle-thumb::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.ntcb-toggle-input:checked + .ntcb-toggle-thumb {
  background: #7c3aed;
}
.ntcb-toggle-input:checked + .ntcb-toggle-thumb::after {
  transform: translateX(18px);
}

/* Toggle verrouillé (strictement nécessaires) */
.ntcb-toggle--locked .ntcb-toggle-thumb {
  background: rgba(34,197,94,.3);
  cursor: not-allowed;
}
.ntcb-toggle--locked .ntcb-toggle-thumb::after {
  transform: translateX(18px);
  background: #4ade80;
}

/* ── Footer modal ────────────────────────────────────────────────────────── */
.ntcb-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #nt-cookie-banner { padding: 10px; align-items: flex-end; }
  .ntcb-main { flex-direction: column; align-items: flex-start; padding: 18px 18px 16px; }
  .ntcb-actions { width: 100%; justify-content: flex-end; }
  .ntcb-btn { flex: 1; min-width: 0; }
  .ntcb-modal-footer { flex-wrap: wrap; }
  .ntcb-modal-footer .ntcb-btn { flex: 1; }
  .ntcb-categories { padding: 12px 16px; }
  .ntcb-modal-head { padding: 14px 16px 12px; }
}
