/* ============================================
   LUMIÈRE CHATBOT WIDGET
   ============================================ */

/* Floating chat toggle button */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    160deg,
    #906818 0%, #A67420 8%, #BF8A30 18%,
    #D4A24A 30%, #E2B85A 42%, #F0C85C 50%,
    #E2B85A 58%, #D4A24A 70%, #BF8A30 82%,
    #A67420 92%, #906818 100%
  );
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 162, 74, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: chat-pulse 3s ease-in-out infinite;
}
.chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}
.chat-toggle svg {
  width: 26px;
  height: 26px;
  color: #0E3F31;
  transition: transform 0.3s ease;
}
.chat-toggle.active svg {
  transform: rotate(90deg);
}

@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 162, 74, 0.4); }
  50% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(212, 162, 74, 0); }
}

/* Chat panel */
.chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-height: 560px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 240, 232, 0.08);
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Chat header */
.chat-header {
  background: linear-gradient(135deg, #0E3F31 0%, #001810 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(212, 162, 74, 0.2);
}
.chat-header-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(212, 162, 74, 0.4);
  overflow: hidden;
  flex-shrink: 0;
}
.chat-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-header-info {
  flex: 1;
  min-width: 0;
}
.chat-header-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: #F5F0E8;
  letter-spacing: 0.04em;
}
.chat-header-status {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: rgba(245, 240, 232, 0.6);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ADE80;
  display: inline-block;
}
.chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(245, 240, 232, 0.5);
  padding: 4px;
  transition: color 0.2s ease;
}
.chat-close:hover {
  color: #F5F0E8;
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #001810 0%, #0E3F31 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  max-height: 360px;
}
.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 162, 74, 0.2);
  border-radius: 2px;
}

/* Message bubbles */
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.55;
  animation: msg-appear 0.25s ease;
}
@keyframes msg-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
  align-self: flex-start;
  background: rgba(245, 240, 232, 0.08);
  color: #F2EDE6;
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(166, 116, 32, 0.25), rgba(212, 162, 74, 0.15));
  color: #F5F0E8;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(212, 162, 74, 0.15);
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(212, 162, 74, 0.5);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #001008;
  border-top: 1px solid rgba(212, 162, 74, 0.12);
}
.chat-input {
  flex: 1;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid rgba(245, 240, 232, 0.1);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #F5F0E8;
  outline: none;
  transition: border-color 0.2s ease;
  resize: none;
  max-height: 80px;
  min-height: 40px;
}
.chat-input::placeholder {
  color: rgba(245, 240, 232, 0.35);
}
.chat-input:focus {
  border-color: rgba(212, 162, 74, 0.35);
}
.chat-send {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: none;
  background: linear-gradient(135deg, #A67420, #D4A24A);
  color: #0E3F31;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-send:hover {
  transform: scale(1.05);
}
.chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.chat-send svg {
  width: 16px;
  height: 16px;
}

/* Powered by line */
.chat-powered {
  text-align: center;
  padding: 6px;
  background: #001008;
  font-family: var(--font-body);
  font-size: 0.6rem;
  color: rgba(245, 240, 232, 0.25);
  letter-spacing: 0.04em;
}

/* Welcome message */
.chat-welcome {
  text-align: center;
  padding: 8px 0 4px;
}
.chat-welcome p {
  font-size: 0.75rem;
  color: rgba(245, 240, 232, 0.45);
  font-style: italic;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 84px;
    max-height: calc(100vh - 120px);
  }
  .chat-toggle {
    right: 12px;
    bottom: 16px;
  }
}
