/*
 * GSP_LIVE_CHAT_WIDGET_UI_V1
 */

#gsp-live-chat-root,
#gsp-live-chat-root * {
  box-sizing: border-box;
}

#gsp-live-chat-root {
  --gsp-chat-text: #171a1c;
  --gsp-chat-muted: #747b80;
  --gsp-chat-border: rgba(23, 26, 28, .10);
  --gsp-chat-bg: #ffffff;
  --gsp-chat-soft: #f5f6f7;
  --gsp-chat-accent: #1f5eff;
  --gsp-chat-online: #58ad73;

  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}


/* -----------------------------------------------
 * Launcher
 * --------------------------------------------- */

.gsp-live-chat-launcher {
  display: flex;
  align-items: center;
  gap: 10px;

  min-height: 52px;

  padding: 8px 15px 8px 10px;

  border: 1px solid
    rgba(23, 26, 28, .09);

  border-radius: 18px;

  background:
    rgba(255, 255, 255, .96);

  color: var(--gsp-chat-text);

  box-shadow:
    0 14px 40px
      rgba(18, 25, 32, .13),
    0 2px 8px
      rgba(18, 25, 32, .05);

  cursor: pointer;

  -webkit-backdrop-filter:
    blur(16px);

  backdrop-filter:
    blur(16px);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
}

.gsp-live-chat-launcher:hover {
  transform:
    translateY(-2px);

  box-shadow:
    0 18px 46px
      rgba(18, 25, 32, .16),
    0 3px 10px
      rgba(18, 25, 32, .06);
}

.gsp-live-chat-launcher:active {
  transform:
    translateY(0);
}


.gsp-live-chat-launcher-icon {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;

  flex: 0 0 36px;

  border-radius: 13px;

  background:
    #171a1c;

  color: #fff;
}

.gsp-live-chat-launcher-icon svg {
  width: 19px;
  height: 19px;
}


.gsp-live-chat-presence {
  position: absolute;

  top: -2px;
  right: -2px;

  width: 10px;
  height: 10px;

  border: 2px solid #fff;

  border-radius: 50%;

  background:
    var(--gsp-chat-online);
}

.gsp-live-chat-presence::after {
  content: "";

  position: absolute;

  inset: -5px;

  border-radius: 50%;

  background:
    rgba(88, 173, 115, .22);

  animation:
    gspChatPresencePulse
    3.2s ease-in-out
    infinite;
}


@keyframes gspChatPresencePulse {

  0%,
  100% {
    transform:
      scale(.65);

    opacity:
      .18;
  }

  50% {
    transform:
      scale(1.18);

    opacity:
      .72;
  }
}


.gsp-live-chat-launcher-copy {
  display: grid;
  gap: 1px;

  min-width: 0;

  text-align: left;
}

.gsp-live-chat-launcher-title {
  font-size: 13px;
  line-height: 1.25;

  font-weight: 750;
}

.gsp-live-chat-launcher-subtitle {
  color:
    var(--gsp-chat-muted);

  font-size: 11px;
  line-height: 1.3;
}


/* -----------------------------------------------
 * Panel
 * --------------------------------------------- */

.gsp-live-chat-panel {
  position: absolute;

  right: 0;
  bottom: 0;

  display: flex;
  flex-direction: column;

  width: 370px;
  height: min(540px, calc(100vh - 44px));

  overflow: hidden;

  border: 1px solid
    var(--gsp-chat-border);

  border-radius: 22px;

  background:
    var(--gsp-chat-bg);

  box-shadow:
    0 26px 70px
      rgba(18, 25, 32, .18),
    0 4px 16px
      rgba(18, 25, 32, .07);

  opacity: 0;

  visibility: hidden;

  transform:
    translateY(14px)
    scale(.975);

  transform-origin:
    right bottom;

  pointer-events:
    none;

  transition:
    opacity .20s ease,
    transform .20s ease,
    visibility .20s ease;
}


#gsp-live-chat-root.is-open
.gsp-live-chat-panel {
  opacity: 1;

  visibility: visible;

  transform:
    translateY(0)
    scale(1);

  pointer-events:
    auto;
}


#gsp-live-chat-root.is-open
.gsp-live-chat-launcher {
  opacity: 0;

  visibility: hidden;

  pointer-events:
    none;
}


/* -----------------------------------------------
 * Header
 * --------------------------------------------- */

.gsp-live-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  min-height: 76px;

  padding:
    15px 15px 14px 18px;

  border-bottom:
    1px solid
    var(--gsp-chat-border);
}


.gsp-live-chat-header-person {
  display: flex;
  align-items: center;

  gap: 11px;

  min-width: 0;
}


.gsp-live-chat-avatar {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;

  flex: 0 0 40px;

  border-radius: 14px;

  background:
    #171a1c;

  color: #fff;

  font-size: 12px;
  font-weight: 800;

  letter-spacing:
    .02em;
}


.gsp-live-chat-avatar-dot {
  position: absolute;

  right: -1px;
  bottom: -1px;

  width: 10px;
  height: 10px;

  border: 2px solid #fff;

  border-radius: 50%;

  background:
    var(--gsp-chat-online);
}


.gsp-live-chat-header-copy {
  display: grid;
  gap: 2px;

  min-width: 0;
}


.gsp-live-chat-header-title {
  color:
    var(--gsp-chat-text);

  font-size: 14px;
  line-height: 1.25;

  font-weight: 800;
}


.gsp-live-chat-header-status {
  color:
    var(--gsp-chat-muted);

  font-size: 11px;
  line-height: 1.3;
}


.gsp-live-chat-close {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 34px;
  height: 34px;

  flex: 0 0 34px;

  padding: 0;

  border: 0;

  border-radius: 10px;

  background:
    transparent;

  color:
    #70777c;

  cursor:
    pointer;

  transition:
    background .15s ease,
    color .15s ease;
}


.gsp-live-chat-close:hover {
  background:
    var(--gsp-chat-soft);

  color:
    var(--gsp-chat-text);
}


.gsp-live-chat-close svg {
  width: 18px;
  height: 18px;
}


/* -----------------------------------------------
 * Body
 * --------------------------------------------- */

/*
 * GSP_LIVE_CHAT_BOTTOM_MESSAGES_V1
 *
 * Short conversations grow from the bottom,
 * like in standard messengers.
 */
.gsp-live-chat-body {
  display: flex;
  flex-direction: column;

  flex: 1;

  overflow-y: auto;

  padding:
    22px 18px;

  background:
    linear-gradient(
      180deg,
      #fafbfb 0%,
      #ffffff 34%
    );
}


.gsp-live-chat-day {
  margin-top:
    auto;

  margin-bottom:
    18px;

  color:
    #989ea2;

  font-size: 10px;
  line-height: 1;

  text-align:
    center;
}


.gsp-live-chat-message {
  display: flex;

  margin-bottom:
    12px;
}


.gsp-live-chat-message.is-staff {
  justify-content:
    flex-start;
}


.gsp-live-chat-message.is-client {
  justify-content:
    flex-end;
}


.gsp-live-chat-bubble {
  max-width:
    82%;

  padding:
    11px 13px;

  border-radius:
    15px;

  font-size:
    13px;

  line-height:
    1.45;
}


.gsp-live-chat-message.is-staff
.gsp-live-chat-bubble {
  border:
    1px solid
    #e7e9ea;

  border-bottom-left-radius:
    5px;

  background:
    #fff;

  color:
    var(--gsp-chat-text);
}


.gsp-live-chat-message.is-client
.gsp-live-chat-bubble {
  border-bottom-right-radius:
    5px;

  background:
    #171a1c;

  color:
    #fff;
}


.gsp-live-chat-placeholder {
  padding-top:
    6px;

  color:
    #8b9297;

  font-size:
    12px;

  line-height:
    1.55;
}


/* -----------------------------------------------
 * Composer
 * --------------------------------------------- */

.gsp-live-chat-composer {
  display: flex;
  align-items: flex-end;

  gap: 8px;

  padding:
    12px;

  border-top:
    1px solid
    var(--gsp-chat-border);

  background:
    #fff;
}


.gsp-live-chat-input {
  display: block;

  flex: 1;

  min-width: 0;
  min-height: 42px;
  max-height: 110px;

  resize: none;

  padding:
    11px 12px;

  border:
    1px solid
    #d8dddf;

  border-radius:
    13px;

  outline:
    none;

  background:
    #fff;

  color:
    var(--gsp-chat-text);

  font: inherit;

  font-size:
    13px;

  line-height:
    1.4;

  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}


.gsp-live-chat-input:focus {
  border-color:
    #8fa9ff;

  box-shadow:
    0 0 0 3px
    rgba(31, 94, 255, .08);
}


.gsp-live-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;

  flex: 0 0 42px;

  padding: 0;

  border: 0;

  border-radius:
    13px;

  background:
    #171a1c;

  color:
    #fff;

  cursor:
    pointer;

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


.gsp-live-chat-send:hover {
  transform:
    translateY(-1px);
}


.gsp-live-chat-send:disabled {
  opacity:
    .35;

  cursor:
    default;

  transform:
    none;
}


.gsp-live-chat-send svg {
  width: 18px;
  height: 18px;
}


/* -----------------------------------------------
 * Mobile
 * --------------------------------------------- */

/*
 * GSP_LIVE_CHAT_MOBILE_NAV_FIX_V1
 *
 * Keep launcher and panel above mobile bottom navigation.
 */
@media
(max-width: 640px) {

  #gsp-live-chat-root {
    right: 14px;

    bottom:
      calc(
        78px +
        env(safe-area-inset-bottom, 0px)
      );
  }


  .gsp-live-chat-launcher {
    width: 52px;
    height: 52px;

    min-height: 52px;

    padding: 8px;

    border-radius: 17px;
  }


  .gsp-live-chat-launcher-icon {
    width: 34px;
    height: 34px;

    flex-basis: 34px;
  }


  .gsp-live-chat-launcher-copy {
    display: none;
  }


  .gsp-live-chat-panel {
    position: fixed;

    right: 10px;

    bottom:
      calc(
        78px +
        env(safe-area-inset-bottom, 0px)
      );

    width:
      calc(100vw - 20px);

    height:
      min(
        70vh,
        560px
      );

    max-height:
      calc(
        100dvh -
        100px -
        env(safe-area-inset-bottom, 0px)
      );

    min-height:
      min(
        420px,
        calc(
          100dvh -
          100px -
          env(safe-area-inset-bottom, 0px)
        )
      );

    border-radius:
      20px;

    transform-origin:
      right bottom;
  }


  .gsp-live-chat-header {
    min-height:
      68px;

    padding:
      12px 12px 11px 14px;
  }


  .gsp-live-chat-body {
    padding:
      18px 14px;
  }


  .gsp-live-chat-composer {
    padding:
      10px;
  }
}


/* -----------------------------------------------
 * Reduced motion
 * --------------------------------------------- */

@media
(prefers-reduced-motion: reduce) {

  .gsp-live-chat-presence::after {
    animation: none;
  }

  .gsp-live-chat-launcher,
  .gsp-live-chat-panel {
    transition: none;
  }
}


/*
 * GSP_LIVE_CHAT_PRESENCE_STYLE_V1
 *
 * Real operator presence.
 */

#gsp-live-chat-root.is-offline
.gsp-live-chat-presence,
#gsp-live-chat-root.is-offline
.gsp-live-chat-avatar-dot {
  background:
    #a8afb9 !important;

  box-shadow:
    0 0 0 3px
    rgba(
      168,
      175,
      185,
      .15
    ) !important;

  animation:
    none !important;
}


#gsp-live-chat-root.is-offline
.gsp-live-chat-launcher-subtitle {
  color:
    #7f8792 !important;
}


#gsp-live-chat-root.is-online
.gsp-live-chat-presence,
#gsp-live-chat-root.is-online
.gsp-live-chat-avatar-dot {
  background:
    var(
      --gsp-chat-online,
      #58ad73
    ) !important;
}

