/* ============================================
   HYMAGE CHATBOT — DESIGN "TV MIROIR"
   Effet écran qui s'allume / s'éteint
   ============================================ */

/* ============================================
   1. BOUTON FLOTTANT — TV MIROIR + BULLE DE CHAT
   ============================================ */
.hymage-chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  padding: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Bulle "Une question ?" qui flotte au-dessus */
.hymage-chatbot-bubble {
  background: #fff;
  padding: 8px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  font-size: 12px;
  color: #1a1a1a;
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
  position: relative;
  animation: hymageBubbleFloat 3s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.hymage-chatbot-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #fff;
}

.hymage-chatbot-bubble-emoji {
  font-size: 14px;
  display: inline-block;
}

@keyframes hymageBubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* TV miroir avec cadre doré */
.hymage-chatbot-tv-frame {
  display: block;
  width: 130px;
  height: 90px;
  padding: 6px;
  background: linear-gradient(135deg, #D4B582 0%, #B89A6E 50%, #8B6F3F 100%);
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(139, 111, 63, 0.3);
  position: relative;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  box-sizing: border-box;
}

/* Reflet brillant sur le haut du cadre */
.hymage-chatbot-tv-frame::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
  border-radius: 4px 4px 0 0;
  pointer-events: none;
}

.hymage-chatbot-toggle:hover {
  transform: translateY(-3px);
}

.hymage-chatbot-toggle:hover .hymage-chatbot-tv-frame {
  box-shadow: 0 12px 30px rgba(139, 111, 63, 0.45);
}

/* Écran miroir */
.hymage-chatbot-tv-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
  box-sizing: border-box;
}

/* Reflet diagonal style miroir */
.hymage-chatbot-tv-screen::after {
  content: '';
  position: absolute;
  top: -10%; left: -10%;
  width: 50%; height: 130%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  transform: rotate(15deg);
  pointer-events: none;
}

/* Texte "Hymage" en filigrane sur l'écran */
.hymage-chatbot-tv-text {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  font-weight: 300;
  z-index: 2;
  position: relative;
}

/* Voyant doré qui clignote */
.hymage-chatbot-tv-standby {
  position: absolute;
  bottom: 5px; right: 6px;
  width: 4px;
  height: 4px;
  background: #C9A876;
  border-radius: 50%;
  box-shadow: 0 0 6px #C9A876;
  animation: hymageStandby 2s ease-in-out infinite;
  z-index: 5;
}

@keyframes hymageStandby {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Label "Discutez avec nous" en dessous */
.hymage-chatbot-toggle-label {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #5a4525;
  font-weight: 500;
  text-align: center;
  position: relative;
  padding-bottom: 5px;
  margin-top: 2px;
}

.hymage-chatbot-toggle-label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 25px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #B89A6E, transparent);
}

/* Croix de fermeture (visible quand le chat est ouvert) */
.hymage-chatbot-toggle-close {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 200;
  color: #fff;
  background: rgba(0,0,0,0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* État ouvert */
.hymage-chatbot-toggle.active .hymage-chatbot-tv-frame {
  filter: brightness(0.5);
}
.hymage-chatbot-toggle.active .hymage-chatbot-bubble,
.hymage-chatbot-toggle.active .hymage-chatbot-toggle-label {
  opacity: 0;
}
.hymage-chatbot-toggle.active .hymage-chatbot-toggle-close {
  display: flex;
}

/* ============================================
   2. FENÊTRE — ÉCRAN MIROIR QUI S'ALLUME
   ============================================ */
.hymage-chatbot-window {
  position: fixed;
  bottom: 110px;
  right: 30px;
  z-index: 99999;
  width: 400px;
  max-width: calc(100vw - 60px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
  display: none;
  flex-direction: column;
  box-shadow: 
    0 25px 80px rgba(0,0,0,0.5),
    0 0 0 1px rgba(184, 154, 110, 0.15);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  border-radius: 4px;
}

.hymage-chatbot-window.active { 
  display: flex; 
  animation: hymagePowerOn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hymagePowerOn {
  0% {
    transform: scaleY(0.005) scaleX(0);
    opacity: 0;
  }
  30% {
    transform: scaleY(0.005) scaleX(1);
    opacity: 1;
  }
  60% {
    transform: scaleY(1) scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1) scaleX(1);
    opacity: 1;
  }
}

.hymage-chatbot-window::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, 
    rgba(255,255,255,0.04) 0%, 
    rgba(255,255,255,0) 100%);
  pointer-events: none;
  z-index: 10;
}

/* ============================================
   3. HEADER
   ============================================ */
.hymage-chatbot-header {
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 22px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(184, 154, 110, 0.15);
  position: relative;
  z-index: 11;
}

.hymage-chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hymage-chatbot-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #B89A6E 0%, #8B6F3F 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(184, 154, 110, 0.2);
}

.hymage-chatbot-avatar::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.15) 100%);
  pointer-events: none;
}

.hymage-chatbot-avatar-letter {
  font-size: 16px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 1px;
  font-family: Georgia, 'Times New Roman', serif;
  position: relative;
  z-index: 2;
}

.hymage-chatbot-avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid #0a0a0a;
  z-index: 3;
}

.hymage-chatbot-header-title {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin: 0 0 3px 0;
  color: #fff;
}

.hymage-chatbot-header-subtitle {
  font-size: 10px;
  margin: 0;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hymage-chatbot-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 22px;
  font-weight: 200;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  transition: color 0.2s ease;
}

.hymage-chatbot-close:hover { color: #fff; }

/* ============================================
   4. ZONE DE MESSAGES
   ============================================ */
.hymage-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 25px 22px;
  background: 
    linear-gradient(180deg, 
      rgba(184, 154, 110, 0.02) 0%, 
      transparent 50%, 
      rgba(184, 154, 110, 0.015) 100%),
    #0d0d0d;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.hymage-chatbot-msg-row-bot {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  align-self: flex-start;
  max-width: 90%;
  animation: hymageMsgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hymage-chatbot-msg-avatar {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #B89A6E 0%, #8B6F3F 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 300;
  color: #fff;
  font-family: Georgia, serif;
  flex-shrink: 0;
  margin-bottom: 2px;
  box-shadow: 0 0 0 1px rgba(184, 154, 110, 0.2);
}

.hymage-chatbot-msg-bot {
  background: linear-gradient(135deg, #1f1f1f 0%, #161616 100%);
  color: #f0f0f0;
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.65;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px 12px 12px 12px;
  position: relative;
}

.hymage-chatbot-msg-bot::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, transparent 100%);
  border-radius: 4px 12px 0 0;
  pointer-events: none;
}

.hymage-chatbot-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #B89A6E 0%, #8B6F3F 100%);
  color: #fff;
  padding: 12px 18px;
  font-size: 13.5px;
  line-height: 1.6;
  letter-spacing: 0.2px;
  max-width: 80%;
  border-radius: 12px 12px 4px 12px;
  animation: hymageMsgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 12px rgba(184, 154, 110, 0.2);
}

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

/* ============================================
   5. BOUTONS DE CHOIX
   ============================================ */
.hymage-chatbot-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
  align-self: flex-start;
  width: 100%;
  max-width: 95%;
  padding-left: 36px;
  animation: hymageMsgIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

.hymage-chatbot-option-btn {
  background: transparent;
  color: #f0f0f0;
  border: 1px solid rgba(184, 154, 110, 0.4);
  padding: 11px 16px;
  text-align: left;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.hymage-chatbot-option-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(184, 154, 110, 0.15), 
    transparent);
  transition: left 0.5s ease;
}

.hymage-chatbot-option-btn:hover {
  background: rgba(184, 154, 110, 0.1);
  border-color: #B89A6E;
  color: #fff;
  transform: translateX(2px);
}

.hymage-chatbot-option-btn:hover::before { left: 100%; }

/* ============================================
   6. FORMULAIRE LEAD
   ============================================ */
.hymage-chatbot-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  background: linear-gradient(135deg, #1f1f1f 0%, #161616 100%);
  padding: 20px;
  border: 1px solid rgba(184, 154, 110, 0.2);
  width: 100%;
  max-width: 95%;
  align-self: flex-start;
  margin-left: 36px;
  border-radius: 4px;
  animation: hymageMsgIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hymage-chatbot-form input,
.hymage-chatbot-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.3);
  font-family: inherit;
  font-size: 13px;
  color: #fff;
  border-radius: 3px;
  transition: border-color 0.2s ease;
}

.hymage-chatbot-form input::placeholder,
.hymage-chatbot-form textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

.hymage-chatbot-form input:focus,
.hymage-chatbot-form textarea:focus {
  outline: none;
  border-color: #B89A6E;
  background: rgba(0,0,0,0.5);
}

.hymage-chatbot-form button {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #B89A6E 0%, #8B6F3F 100%);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
  border-radius: 3px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.hymage-chatbot-form button:hover { 
  background: linear-gradient(135deg, #C9A876 0%, #9C7E47 100%);
  box-shadow: 0 4px 15px rgba(184, 154, 110, 0.3);
}

.hymage-chatbot-form button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

/* ============================================
   7. INDICATEUR DE FRAPPE
   ============================================ */
.hymage-chatbot-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1f1f1f 0%, #161616 100%);
  border: 1px solid rgba(255,255,255,0.06);
  align-self: flex-start;
  width: fit-content;
  margin-left: 36px;
  border-radius: 4px 12px 12px 12px;
  animation: hymageMsgIn 0.3s ease;
}

.hymage-chatbot-typing span {
  width: 6px;
  height: 6px;
  background: #B89A6E;
  border-radius: 50%;
  animation: hymageTypingDot 1.4s infinite;
}

.hymage-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.hymage-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes hymageTypingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ============================================
   8. FOOTER
   ============================================ */
.hymage-chatbot-footer {
  padding: 14px 22px;
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(184, 154, 110, 0.1);
  text-align: center;
  position: relative;
  z-index: 11;
}

.hymage-chatbot-footer p {
  font-size: 9.5px;
  color: rgba(255,255,255,0.4);
  margin: 0;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 300;
}

.hymage-chatbot-footer p strong {
  color: #B89A6E;
  font-weight: 400;
}

/* ============================================
   9. SCROLLBAR
   ============================================ */
.hymage-chatbot-messages::-webkit-scrollbar { width: 4px; }
.hymage-chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.hymage-chatbot-messages::-webkit-scrollbar-thumb { 
  background: rgba(184, 154, 110, 0.2); 
  border-radius: 2px; 
}
.hymage-chatbot-messages::-webkit-scrollbar-thumb:hover { 
  background: rgba(184, 154, 110, 0.4); 
}

/* ============================================
   10. RESPONSIVE MOBILE
   ============================================ */
@media (max-width: 480px) {
  .hymage-chatbot-window {
    bottom: 95px;
    right: 12px;
    left: 12px;
    width: auto;
    height: calc(100vh - 120px);
  }
  .hymage-chatbot-toggle {
    bottom: 18px;
    right: 18px;
  }
  .hymage-chatbot-tv-frame {
    width: 110px;
    height: 76px;
    padding: 5px;
  }
  .hymage-chatbot-bubble {
    font-size: 11px;
    padding: 6px 12px;
  }
  .hymage-chatbot-toggle-label {
    font-size: 9px;
    letter-spacing: 2px;
  }
  .hymage-chatbot-msg-bot, .hymage-chatbot-msg-user { font-size: 13px; }
}

/* ============================================
   11. POPUP CAL.COM (intégration RDV)
   ============================================ */
.hymage-cal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 10, 0.85);
  z-index: 99999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  animation: hymageCalFade 0.3s ease;
}

@keyframes hymageCalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hymage-cal-modal {
  position: relative;
  width: 100%;
  max-width: 950px;
  height: 90vh;
  max-height: 800px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: hymageCalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hymageCalSlide {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.hymage-cal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 200;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  font-family: inherit;
  line-height: 1;
}

.hymage-cal-close:hover {
  background: rgba(0,0,0,0.9);
}

.hymage-cal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .hymage-cal-overlay { padding: 10px; }
  .hymage-cal-modal { height: 95vh; max-height: none; }
}

/* ============================================
   12. CHAMP TEXTE LIBRE VISITEUR
   ============================================ */
.hymage-chatbot-text-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  background: linear-gradient(135deg, #1f1f1f 0%, #161616 100%);
  padding: 16px;
  border: 1px solid rgba(184, 154, 110, 0.25);
  width: 100%;
  max-width: 95%;
  align-self: flex-start;
  margin-left: 36px;
  border-radius: 4px;
  animation: hymageMsgIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hymage-chatbot-text-input textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.3);
  font-family: inherit;
  font-size: 13px;
  color: #fff;
  border-radius: 3px;
  transition: border-color 0.2s ease;
  resize: none;
  min-height: 60px;
  line-height: 1.5;
}

.hymage-chatbot-text-input textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

.hymage-chatbot-text-input textarea:focus {
  outline: none;
  border-color: #B89A6E;
  background: rgba(0,0,0,0.5);
}

.hymage-chatbot-text-input button {
  padding: 11px;
  background: linear-gradient(135deg, #B89A6E 0%, #8B6F3F 100%);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.hymage-chatbot-text-input button:hover {
  background: linear-gradient(135deg, #C9A876 0%, #9C7E47 100%);
  box-shadow: 0 4px 15px rgba(184, 154, 110, 0.3);
}
