/* ── VIALA CORP CHATBOT WIDGET STYLES ── */

/* Floating Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--cuivre, #B8894A);
  color: #0A0A09;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(184, 137, 74, 0.4), 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.25s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.08);
  background: var(--cuivre-light, #CFA261);
  box-shadow: 0 12px 28px rgba(184, 137, 74, 0.5), 0 6px 16px rgba(0, 0, 0, 0.6);
}

.chatbot-toggle:active {
  transform: scale(0.95);
}

.chatbot-toggle svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.chatbot-toggle--open svg {
  transform: rotate(90deg);
}

/* Badge Notification Tooltip */
.chatbot-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #E74C3C;
  color: #FFF;
  font-family: var(--font-label, sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Chat Window Modal */
.chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: rgba(18, 18, 16, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(184, 137, 74, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.chatbot-window--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
  padding: 16px 20px;
  background: rgba(26, 26, 23, 0.95);
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cuivre, #B8894A);
  color: #0A0A09;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.chatbot-header__info h4 {
  margin: 0;
  font-family: var(--font-heading, sans-serif);
  font-size: 1.05rem;
  color: var(--blanc, #FFF);
  letter-spacing: 0.02em;
}

.chatbot-header__status {
  font-size: 0.75rem;
  color: #2ECC71;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-header__status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #2ECC71;
  border-radius: 50%;
  box-shadow: 0 0 6px #2ECC71;
}

.chatbot-header__close {
  background: none;
  border: none;
  color: var(--texte-muter, #888);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.chatbot-header__close:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.1);
}

/* Body / Messages */
.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chatbot-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeInMsg 0.25s ease-out;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.chatbot-msg__bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
}

.chatbot-msg--bot .chatbot-msg__bubble {
  background: rgba(34, 34, 30, 0.9);
  color: #ECECEC;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

.chatbot-msg--user .chatbot-msg__bubble {
  background: var(--cuivre, #B8894A);
  color: #0A0A09;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.chatbot-msg__time {
  font-size: 0.68rem;
  color: #777;
  margin-top: 4px;
  align-self: flex-end;
}

/* Suggestion Chips */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chatbot-chip {
  background: rgba(184, 137, 74, 0.12);
  color: var(--cuivre-light, #CFA261);
  border: 1px solid rgba(184, 137, 74, 0.3);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}

.chatbot-chip:hover {
  background: rgba(184, 137, 74, 0.25);
  border-color: var(--cuivre, #B8894A);
  transform: translateY(-1px);
}

/* Action Card (Fallback Contact) */
.chatbot-action-card {
  background: rgba(26, 26, 23, 0.95);
  border: 1px solid var(--cuivre, #B8894A);
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
  text-align: center;
}

.chatbot-action-card p {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  color: #DDD;
}

.chatbot-action-card .btn {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.82rem;
  width: 100%;
}

/* Typing Indicator */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(34, 34, 30, 0.9);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  background: var(--cuivre, #B8894A);
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Footer */
.chatbot-footer {
  padding: 12px 16px;
  background: rgba(20, 20, 18, 0.98);
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.chatbot-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  background: rgba(30, 30, 27, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 10px 16px;
  color: #FFF;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  border-color: var(--cuivre, #B8894A);
}

.chatbot-send-btn {
  background: var(--cuivre, #B8894A);
  color: #0A0A09;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.15s;
}

.chatbot-send-btn:hover {
  background: var(--cuivre-light, #CFA261);
  transform: scale(1.05);
}

.chatbot-send-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  margin-left: 2px;
}

/* Responsive Mobile */
@media (max-width: 480px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}
