$primary-blue: rgb(0, 117, 255);
$primary-blue-60: rgba(0, 117, 255, 0.60);
$primary-blue-50: rgba(0, 117, 255, 0.50);
$primary-blue-20: rgba(0, 117, 255, 0.20);
$primary-blue-10: rgba(0, 117, 255, 0.10);
$primary-blue-7: rgba(0, 117, 255, 0.07);
$primary-blue-2: rgba(0, 117, 255, 0.02);
$primary-dark: rgb(16, 38, 64);
$primary-dark-50: rgba(16, 38, 64, 0.5);
$primary-dark-30: rgba(16, 38, 64, 0.3);
$primary-dark-15: rgba(16, 38, 64, 0.15);
$primary-dark-10: rgba(16, 38, 64, 0.10);
$primary-dark-5: rgba(16, 38, 64, 0.05);
$error-red: rgb(233, 31, 79);
$error-red-50: rgba(233, 31, 79, 0.5);
$error-red-10: rgba(233, 31, 79, 0.10);
$secondary-purple: rgb(108, 25, 173);
$alert-yellow-50: rgba(255, 238, 88, 0.50);
$alert-yellow: rgb(255, 238, 88);
$benchmark-orange: rgb(245, 129, 21);
$benchmark-orange-50: rgba(245, 129, 21, 0.50);
$benchmark-orange-25: rgba(245, 129, 21, 0.25);
$action-green: rgb(158, 206, 56);
$action-green-50: rgba(158, 206, 56, 0.5);
$box-shadow: 5px 5px 30px 0 rgba(24, 45, 70, 0.15);
$background-color: #F6F9FB;
$admin-bar-height: 32px;
$holler-yellow: rgb(232, 173, 11);

#hollerbox-popup-content{
  display: none !important;
}

body {
  &.holler-box-blurred {
    filter: blur(4px);
  }

  &.holler-suppress-animations {
    .holler-box-overlay,
    .holler-box .animation {
      animation: none !important;
    }
  }

  &.holler-slide-down {
    animation-duration: 0.3s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
  }

  &.disable-scrolling {
    overflow: hidden;
  }
}

body:not(.wp-admin) {

  .holler-box {
    position: fixed;
  }

  &.admin-bar {
    .positioner {
      &.top {
        &-left {
          top: calc(20px + #{$admin-bar-height});
        }

        &-center {
          top: calc(20px + #{$admin-bar-height});
        }

        &-right {
          top: calc(20px + #{$admin-bar-height});
        }
      }
    }

    .holler-box.holler-sidebar .positioner,
    .holler-box.holler-banner .positioner.top-left {
      top: $admin-bar-height !important;
    }
  }
}

@keyframes progress-bar-stripes {
  from {
    background-position: 0 40px;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes holler-rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes holler-overlay-appear {
  from {
    opacity: 0;
  }
}

@keyframes holler-appear {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  75% {
    opacity: 1;
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes holler-disappear {
  to {
    transform: scale(0.8);
    opacity: 0;
  }
}

@keyframes holler-slide-in-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes holler-slide-in-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes holler-slide-in-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes holler-slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}


@keyframes holler-slide-out-up {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}


@keyframes holler-slide-out-down {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(100%);
  }
}

@keyframes holler-slide-out-right {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}


@keyframes holler-slide-out-left {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(-100%);
  }
}

.holler-box {
  z-index: 1000;

  .hollerbox-integration-errors{
    background: #FFFFFF;
    color: $error-red;
    padding: 20px;
    font-size: 16px;

    p:first-child {
      margin-top: 0;
    }

    p:last-child {
      margin-bottom: 0;
    }
  }

  &.no-animation {
    .holler-box-overlay,
    .holler-box-overlay::before,
    .holler-box-overlay::after,
    .animation {
      animation: none !important;
    }
  }

  .animation {
    animation-duration: 0.3s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;

    &.appear {
      animation-name: holler-appear;
    }
  }

  .positioner {

    position: fixed;

    &.top {

      top: 20px;
      left: 20px;

      .slide-in {
        animation-name: holler-slide-in-down;
      }

      .slide-out {
        animation-name: holler-slide-out-up;
      }

      &-left {
        top: 20px;
        left: 20px;

        .slide-in {
          animation-name: holler-slide-in-down;
        }

        .slide-out {
          animation-name: holler-slide-out-up;
        }
      }

      &-center {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);

        .slide-in {
          animation-name: holler-slide-in-down;
        }

        .slide-out {
          animation-name: holler-slide-out-up;
        }
      }

      &-right {
        top: 20px;
        right: 20px;

        .slide-in {
          animation-name: holler-slide-in-down;
        }

        .slide-out {
          animation-name: holler-slide-out-up;
        }
      }

    }

    &.center {

      &-left {
        left: 20px;
        top: 50%;
        transform: translateY(-50%);

        .slide-in {
          animation-name: holler-slide-in-left;
        }

        .slide-out {
          animation-name: holler-slide-out-left;
        }
      }

      &-center {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);

        .slide-in {
          animation-name: holler-appear;
        }

        .slide-out {
          animation-name: holler-disappear;
        }
      }

      &-right {
        right: 20px;
        top: 50%;
        transform: translateY(-50%);

        .slide-in {
          animation-name: holler-slide-in-right;
        }

        .slide-out {
          animation-name: holler-slide-out-right;
        }

      }

    }

    &.bottom {

      bottom: 20px;
      left: 20px;

      .slide-in {
        animation-name: holler-slide-in-up;
      }

      .slide-out {
        animation-name: holler-slide-out-down;
      }

      &-left {
        bottom: 20px;
        left: 20px;

        .slide-in {
          animation-name: holler-slide-in-up;
        }

        .slide-out {
          animation-name: holler-slide-out-down;
        }
      }

      &-center {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);

        .slide-in {
          animation-name: holler-slide-in-up;
        }

        .slide-out {
          animation-name: holler-slide-out-down;
        }
      }

      &-right {
        bottom: 20px;
        right: 20px;

        .slide-in {
          animation-name: holler-slide-in-up;
        }

        .slide-out {
          animation-name: holler-slide-out-down;
        }
      }
    }
  }

  .holler-box-credit {

    a {
      color: $holler-yellow;
      text-decoration: none;
      font-size: 16px;
    }

    margin-top: 10px;
    text-align: center;
  }

  .holler-box-overlay {

    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: transparent;
    opacity: 1;

    &::after {
      content: '';
      position: fixed;
      top: 0;
      right: 0;
      left: 0;
      bottom: 0;
      background-color: #333;
      opacity: 0.5;
    }

    animation: holler-overlay-appear 0.4s ease-in-out;

    &.no-animation {
      animation: none;
    }
  }

  .display-flex {
    display: flex;
    gap: 20px;
  }

  .holler-box-modal {

    min-width: 300px;
    width: min-content;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    padding: 30px;
    box-sizing: border-box;
    box-shadow: $box-shadow;

    &.notification-closed {
      cursor: pointer;
      box-sizing: border-box;
      width: 60px !important;
      height: 60px !important;
      border-radius: 50% !important;
      display: flex;
      align-items: center;
      justify-content: center;
      background: $primary-blue;
      box-shadow: $box-shadow;
      min-width: 0 !important;
      padding: 0 !important;

      svg {
        height: 30px;
        width: 30px;
      }
    }

    img {
      max-width: 100%;

      &.alignright {
        float: right;
      }

      &.alignleft{
        float: left;
      }

      &.aligncenter {
        margin: 0 auto;
        display: block;
      }

      &:not(.alignnone),
      &:not(.alignleft),
      &:not(.alignright){
        //display: block;
      }
    }

    .holler-box-modal-content {

      box-sizing: border-box;

      p, li, ul, ol {
        font-size: 18px;
      }

      h1 {
        font-size: 40px;
      }

      h2 {
        font-size: 32px;
      }

      h3 {
        font-size: 24px;
      }
    }

    button.holler-box-modal-close {
      cursor: pointer;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      border: none;
      position: absolute;
      top: 5px;
      right: 5px;
      height: 12px;
      width: 12px;
      background-color: transparent !important;
      background: none;
      color: $primary-dark;

      svg {
        height: 100%;
        width: 100%;
      }

      &.medium {
        top: 7px;
        right: 7px;
        height: 16px;
        width: 16px;
      }

      &.large {
        top: 9px;
        right: 9px;
        height: 22px;
        width: 22px;
      }

      &.filled{

        top: 0;
        right: 0;
        height: 18px;
        width: 18px;
        transform: translate(50%, -50%);

        &.icon-inside {
          top: 5px;
          right: 5px;
          transform: none;
        }

        &.medium {
          height: 24px;
          width: 24px;
        }

        &.large {
          height: 30px;
          width: 30px;
        }
      }
    }

  }

  &.holler-notification-box {

    .holler-box-credit {

      a {
        color: $holler-yellow;
        text-decoration: none;
        font-size: 14px;
      }

      margin-top: 10px;
      text-align: right;
    }

    &.with-chat {

      ::-webkit-scrollbar {
        width: 5px;
      }

      /* Track */
      ::-webkit-scrollbar-track {
        background: $primary-dark-5;
      }

      /* Handle */
      ::-webkit-scrollbar-thumb {
        background: $primary-dark-30;
        border-radius: 5px;
      }

      /* Handle on hover */
      ::-webkit-scrollbar-thumb:hover {
        background: $primary-dark-50;
      }

      .holler-box-modal {
        max-height: 600px;
        overflow-y: auto;
      }

      .close-chat-wrap {
        display: flex;
        justify-content: center;
        margin: 10px;

        button.close-chat {
          cursor: pointer;
          background: none;
          border: none;
          color: $primary-dark-30;
          font-weight: 500;
          font-size: 14px;
        }
      }

      .holler-box-chat-response {
        margin: 10px 0;
        display: flex;
        justify-content: flex-end;

        .content {
          padding: 10px;
          background: $primary-blue;
          color: #ffffff;
          border-radius: 5px;

          // font
          font-size: 16px;
          line-height: 1.3;
          margin: 0;

          // more font
          * {
            background: $primary-blue;
            color: #ffffff;
            font-size: 16px;
            line-height: 1.3;
            margin: 0;
          }
        }
      }

      .holler-box-chat-message {
        display: flex;
        gap: 10px;

        img.avatar {
          border-radius: 50%;
          height: 30px;
          width: 30px;
        }

        .content {

          display: flex;
          gap: 10px;
          flex-direction: column;
          align-items: flex-start;

          > * {
            padding: 10px;
            background: $primary-blue-7;
            border-radius: 5px;
            font-size: 16px;
            line-height: 1.3;
            margin: 0;
          }
        }
      }

      form.holler-chat-form {
        display: flex;
        align-items: stretch;
        width: 100%;
        margin-top: 15px;

        textarea,
        .holler-box-input {
          border-radius: 5px 0 0 5px;
          background: #ffffff;
          padding: 6px 16px;
          font-size: 14px;
          width: 100%;
          border: 1px solid $primary-dark-30;
          line-height: 2;
          min-height: 30px;
          box-sizing: border-box;
          max-height: 42px;

          &::placeholder {
            color: #cccccc;
          }

          &:-ms-input-placeholder {
            color: #cccccc;
          }

          min-width: 0;
        }

        button.send-message {

          cursor: pointer;
          border: none;
          background: $primary-blue;
          color: #ffffff;
          border-radius: 0 5px 5px 0;
          padding: 5px 10px;

          &:focus,
          &:hover {
            background: $primary-blue-60;
          }

          svg {
            height: 20px;
            width: 20px;
          }
        }
      }

    }

    &.with-button {
      .holler-button-cta {
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;

        .holler-box-button {
          border-radius: 5px;
          font-size: 18px;
        }
      }
    }

    &.with-form {

      form.holler-box-form {
        margin-top: 10px;

        .fields {
          gap: 0;
        }

        input[type=email] {
          width: 100%;
          background: $primary-dark-5;
          border: none;
          font-size: 16px;
          border-radius: 5px 0 0 5px;
        }

        button {
          border-radius: 0 5px 5px 0;
          font-size: 18px;
        }
      }

    }

    .holler-box-modal {
      width: 400px;
      padding: 20px 10px 10px 10px;
      box-shadow: $box-shadow;
      border-radius: 5px;

      .display-flex {
        align-items: flex-start;
        gap: 10px;
      }

      img {
        border-radius: 50%;
        width: 50px;
        height: 50px;
      }

      .holler-box-modal-content {
        width: 100%;
        padding: 20px;
        background-color: $primary-blue-7;
        border-radius: 5px;

        p {
          font-size: 16px;

          margin: 0.8em 0;
          line-height: 1.1;

          &:first-child {
            margin-top: 0;
          }

          &:last-child {
            margin-bottom: 0;
          }
        }
      }
    }
  }

  &.holler-popup-custom {
    .holler-box-modal-content{
      width: 400px;
    }
  }

  &.holler-popup-standard {
    .holler-box-modal-content{
      width: 400px;
    }
  }

  &.holler-popup-image-left {

    .holler-box-modal {
      padding: 0;

      .holler-box-modal-content{
        width: 330px;
      }
    }

    .display-flex {
      display: flex;
      align-items: stretch;
      gap: 0;

      .left {
        flex-shrink: 0;
        background-size: cover;
        background-position: center center;
        width: 300px;
      }

      .right {
        align-self: flex-start;
        padding: 30px;
      }
    }
  }

  &.holler-popup-image-right {

    .holler-box-modal {
      padding: 0;

      .holler-box-modal-content{
        width: 330px;
      }
    }

    .display-flex {
      display: flex;
      align-items: stretch;
      gap: 0;

      .right {
        flex-shrink: 0;
        background-size: cover;
        background-position: center center;
        width: 300px;
      }

      .left {
        align-self: flex-start;
        padding: 30px;
      }
    }
  }

  &.holler-popup-form-below {

    .holler-box-modal {
      padding: 0;

      .holler-box-modal-content{
        width: 330px;
      }
    }

    .display-flex {
      align-items: stretch;
      //justify-content: space-between;
      gap: 0;

      .left {
        padding: 30px;
      }

      .right {
        flex-shrink: 0;
        width: 300px;
        background-size: cover;
        background-position: center center;
      }
    }

    .holler-box-form {
      padding: 20px;
      background: $primary-blue-7;
    }

  }

  &.holler-popup-progress-bar {

    .holler-box-progress-bar-wrap {

      .holler-box-progress-bar {

        display: flex;
        overflow: hidden;
        background-color: #e9ecef;
        //border-radius: 3px 3px 0 0;

        .holler-box-progress-bar-fill {
          background-color: #337ab7;
          -webkit-box-shadow: inset 0 -1px 0 rgb(0 0 0 / 15%);
          box-shadow: inset 0 -1px 0 rgb(0 0 0 / 15%);
          -webkit-transition: width .6s ease;
          -o-transition: width .6s ease;
          transition: width .6s ease;

          background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
          background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
          background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
          -webkit-background-size: 40px 40px;
          background-size: 40px 40px;
          height: 20px;
          width: 50%;

          animation: progress-bar-stripes 1s linear infinite;

          &.filled {
            animation: none;
            width: 100% !important;
          }
        }
      }
    }

    .holler-box-modal {

      .holler-box-modal-content{
        width: 330px;
      }

      padding: 0;
      border-radius: 5px;
      overflow: hidden;

      button.holler-box-modal-close {
        top: 25px;
      }
    }

    .display-flex {
      display: flex;
      align-items: stretch;
      gap: 0;

      .left {
        flex-shrink: 0;
        background-size: cover;
        background-position: center center;
        width: 300px;
      }

      .right {
        align-self: flex-start;
        padding: 30px;
      }
    }

  }

  &.holler-popup-image-beside-text-top {

    .holler-box-modal {
      padding: 0;
    }

    .holler-box-modal-content {
      padding: 30px;
    }

    .display-flex {
      align-items: stretch;
      gap: 0;

      .left {
        flex-shrink: 0;
        background-size: cover;
        background-position: center center;
        width: 250px;
      }

      .holler-box-form {
        padding: 30px;
        min-width: 250px;
        background-color: $primary-blue-7;
      }
    }

  }

  &.holler-popup-full-image-background {

    .holler-box-modal {
      background-size: cover;
      background-position: center center;

      .holler-box-modal-content {
        width: 400px;
      }
    }

  }

  &.holler-popup-text-with-color-background {

  }

  input[type=submit].holler-box-button,
  input[type=button].holler-box-button,
  button.holler-box-button,
  button.holler-choice,
  button.holler-survey-next,
  {
    font-size: 20px;
    padding: 10px 16px;
    border-radius: 0;
    background: #2196F3;
    color: #ffffff;
    font-weight: bold;
    border: none;
    white-space: nowrap;
    cursor: pointer;

    &:disabled {
      opacity: 0.8;
    }

    .holler-spinner {
      display: block;
      margin: 0 auto;
      height: 15px;
      width: 15px;
      border: 5px solid rgba(255, 255, 255, 0.4);
      border-bottom-color: #ffffff;
      border-radius: 50%;
      position: relative;
      animation: holler-rotation 1s linear infinite;
    }

    &.inverse {
      background-color: transparent;
      color: rgb(33, 150, 243);
      border: 1px solid #2196F3;

      .holler-spinner {
        border: 5px solid rgba(33, 150, 243, 0.4);
        border-bottom-color: rgb(33, 150, 243);
      }
    }
  }

  form.holler-box-form {

    &.custom-form {
      display: flex;
      gap: 10px;
      flex-direction: column;
    }

    .fields {
      display: flex;
      gap: 10px;
      align-items: stretch;
    }

    &.vertical {

      .fields {
        display: grid;
        grid-auto-rows: 1fr;

        label.holler-gdpr-consent {
          align-self: center;
        }
      }
    }

    label.holler-gdpr-consent{
      display: flex;
      gap: 10px;
      align-items: flex-start;

      span {
        line-height: 1.1;
      }
    }

    &.horizontal {
      label.holler-gdpr-consent{
        margin-top: 10px;
      }
    }

    input.holler-box-input {
      border-radius: 0;
      background: #ffffff;
      padding: 6px 16px;
      font-size: 18px;
      width: 100%;
      border: 1px solid $primary-dark-30;
      line-height: 2;
      min-height: 30px;
      box-sizing: border-box;

      &::placeholder {
        color: #cccccc;
      }

      &:-ms-input-placeholder {
        color: #cccccc;
      }

      min-width: 0;
    }

  }

}

@media (max-width: 600px) {

  .holler-box.holler-popup {
    .holler-box-modal {
      width: calc( 100vw - 40px );
      max-height: calc( 100vw - 40px );
    }
  }

  .holler-box.holler-notification-box {
    .positioner {

      &:not(:has(.notification-closed)){
        left: 0;
        right: 0;
      }

      &.top-left,
      &.top-center,
      &.top-right {
        top: 0;
        transform: none;

        .notification-closed {
          margin-top: 10px;
        }
      }

      &.center-right,
      &.center-center,
      &.center-left,
      &.bottom-right,
      &.bottom-center,
      &.bottom-left {
        top: auto;
        bottom: 0;
        transform: none;

        .notification-closed {
          margin-bottom: 10px;
        }

      }

      &.top-center,
      &.center-center,
      &.bottom-center,
      &.top-left,
      &.center-left,
      &.bottom-left {
        left: 0;

        .notification-closed {
          margin-left: 10px;
        }
      }

      &.top-right,
      &.center-right,
      &.bottom-right {
        right: 0;

        .notification-closed {
          margin-left: auto;
          margin-right: 10px;
        }
      }

      .holler-box-modal {
        border-radius: 0;

        &:not(.notification-closed) {
          max-width: 100vw;
          width: auto;
        }

      }
    }
  }

  .holler-box:not(.holler-notification-box) {

    .holler-box-modal {

      .holler-box-modal-content {
        width: 100%;
      }

      overflow: auto !important;
      max-height: calc(100vh - 40px);

      .display-flex {
        flex-direction: column;

        > * {
          width: 100%;
          box-sizing: border-box;
        }

        .image-width {
          min-height: 300px;
          width: 100% !important;
        }
      }

      form.holler-box-form.horizontal {

        .fields {
          display: grid;
          grid-auto-rows: 1fr;
          width: 100%;
        }

        .holler-box-input {
          max-width: 100% !important;
        }
      }
    }

    &.holler-popup-form-below {

      .display-flex {
        flex-direction: column-reverse;
      }

    }
  }

}
