@import url("https://fonts.googleapis.com/css2?family=Georama:wght@400;500;600;700&display=swap");
@import url("https://chat-package-tolky.vercel.app/chat.css");

@keyframes tolky__cursorAnimation {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

@keyframes tolky__loadingPulse {
  from {
    transform: translateY(0);
    opacity: 0.5;
  }
  to {
    transform: translateY(-2px);
    opacity: 1;
  }
}

#tolky-minichat {
  .tolky__container-tolky {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .tolky__tolky-chat *,
  .tolky__tolky-chat *:before,
  .tolky__tolky-chat *:after {
    box-sizing: border-box;
  }

  .tolky__tolky-chat.tolky__hide {
    border-radius: 50%;
    opacity: 0;
    transform: translateY(60px);
  }

  @media (min-width: 768px) {
    .tolky__tolky-chat.tolky__hide {
      transform: scale(0) translateY(60px);
    }
  }

  @media (max-width: 360px) {
    .tolky__tolky-chat {
      margin-right: unset;
    }
  }

  .tolky__messages .tolky__waiting {
    border-radius: 10px;
    background: rgba(187, 166, 242, 0.15);
    padding: 0;
    gap: 3px;
    display: none;
    width: 53px;
    height: 30px;
    opacity: 0;
    overflow: hidden;
    transition: height 1000ms cubic-bezier(0.25, 0.75, 0.05, 1.1),
      opacity 1000ms ease-out, width 5000ms ease-out;
    margin-top: 13px;
  }

  .tolky__messages .tolky__waiting.tolky__show {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: self-start;
    justify-content: center;
    padding: 10px 0px;
    opacity: 1;
  }

  .tolky__messages .tolky__waiting .tolky__dot {
    width: 7px;
    height: 7px;
    background: rgba(187, 166, 242, 1);
    border-radius: 50%;
    animation: tolky__loadingPulse 0.7s infinite alternate;
  }

  .tolky__messages .tolky__waiting .tolky__dot:nth-child(2) {
    animation-delay: 0.2s;
  }

  .tolky__messages .tolky__waiting .tolky__dot:nth-child(3) {
    animation-delay: 0.4s;
  }

  .tolky__cursor-animation {
    animation: tolky__cursorAnimation 1s infinite;
    width: 10px;
    height: 21px;
    position: absolute;
    top: 14px;
    left: 27px;
    background-repeat: no-repeat;
    background-image: url(/images/cursor.svg);
    cursor: pointer;
  }

  .tolky__icon {
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.15));
  }

  /* Container Botão MiniChat */

  .tolky__tolky-chat {
    font-family: "Georama", sans-serif;
    color: #002b3e;
    font-size: 14px;
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: end;
    transition: all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom;
    transform: translateY(0);
    z-index: 99999;
    right: 0;

    width: 100%;
    height: 15vh;
    background: linear-gradient(
      180deg,
      rgba(111, 138, 246, 0) 0%,
      rgba(111, 138, 246, 0.5) 100%
    );
    bottom: 0;

    justify-content: end;
  }

  @media (min-width: 768px) {
    .tolky__tolky-chat {
      background: none;
      width: min-content;
      height: auto;
      padding-bottom: 0;
      margin-right: 10px;
      bottom: 20px;
      transform: scale(1) translateY(0);
      transform-origin: bottom right;
    }
  }

  /* Controla a exibição dos botões do MiniChat, de acordo com o dispositivo */

  .tolky__mobile {
    display: flex !important;
  }

  .tolky__mobile.with-banner-image {
    display: grid !important;
  }

  .tolky__desktop {
    display: none !important;
  }

  @media (min-width: 768px) {
    .tolky__mobile {
      display: none !important;
    }

    .tolky__mobile.with-banner-image {
      display: none !important;
    }

    .tolky__desktop {
      display: flex !important;
    }

    .tolky__opened.tolky__tolky-chat {
      height: 100%;
      padding-bottom: 0;
    }

    .tolky__opened .tolky__desktop.tolky__chat-button {
      display: none !important;
      transform: translateY(120px);
    }
  }

  /* Slash */

  .tolky__slash {
    display: inline-flex;
    background-image: url("/images/slash.svg");
    background-repeat: no-repeat;
    width: 7.12px;
    height: 13.93px;
    filter: drop-shadow(0px 1px 2px rgba(0, 43, 62, 0.6));
  }

  /* Logo Tolky com Notificação */

  .tolky__chat-button .tolky__widget-icon {
    position: relative;
  }

  /* Comum entre mobile e desktop */

  .tolky__chat-button .tolky__button-infos > img {
    display: block;
    max-width: 201px;
    max-height: 201px;
  }

  .tolky__chat-button .tolky__widget-icon > img {
    display: block;
    max-width: 79px;
    max-height: 78px;
  }

  /* Botão MiniChat Mobile */

  .tolky__mobile.tolky__chat-button {
    margin: 0 auto;
    cursor: pointer;
  }

  .tolky__mobile.tolky__chat-button:not(.with-banner-image) {
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.15));
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0px 0px 14px rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 12px 12.35px 14px 17px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .tolky__mobile.tolky__chat-button.with-banner-image .tolky__button-infos {
    grid-row: 1;
    grid-column: 1 / -1;
  }

  .tolky__mobile.tolky__chat-button.with-banner-image .tolky__widget-icon {
    grid-row: 1;
    grid-column: 2;
  }

  .tolky__mobile.tolky__chat-button .tolky__slash {
    filter: none;
  }

  .tolky__mobile.tolky__chat-button .tolky__icon {
    margin-top: -22px;
  }

  .tolky__mobile .tolky__url {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    line-height: 120%;
    color: #6f8af6;
    margin-bottom: 1px;
  }

  .tolky__mobile .tolky__url-base {
    padding-right: 0.15px;
    opacity: 0.5;
  }

  .tolky__mobile .tolky__url-host {
    padding-left: 0.73px;
  }

  .tolky__mobile .tolky__button-text {
    margin: 0;
    font-weight: 600;
    font-size: 18px;
    line-height: 110%;
    color: #2c5188;
  }

  /* Botão MiniChat Desktop */

  .tolky__desktop.tolky__chat-button {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
  }

  .tolky__desktop .tolky__button-emoji {
    font-weight: 600;
    font-size: 28.0755px;
    line-height: 110%;
  }

  .tolky__desktop .tolky__button-text {
    font-weight: 600;
    font-size: 14px;
    line-height: 110%;
    color: #2c5188;
    max-width: 60px;
  }

  .tolky__desktop .tolky__widget-icon {
    cursor: pointer;
    position: absolute;
    bottom: 0;
    right: 0;
  }

  /* Comportamento após ter interação */

  .tolky__tolky-chat.tolky__interacted {
    width: 100%;
  }

  @media (min-width: 768px) {
    .tolky__tolky-chat.tolky__interacted {
      width: 0px;
      transition: width 500ms ease;
    }
  }

  .tolky__desktop.tolky__chat-button.tolky__interacted .tolky__button-infos {
    width: 0px;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 500ms ease;
  }

  /* Comportamento após ter interação : Hover */

  .tolky__desktop.tolky__chat-button.tolky__interacted:hover {
    width: max-content;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: all 500ms ease;
  }

  .tolky__desktop.tolky__chat-button.tolky__interacted:hover .tolky__button-infos {
    width: 100%;
    opacity: 1;
    visibility: visible;
  }

  .tolky__desktop.tolky__chat-button .tolky__widget-icon {
    transition: opacity 500ms ease;
  }

  .tolky__desktop.tolky__chat-button:not(.tolky__interacted)
    .tolky__widget-icon.for-closed-banner {
    opacity: 0;
  }

  .tolky__desktop.tolky__chat-button.with-both-icons.tolky__interacted
    .tolky__widget-icon.for-open-banner {
    opacity: 0;
  }

  .tolky__desktop.tolky__chat-button.tolky__interacted
    .tolky__widget-icon.for-closed-banner {
    opacity: 1;
  }

  .tolky__desktop.tolky__chat-button.with-both-icons.tolky__interacted:hover
    .tolky__widget-icon.for-open-banner {
    opacity: 1;
  }

  .tolky__desktop.tolky__chat-button.tolky__interacted:hover
    .tolky__widget-icon.for-closed-banner {
    opacity: 0;
  }

  /* MiniChat Conversa */

  .tolky__chat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 530px;
    transition: height 1000ms cubic-bezier(0.25, 0.75, 0.05, 1.1),
      opacity 1000ms ease-out;

    opacity: 1;
  }

  @media (min-width: 768px) {
    .tolky__chat {
      width: 375px;
      height: 667px;
      background: #002b3e;
      border-radius: 15px;
    }
  }

  .tolky__chat.tolky__hide {
    height: 0;
    opacity: 0;
    transform: translateY(116px);
    border-radius: 15px;
    background: #002b3e;
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.06),
      0px 1px 3px 0px rgba(0, 0, 0, 0.1);
    transition: height 800ms cubic-bezier(0.25, 0.75, 0.05, 1),
      opacity 1000ms cubic-bezier(0.25, 0.75, 0.05, 1.1);
  }

  /* MiniChat Header */

  .tolky__chat .tolky__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    z-index: 10;
    width: 100%;
    padding: 24px;
  }

  .tolky__chat .tolky__header .tolky__close {
    width: 34px;
    height: 34px;
    background-image: url("/images/close.svg");
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: all 200ms ease-out;
    background-color: #002b3e;
    border-radius: 50%;
  }

  .tolky__chat .tolky__header .tolky__close:hover {
    background-image: url("/images/close-active.svg");
    background-color: #ffffff;
  }

  /* Informações do Avatar */

  .tolky__avatar-infos {
    position: relative;
  }

  .tolky__avatar-infos {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
    position: relative;
    padding: 0 24px 16px;
  }

  .tolky__avatar-slug {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    opacity: 1;
    visibility: visible;
    z-index: 1;
    gap: 1.73px;
    margin-bottom: 1px;
  }

  .tolky__avatar-slug.tolky__avatar-chat-active {
    display: none;
  }

  .tolky__avatar-title {
    color: #fff;
    font-size: 30px;
    font-weight: 600;
    line-height: 110%;
    margin: 0 0 6px;
    text-transform: capitalize;
  }

  .tolky__avatar-url {
    color: #fff;
    text-shadow: 0px 1px 2px rgba(0, 43, 62, 0.6);
    font-size: 14px;
    font-weight: 500;
    line-height: 120%;
    opacity: 0.5;
  }

  .tolky__avatar-image {
    position: absolute;
    display: block;
    width: 100%;
    height: 100vw;
    transition: height 0.3s ease, width 0.3s ease;
  }

  @media screen and (min-width: 768px) {
    .tolky__avatar-image {
      height: 375px;
      width: 375px;
    }
  }

  .tolky__avatar-bg {
    display: block;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-top-right-radius: 15px;
    border-top-left-radius: 15px;
  }

  .tolky__avatar-gradient {
    width: 100%;
    height: 100vw;
    left: 0px;
    top: 0px;
    position: absolute;
    background: linear-gradient(180deg, rgba(0, 43, 62, 0) 50.52%, #002b3e 100%);
    transition: height 0.3s ease, width 0.3s ease;
  }

  @media screen and (min-width: 768px) {
    .tolky__avatar-gradient {
      height: 375px;
      width: 375px;
    }
  }

  .tolky__avatar-host {
    color: #fff;
    text-shadow: 0px 1px 2px rgba(0, 43, 62, 0.6);
    font-size: 14px;
    font-weight: 500;
    line-height: 120%;
    margin-left: -2px;
  }

  .tolky__avatar-interests-tags {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
  }

  .tolky__avatar-interests-tag {
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    padding: 3px 8px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 12px;
    font-weight: 500;
    line-height: 120%;
    text-transform: capitalize;
  }

  /* Mensagens */

  .tolky__chat-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 20px;
    margin: 1px 15px 14px;
    overflow-y: auto;
  }

  .tolky__messages {
    padding: 14px 14px 0;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
    border-radius: 20px;
    margin: auto 0 0;
  }

  .tolky__chat .tolky__input-message form textarea {
    width: 100%;
    border: none;
    outline: none;

    height: 20px;
    overflow: auto;
    overflow-y: auto;
    resize: none;
    min-height: 38px;
    max-height: 300px;
    padding: 11.5px 34px 11.5px 0;
    scrollbar-width: none;
    background: none;

    color: #002b3e;
    font-family: "Georama";
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 120%;

    max-height: 81px;
    caret-color: #bba6f2;
  }

  .tolky__chat .tolky__input-message form textarea::placeholder {
    color: #80959e;
  }

  .tolky__chat .tolky__input-message {
    padding: 14px;
  }

  .tolky__input-cursor {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 11.2rem;
    width: 12px;
    height: 20px;
    background-color: #bba6f2;
    border-radius: 1px;
    animation: tolky__cursorAnimation 1s infinite;
  }

  .tolky__chat .tolky__input-message form {
    height: 100%;
    width: 100%;
    display: flex;
    padding: 0 16px;
    position: relative;
    border-radius: 74px;
    border: 1px solid #b3bfc5;
    background: #fff;
  }

  .tolky__chat .tolky__input-message form button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 43px;
    height: calc(100% - 6px);
    flex-shrink: 0;
    border-radius: 15.832px;
    background-color: #e7ebfd;
    position: absolute;
    right: 3px;
    top: 3px;
    transition: all 0.3s ease-in-out;
    border: none;
    cursor: pointer;
    padding: 0;
  }

  /* Mudanças de Layout após a conversa ser iniciada */

  .tolky__dialogue-started .tolky__avatar-image {
    height: 80px;
    width: 80px;
    min-height: 80px;
    min-width: 80px;
  }

  .tolky__dialogue-started .tolky__avatar-gradient {
    height: 80px;
    width: 80px;
    min-height: 80px;
    min-width: 80px;
  }

  .tolky__dialogue-started .tolky__header svg,
  .tolky__dialogue-started .tolky__avatar-slug,
  .tolky__dialogue-started .tolky__header img,
  .tolky__dialogue-started .tolky__avatar-interests-tags {
    display: none;
  }

  .tolky__dialogue-started .tolky__avatar-container {
    display: flex;
    flex-direction: row;
  }

  .tolky__square {
    aspect-ratio: 1;
  }
  .tolky__dialogue-started .tolky__avatar-image {
    position: relative;
  }

  .tolky__dialogue-started .tolky__avatar-slug.tolky__avatar-chat-active {
    display: flex;
    gap: 0;
  }

  .tolky__dialogue-started .tolky__avatar-slug.tolky__avatar-chat-active .tolky__slash {
    margin-right: 2px;
  }

  .tolky__dialogue-started .tolky__avatar-infos {
    height: auto;
    padding: 0 14px;
    justify-content: center;
  }

  .tolky__dialogue-started .tolky__chat .tolky__header {
    justify-content: end;
    width: auto;
    right: 0;
  }

  .tolky__dialogue-started .tolky__chat .tolky__header .tolky__close {
    background-image: url("/images/close-active.svg");
    background-color: #ffffff;
  }

  .tolky__dialogue-started .tolky__avatar-title {
    font-weight: 600;
    font-size: 20px;
    line-height: 120%;
    color: #ffffff;
    margin-bottom: 0;
  }

  .tolky__dialogue-started .tolky__avatar-bg {
    border-top-right-radius: 0;
  }

  @media screen and (max-width: 767px) {
    .tolky__opened.tolky__tolky-chat {
      height: 100%;
      padding-bottom: 0;
    }

    .tolky__opened.tolky__tolky-chat .tolky__card {
      z-index: 9999;
      height: 100%;
      margin: 0;
      border-radius: 0;
      background: #002b3e;
      transition: all 0.3s ease-in-out;
    }

    .tolky__opened .tolky__avatar-bg {
      border-radius: 0;
    }

    .tolky__opened .tolky__mobile.tolky__chat-button {
      display: none !important;
      transform: translateY(90px);
    }
  }
}
