/* ─────────────────────────────────────────────
   webChat.css — Widget chat Kokibee
   Dépend des CSS variables définies dans kokibee.html
   ───────────────────────────────────────────── */

/* ── Bouton flottant ── */
.wc-trigger {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--deep, #111109);
  border: 1px solid var(--gold, #d4a843);
  box-shadow:
    0 0 18px rgba(212, 168, 67, 0.25),
    inset 0 0 12px rgba(212, 168, 67, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: box-shadow 0.3s, transform 0.3s;
  user-select: none;
}

.wc-trigger:hover {
  box-shadow:
    0 0 32px rgba(212, 168, 67, 0.45),
    inset 0 0 16px rgba(212, 168, 67, 0.1);
  transform: scale(1.07);
}

.wc-trigger.wc-open {
  border-color: var(--honey, #c8850a);
  box-shadow:
    0 0 22px rgba(200, 133, 10, 0.35),
    inset 0 0 12px rgba(200, 133, 10, 0.08);
}

/* badge de notification */
.wc-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--honey, #c8850a);
  box-shadow: 0 0 8px rgba(200, 133, 10, 0.75);
  display: none;
}

.wc-badge.visible {
  display: block;
}

/* ── Fenêtre chat ── */
.wc-window {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  z-index: 8999;
  width: 340px;
  height: 480px;
  background: var(--deep, #111109);
  border: 1px solid rgba(212, 168, 67, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  box-shadow:
    0 8px 48px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(212, 168, 67, 0.06);

  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease;
}

.wc-window.wc-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* coins décoratifs dorés */
.wc-window::before,
.wc-window::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 1;
}
.wc-window::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--gold, #d4a843);
  border-left: 1px solid var(--gold, #d4a843);
}
.wc-window::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--gold, #d4a843);
  border-right: 1px solid var(--gold, #d4a843);
}

/* motif nid d'abeille en fond (très discret) */
.wc-window .wc-scanlines {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='50'%3E%3Cpath d='M14 33L0 25L0 8L14 0L28 8L28 25L14 33Z' fill='none' stroke='%23d4a843' stroke-width='0.4' stroke-opacity='0.04'/%3E%3Cpath d='M14 83L0 75L0 58L14 50L28 58L28 75L14 83Z' fill='none' stroke='%23d4a843' stroke-width='0.4' stroke-opacity='0.04'/%3E%3C/svg%3E");
  background-size: 28px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ── Header ── */
.wc-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(212, 168, 67, 0.15);
  background: rgba(212, 168, 67, 0.03);
  flex-shrink: 0;
}

.wc-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.wc-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--dim, #1a1a12);
  border: 1px solid rgba(212, 168, 67, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.wc-header-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wc-header-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold, #d4a843);
  line-height: 1;
  text-shadow: 0 0 12px rgba(212, 168, 67, 0.3);
}

.wc-header-status {
  font-family: 'Barlow', sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted, #b8a88a);
  display: flex;
  align-items: center;
  gap: 5px;
}

.wc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold, #d4a843);
  box-shadow: 0 0 6px rgba(212, 168, 67, 0.65);
  animation: wc-pulse 2.5s infinite;
}

@keyframes wc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.wc-close {
  background: none;
  border: none;
  color: var(--muted, #b8a88a);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
  font-family: 'Barlow', sans-serif;
}

.wc-close:hover {
  color: var(--gold, #d4a843);
}

/* ── Zone messages ── */
.wc-messages {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 168, 67, 0.2) transparent;
}

.wc-messages::-webkit-scrollbar {
  width: 3px;
}
.wc-messages::-webkit-scrollbar-track {
  background: transparent;
}
.wc-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 67, 0.25);
  border-radius: 2px;
}

/* Message */
.wc-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  gap: 3px;
}

.wc-msg.wc-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

.wc-msg.wc-msg--bot {
  align-self: flex-start;
  align-items: flex-start;
}

.wc-bubble {
  padding: 0.55rem 0.85rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text, #d4cbb8);
}

.wc-msg--user .wc-bubble {
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 2px 0 2px 2px;
}

.wc-msg--bot .wc-bubble {
  background: rgba(184, 168, 138, 0.05);
  border: 1px solid rgba(184, 168, 138, 0.12);
  border-radius: 0 2px 2px 2px;
}

.wc-time {
  font-family: 'Barlow', sans-serif;
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  color: rgba(184, 168, 138, 0.3);
  text-transform: uppercase;
}

/* Message système */
.wc-msg--system {
  align-self: center;
  font-family: 'Barlow', sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  color: rgba(212, 168, 67, 0.3);
  text-transform: uppercase;
}

/* Typing indicator */
.wc-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 0.55rem 0.85rem;
  background: rgba(184, 168, 138, 0.05);
  border: 1px solid rgba(184, 168, 138, 0.12);
}

.wc-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-dim, #a07c2e);
  opacity: 0.4;
  animation: wc-typing 1.3s infinite;
}

.wc-typing span:nth-child(2) { animation-delay: 0.22s; }
.wc-typing span:nth-child(3) { animation-delay: 0.44s; }

@keyframes wc-typing {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-4px); }
}

/* ── Footer / Input ── */
.wc-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(212, 168, 67, 0.13);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.wc-input {
  flex: 1;
  background: rgba(212, 168, 67, 0.03);
  border: 1px solid rgba(212, 168, 67, 0.18);
  color: var(--text, #d4cbb8);
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  font-weight: 300;
  padding: 0.5rem 0.75rem;
  outline: none;
  border-radius: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--gold, #d4a843);
  resize: none;
}

.wc-input::placeholder {
  color: rgba(184, 168, 138, 0.3);
  font-family: 'Barlow', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-style: italic;
}

.wc-input:focus {
  border-color: rgba(212, 168, 67, 0.45);
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.08);
}

.wc-send {
  background: transparent;
  border: 1px solid var(--gold, #d4a843);
  color: var(--gold, #d4a843);
  font-family: 'Barlow', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.wc-send:hover:not(:disabled) {
  background: var(--gold, #d4a843);
  color: var(--black, #0a0a08);
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.3);
}

.wc-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Responsive mobile ── */
@media (max-width: 480px) {
  .wc-window {
    right: 1rem;
    left: 1rem;
    width: auto;
    bottom: 5rem;
  }

  .wc-trigger {
    right: 1rem;
    bottom: 1rem;
  }
}
