/* ============================================
   Boost MyHotel — Avatar Widget Styles
   ============================================ */

:root {
  --bmh-navy: #0F1B2D;
  --bmh-navy-mid: #111f35;
  --bmh-navy-light: #162640;
  --bmh-blue: #2563EB;
  --bmh-blue-dark: #1d4ed8;
  --bmh-gold: #F59E0B;
  --bmh-gold-light: #FCD34D;
  --bmh-white: #FFFFFF;
  --bmh-grey: #94A3B8;
  --bmh-grey-light: #CBD5E1;
  --bmh-green: #22c55e;
  --bmh-radius: 16px;
  --bmh-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.3);
  --bmh-font: 'Inter', system-ui, -apple-system, sans-serif;
  --bmh-z: 9999;
}

/* ---- Reset scoped ---- */
#bmh-widget-root *,
#bmh-widget-root *::before,
#bmh-widget-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================
   BOUTON FLOTTANT
   ============================================ */

#bmh-widget-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--bmh-z);
  font-family: var(--bmh-font);
}

#bmh-toggle-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--bmh-blue), var(--bmh-gold));
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  outline: none;
}

#bmh-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.6);
}

#bmh-toggle-btn:active {
  transform: scale(0.96);
}

#bmh-toggle-btn svg {
  width: 28px;
  height: 28px;
  fill: var(--bmh-white);
  transition: opacity 0.2s ease;
}

/* Pulse animation */
#bmh-toggle-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bmh-blue), var(--bmh-gold));
  opacity: 0;
  animation: bmh-pulse 2.5s ease-in-out infinite;
}

@keyframes bmh-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Badge "Bonjour" */
#bmh-badge {
  position: absolute;
  bottom: 72px;
  right: 0;
  background: var(--bmh-white);
  color: var(--bmh-navy);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

#bmh-badge::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 20px;
  width: 10px;
  height: 10px;
  background: var(--bmh-white);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

#bmh-badge.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================
   FENÊTRE DU WIDGET
   ============================================ */

#bmh-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  height: 580px;
  background: var(--bmh-navy);
  border-radius: var(--bmh-radius);
  box-shadow: var(--bmh-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);

  /* Fermé par défaut */
  opacity: 0;
  transform: scale(0.92) translateY(12px);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#bmh-window.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* ---- HEADER ---- */
#bmh-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  background: var(--bmh-navy-mid);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

#bmh-header-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

#bmh-header-info {
  flex: 1;
  min-width: 0;
}

#bmh-header-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--bmh-white);
  line-height: 1.2;
}

#bmh-header-status {
  font-size: 12px;
  color: var(--bmh-grey);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

#bmh-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bmh-green);
  animation: bmh-blink 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes bmh-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

#bmh-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--bmh-grey);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  outline: none;
}

#bmh-close-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--bmh-white);
}

/* ---- VIDEO PANEL ---- */
/* ---- LOGO PANEL ---- */
#bmh-logo-panel {
  height: 240px;
  background: linear-gradient(160deg, #0b1628 0%, #0f1e36 60%, #0d1a2e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#bmh-logo-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

#bmh-logo-hero {
  width: 185px;
  height: 185px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  drop-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

#bmh-logo-tagline {
  font-size: 12px;
  font-weight: 500;
  color: rgba(148,163,184,0.7);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

/* ---- CHAT AREA ---- */
#bmh-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#bmh-chat-area::-webkit-scrollbar {
  width: 4px;
}

#bmh-chat-area::-webkit-scrollbar-track {
  background: transparent;
}

#bmh-chat-area::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* Messages */
.bmh-message {
  max-width: 82%;
  animation: bmh-msg-in 0.2s ease forwards;
}

@keyframes bmh-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bmh-message.user {
  align-self: flex-end;
}

.bmh-message.agent {
  align-self: flex-start;
  display: flex;
  gap: 7px;
  align-items: flex-end;
}

.bmh-agent-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-bottom: 1px;
}

.bmh-bubble {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.bmh-message.user .bmh-bubble {
  background: var(--bmh-blue);
  color: var(--bmh-white);
  border-bottom-right-radius: 4px;
}

.bmh-message.agent .bmh-bubble {
  background: var(--bmh-navy-light);
  color: var(--bmh-grey-light);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Typing indicator */
#bmh-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

#bmh-typing.visible {
  opacity: 1;
}

#bmh-typing-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--bmh-blue), var(--bmh-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: var(--bmh-white);
  flex-shrink: 0;
}

.bmh-typing-dots {
  background: var(--bmh-navy-light);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.bmh-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bmh-grey);
  animation: bmh-bounce 1.2s ease-in-out infinite;
}

.bmh-typing-dots span:nth-child(1) { animation-delay: 0s; }
.bmh-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.bmh-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bmh-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-5px); }
}

/* ---- LEAD CAPTURE FORM ---- */
#bmh-lead-form {
  position: absolute;
  bottom: 56px;
  left: 0;
  right: 0;
  background: var(--bmh-white);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 18px 16px 16px;
  transform: translateY(calc(100% + 56px));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  border-radius: 0 0 var(--bmh-radius) var(--bmh-radius);
}

#bmh-lead-form.visible {
  transform: translateY(0);
}

#bmh-lead-form-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bmh-navy);
  margin-bottom: 12px;
}

.bmh-form-field {
  margin-bottom: 10px;
}

.bmh-form-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--bmh-font);
  color: var(--bmh-navy);
  outline: none;
  transition: border-color 0.2s;
}

.bmh-form-field input:focus {
  border-color: var(--bmh-blue);
}

.bmh-form-field input::placeholder {
  color: #94a3b8;
}

#bmh-lead-submit {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--bmh-blue), var(--bmh-blue-dark));
  color: var(--bmh-white);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--bmh-font);
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.2s, transform 0.15s;
}

#bmh-lead-submit:hover {
  opacity: 0.9;
}

#bmh-lead-submit:active {
  transform: scale(0.98);
}

#bmh-lead-privacy {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  margin-top: 8px;
}

#bmh-lead-skip {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
  margin-top: 6px;
  background: none;
  border: none;
  font-family: var(--bmh-font);
  text-decoration: underline;
  width: 100%;
}

/* ---- BOOKING BUTTON ---- */
.bmh-booking-btn-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 16px 16px 16px;
}

.bmh-booking-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(180deg,
    #FFD966 0%,
    #F5A800 30%,
    #C97D00 65%,
    #E8A800 100%
  );
  border: 2px solid #8B5E00;
  outline: 1px solid rgba(255, 220, 100, 0.4);
  border-radius: 50px;
  color: #1a0a00;
  font-family: var(--bmh-font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 230, 120, 0.5);
  box-shadow:
    0 4px 0 #7A4E00,
    0 6px 16px rgba(180, 100, 0, 0.5),
    inset 0 1px 0 rgba(255, 245, 180, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: bmh-fade-slide 0.35s ease;
  cursor: pointer;
}

.bmh-booking-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 0 #7A4E00,
    0 10px 24px rgba(180, 100, 0, 0.55),
    inset 0 1px 0 rgba(255, 245, 180, 0.6);
}

.bmh-booking-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #7A4E00,
    0 4px 10px rgba(180, 100, 0, 0.4),
    inset 0 1px 0 rgba(255, 245, 180, 0.4);
}

.bmh-booking-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.bmh-booking-btn-icon svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}

.bmh-confirmed-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 50px;
  color: var(--bmh-grey);
  font-family: var(--bmh-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bmh-confirmed-btn:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--bmh-green);
  color: var(--bmh-green);
}

.bmh-confirmed-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- INPUT AREA ---- */
#bmh-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bmh-navy-mid);
  border-top: 1px solid rgba(255,255,255,0.06);
  height: 56px;
  flex-shrink: 0;
}

#bmh-input {
  flex: 1;
  background: var(--bmh-navy-light);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 13.5px;
  font-family: var(--bmh-font);
  color: var(--bmh-white);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

#bmh-input::placeholder {
  color: rgba(148, 163, 184, 0.55);
}

#bmh-input:focus {
  border-color: rgba(37, 99, 235, 0.5);
}

#bmh-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#bmh-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: none;
  background: var(--bmh-gold);
  color: var(--bmh-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  outline: none;
}

#bmh-send-btn:hover {
  background: var(--bmh-gold-light);
}

#bmh-send-btn:active {
  transform: scale(0.92);
}

#bmh-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

#bmh-send-btn svg {
  width: 16px;
  height: 16px;
  fill: var(--bmh-navy);
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */

@media (max-width: 640px) {
  #bmh-widget-root {
    bottom: 16px;
    right: 16px;
  }

  #bmh-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    bottom: auto;
    right: auto;
    transform-origin: bottom center;
  }

  #bmh-window.open {
    transform: scale(1) translateY(0);
  }

  #bmh-video-panel {
    height: 200px;
  }
}
