@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

/* :host cible <deep-chat> depuis l'intérieur de son propre Shadow DOM
   (voir auxiliaryStyle dans chatbot-template.php) : la police se propage
   ensuite par héritage à tous les éléments du chat (bulles, input, boutons). */
:host,
#chat-view {
  font-family:
    'Rubik',
    -apple-system,
    sans-serif;
}

.yoozly-chat,
.yoozly-chat-cta {
  font-family:
    'Rubik',
    -apple-system,
    sans-serif;
}

:root {
  --yoozly-chat-color-hover: #9f358b;
  --yoozly-chat-color: #9f358b;
  --yoozly-chat-cta-position: 16px;
  --yoozly-chat-cta-size: 56px;
  --yoozly-chat-height: 600px;
  --yoozly-chat-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --yoozly-chat-width: 400px;
}

.yoozly-chat {
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: var(--yoozly-chat-height);
  max-height: 70vh;
  position: fixed;
  right: var(--yoozly-chat-cta-position);
  transform: translateY(var(--yoozly-chat-height));
  transition: var(--yoozly-chat-transition);
  opacity: 0;
  width: 90vw;
  max-width: var(--yoozly-chat-width);
  z-index: 600;
  pointer-events: none;
}

.yoozly-chat.active {
  --cta-and-margin: calc(
    var(--yoozly-chat-cta-position) + 15px + var(--yoozly-chat-cta-size)
  );
  opacity: 1;
  transform: translateY(calc(var(--cta-and-margin) * -1));
  pointer-events: auto;
}

.yoozly-chat__container {
  border-radius: 10px;
  box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.2);
  height: var(--yoozly-chat-height);
  max-height: 70vh;
  overflow: hidden;
}

.yoozly-chat-cta {
  align-items: center;
  background-color: var(--yoozly-chat-color);
  border-radius: 20px;
  border-top-right-radius: 4px;
  border: none;
  bottom: var(--yoozly-chat-cta-position);
  cursor: pointer;
  display: flex;
  font-weight: bold;
  height: var(--yoozly-chat-cta-size);
  justify-content: center;
  position: fixed;
  right: var(--yoozly-chat-cta-position);
  width: var(--yoozly-chat-cta-size);
  z-index: 601;
  transition: all 0.2s ease-out;
}

.yoozly-chat-cta:hover,
.yoozly-chat-cta.active {
  background-color: var(--yoozly-chat-color-hover);
  transition: all 0.2s ease-out;
}

.yoozly-chat-cta .svg-close,
.yoozly-chat-cta .svg-open {
  height: 24px;
  margin: auto;
  opacity: 0;
  position: absolute;
  transform: translateY(10px);
  transition: var(--yoozly-chat-transition);
  width: 24px;
}

.yoozly-chat-cta .svg-open,
.yoozly-chat-cta.active .svg-close {
  opacity: 1;
  transform: translateY(0);
}

.yoozly-chat-cta.active .svg-open {
  opacity: 0;
  transform: translateY(-10px);
}

/* Les règles ci-dessous sont injectées dans le Shadow DOM de <deep-chat>
   via l'attribut "auxiliaryStyle" (voir chatbot-template.php), car ce
   composant est isolé du CSS global de la page. */
#text-input-container {
  width: 94%;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 16px;
}

.chat-suggestions-container {
  margin: 0;
}

.chat-suggestions-title {
  margin-top: 0;
  margin-bottom: 5px;
  font-size: 14px;
}

.chat-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.chat-suggestion-btn {
  font-family:
    'Rubik',
    -apple-system,
    sans-serif;
  background-color: #9f358b;
  color: #ffffff;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 12px;
  transition: all 0.3s;
}

.chat-suggestion-btn--particulier {
  background-color: #667e07;
}

.chat-suggestion-btn--particulier:hover {
  background-color: #4e5f05;
}

.chat-suggestion-btn--entreprise-association {
  background-color: #237baf;
}

.chat-suggestion-btn--entreprise-association:hover {
  background-color: #1c6288;
}

.chat-suggestion-btn--collectivite {
  background-color: #9f358b;
}

.chat-suggestion-btn--collectivite:hover {
  background-color: #7a2a6d;
}

.chat-suggestion-btn--copropriete {
  background-color: #205875;
}

.chat-suggestion-btn--copropriete:hover {
  background-color: #17415a;
}
