/* Core */
@import "./core/variables.css";
@import "./core/layout.css";

/* UI */
@import "./ui/topbar.css";
@import "./ui/icons.css";
@import "./ui/header.css";
@import "./ui/messages.css";
@import "./ui/options.css";
@import "./ui/input.css";

/* States */
@import "./states/visibility.css";
@import "./states/animations.css";

/* RGPD */
@import "./rgpd/modal.css";

/* =====================================================================
   BOUTON PREMIUM — FORCE LOAD (ANTI WP / ANTI CACHE)
   ===================================================================== */

#ahg-sc-bubble-button {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;

    padding: 12px 18px !important;
    border-radius: 999px !important;

    border: none !important;
    outline: none !important;
    background: #C89B7B !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;

    color: #fff !important;

    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1 !important;

    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
        opacity .25s ease,
        transform .25s ease;

    pointer-events: auto !important;
}

/* ---------------------------------------------------------
   ÉTATS BOUTON — SORTIE PREMIUM
--------------------------------------------------------- */

#ahg-sc-bubble-button.hidden,
#ahg-sc-bubble-button.is-hiding {
    opacity: 0 !important;
    transform: translateY(8px) scale(.96) !important;
    pointer-events: none !important;
}

/* ---------------------------------------------------------
   ÉTAT BOUTON — ENTRÉE
--------------------------------------------------------- */

#ahg-sc-bubble-button.is-showing {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

/* Icône bouton */
#ahg-sc-bubble-button svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
}

/* =====================================================================
   FENÊTRE CHAT — ANIMATION PREMIUM
   ===================================================================== */

#ahg-sc-window {
    opacity: 0;
    transform: translateY(12px) scale(.98);
    pointer-events: none;

    transition:
        opacity .28s ease,
        transform .28s ease;
}

/* Fenêtre visible */
#ahg-sc-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* =====================================================================
   ACCESSIBILITÉ & ROBUSTESSE
   ===================================================================== */

#ahg-sc-window,
#ahg-sc-bubble-button {
    -webkit-tap-highlight-color: transparent;
}

/* =====================================================================
   LEAD MODAL (override anti thème)
   ===================================================================== */

#ahg-sc-window #ahg-sc-lead-overlay,
#ahg-sc-window #ahg-sc-lead-sheet {
  font-family: var(--ahg-font-family);
}

/* ✅ Plus d’espace entre le texte "si nécessaire" et les champs */
#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-sub,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-sub {
  margin-bottom: 18px !important;
}

/* ✅ On masque les libellés au-dessus des champs (placeholders only) */
#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-label,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-label {
  display: none !important;
}

/* Croix : pas de fond au hover, juste opacité */
#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-close,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-close {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 6px !important;
  line-height: 1 !important;
}

#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-close:hover,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-close:hover {
  background: transparent !important;
  box-shadow: none !important;
  opacity: .7 !important;
}

#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-close:active,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-close:active {
  background: transparent !important;
  box-shadow: none !important;
  opacity: .55 !important;
}

/* =====================================================================
   Inputs Prénom / Nom / Email : COPIE CONFORME DU CHAMP MESSAGE
   ===================================================================== */

#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-input,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-input {
  width: 100% !important;
  box-sizing: border-box !important;

  padding: 12px 16px !important;

  border: none !important;
  border-radius: 20px !important;

  background: #f9f9f9 !important;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.06),
    0 4px 12px rgba(0,0,0,0.08) !important;

  font-size: 15px !important;
  font-family: var(--ahg-font-family) !important;

  outline: none !important;
}

#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-input:hover,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-input:hover,
#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-input:focus,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-input:focus {
  outline: none !important;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.10),
    0 8px 20px rgba(0,0,0,0.15) !important;
  background: #ffffff !important;
}

#ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-input::placeholder,
#ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-input::placeholder {
  color: rgba(0,0,0,.35) !important;
}

/* iOS: empêcher zoom clavier */
@media (max-width: 768px) {
  #ahg-sc-window #ahg-sc-lead-overlay .ahg-sc-lead-input,
  #ahg-sc-window #ahg-sc-lead-sheet  .ahg-sc-lead-input {
    font-size: 16px !important;
  }
}

/* ===============================
   SMARTCHAT — LINKS FIX
   =============================== */

.ahg-sc-msg a {
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.ahg-sc-msg a:hover {
    text-decoration: none;
    opacity: 0.85;
}

.ahg-sc-msg a:visited {
    color: inherit;
}

.ahg-sc-msg {
    pointer-events: auto;
}

.ahg-sc-msg a {
    pointer-events: auto;
}

/* =====================================================================
   ✅ PATCH COULEUR TEXTE BOT (PRIORITÉ MAXIMALE)
   ===================================================================== */
#ahg-sc-messages .ahg-sc-msg.ahg-sc-bot span {
    /* La variable --ahg-bot-text-color est définie dans le PHP (class-frontend-render.php) */
    /* On force l'application avec !important pour écraser les imports */
    color: var(--ahg-bot-text-color, inherit) !important;
}

/* =====================================================================
   ✅ PATCH COULEUR BULLE BOT (PRIORITÉ MAXIMALE)
   ===================================================================== */
#ahg-sc-messages .ahg-sc-msg.ahg-sc-bot {
    /* La variable --ahg-bot-bubble-color est définie dans le PHP (class-frontend-render.php) */
    /* On force l'application avec !important pour écraser les imports */
    background: var(--ahg-bot-bubble-color, #f3f4f6) !important;
}

/* =====================================================================
   ✅ PATCH COULEUR ACTIONS BOT (PRIORITÉ MAXIMALE)
   ===================================================================== */
.ahg-sc-option {
    /* Les variables --ahg-bot-action-color et --ahg-bot-action-hover-color sont définies dans le PHP (class-frontend-render.php) */
    /* On force l'application avec !important pour écraser les imports */
    background: transparent !important;
    border-color: var(--ahg-bot-action-color, #c89b7b) !important;
    color: var(--ahg-bot-action-color, #c89b7b) !important;
}

.ahg-sc-option:hover,
.ahg-sc-option-selected {
    background: var(--ahg-bot-action-hover-color, #c89b7b) !important;
    border-color: var(--ahg-bot-action-hover-color, #c89b7b) !important;
    color: var(--ahg-bot-action-hover-text-color, #fff) !important;
}

/* =====================================================================
   ✅ PATCH COULEUR UTILISATEUR (PRIORITÉ MAXIMALE)
   ===================================================================== */
#ahg-sc-messages .ahg-sc-msg.ahg-sc-user {
    /* Les variables --ahg-user-text-color et --ahg-user-bubble-color sont définies dans le PHP (class-frontend-render.php) */
    /* On force l'application avec !important pour écraser les imports */
    background: var(--ahg-user-bubble-color, #0084ff) !important;
    color: var(--ahg-user-text-color, #fff) !important;
}