@use './tokens' as blog;

html {
  min-width: 320px;
  background: transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--argon-page, rgb(40, 38, 42));
}

* {
  box-sizing: border-box;
}

html.darkmode body.wp-theme-argon::before {
  position: fixed;
  inset: 0;
  z-index: 999999999;
  pointer-events: none;
  content: '';
  background: rgba(0, 0, 0, 0.2);
  transition: var(--kt-blog-motion-background-ease, background 0.3s ease);
}

html.filter-sunset {
  filter: sepia(30%);
}

html.filter-grayscale {
  filter: grayscale(1);
}

html.filter-darkness .kt-blog__primary::after {
  position: fixed;
  inset: 0;
  z-index: 999999999;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  content: '';
  background: rgba(0, 0, 0, 0.4);
}

@include blog.block {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--argon-text);
  background: var(--argon-page);
  font-family: var(--argon-font-family);
  font-size: 16px;

  &::before,
  &::after {
    content: '';
    display: none;
  }

  &__content::before,
  &__content::after {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    content: '';
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
    transition: var(--kt-blog-motion-background-image-opacity, opacity 0.5s ease);
  }

  &__content::before {
    background-image: var(--argon-background-light-image, var(--argon-background-image));
    filter: var(--argon-background-filter, none);
    opacity: 0;
  }

  &__content::after {
    background-image: var(--argon-background-dark-image, var(--argon-background-image));
    opacity: var(--argon-background-opacity, 1);
  }

  &--light &__content::before {
    filter: none;
    opacity: var(--argon-background-light-opacity, 1);
  }

  &--light &__content::after {
    opacity: 0;
  }

  &--no-banner &__content::before,
  &--no-banner &__content::after {
    background: var(--argon-page);
  }

  &--shadow-big &__card {
    box-shadow:
      0 15px 35px rgba(50, 50, 93, 0.1),
      0 5px 15px rgba(0, 0, 0, 0.07);
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  img {
    display: block;
    max-width: 100%;
  }

  button,
  input,
  textarea {
    font: inherit;
  }

  &__card {
    position: relative;
    border: 0;
    border-radius: var(--card-radius);
    background: var(--argon-card);
    animation: kt-blog-card-show 0.25s ease-out;
    box-shadow: var(--argon-shadow);
    transform-origin: center top;

    .kt-blog__card {
      animation: none;
    }
  }

  &__card:not(.border-0) {
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  &__card-body {
    padding: 0;
  }

  &__card--gradient-secondary {
    background: var(--argon-card-deep);
  }

  &__card--large-shadow {
    box-shadow: 0 18px 45px rgba(15, 13, 18, 0.16);
  }

  &__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--card-radius);
    cursor: pointer;
    box-shadow: none;

    &:hover,
    &:focus {
      color: #fff;
    }
  }

  &__button--primary,
  &__button--secondary {
    color: #fff;
    background: var(--themecolor);
  }

  &__button--outline-primary {
    color: var(--themecolor);
    border: 1px solid var(--themecolor);
    background: transparent;

    &:hover,
    &:focus {
      color: #fff;
      background: var(--themecolor);
    }
  }

  &__button--success {
    color: #fff;
    background: #2dce89;
  }

  &__button--warning {
    color: #fff;
    background: #fb6340;
  }

  &__button--default,
  &__button--neutral {
    color: var(--argon-text);
    background: var(--argon-control-soft);
  }

  &__button--icon {
    width: 38px;
    height: 38px;
  }

  &__button--small {
    min-height: 32px;
    padding: 0 12px;
  }

  &__button--block {
    width: 100%;
  }

  &__button-icon-inner {
    display: inline-flex;
  }

  &__tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 10px;
    border-radius: var(--card-radius);
    font-size: 13px;
    line-height: 1.2;
  }

  &__tag--secondary {
    color: var(--argon-text);
    background: var(--argon-pill);
  }

  &__hidden {
    display: none !important;
  }

  &__input-group {
    display: flex;
    min-height: 36px;
    align-items: center;
    overflow: hidden;
    border-radius: var(--card-radius);
    background: var(--argon-control-soft);
  }

  &__input-group--spaced {
    margin-bottom: 1.5rem;
  }

  &__input-addon {
    display: inline-flex;
    padding: 0 10px;
    color: var(--argon-muted);
  }

  &__input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--argon-text);
    background: transparent;

    &::placeholder {
      color: var(--argon-placeholder);
    }
  }

  &__form-group--spaced {
    margin-bottom: 1rem;
  }

  &__live2d-widget {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: 280px;
    font-size: 0;
    pointer-events: none;

    &:hover .waifu-tool {
      opacity: 1;
      transform: translateX(0);
    }

    .waifu-tips {
      position: absolute;
      bottom: 246px;
      left: 20px;
      z-index: 21;
      width: 250px;
      min-height: 70px;
      padding: 5px 10px;
      border: 1px solid rgba(224, 186, 140, 0.62);
      border-radius: 12px;
      opacity: 0;
      color: #32373c;
      background: rgba(236, 217, 188, 0.5);
      box-shadow: 0 3px 15px 2px rgba(191, 158, 118, 0.2);
      font-size: 14px;
      line-height: 1.6;
      pointer-events: none;
      transform: translateY(8px);
      transition:
        opacity 0.5s ease,
        transform 0.5s ease;
    }

    .waifu-tips.show {
      opacity: 1;
      transform: translateY(0);
    }

    .waifu-tool {
      position: absolute;
      right: 10px;
      bottom: 54px;
      z-index: 22;
      display: flex;
      flex-flow: column;
      gap: 6px;
      opacity: 0;
      color: #5b6c7d;
      font-size: 16px;
      pointer-events: auto;
      transform: translateX(8px);
      transition:
        opacity 0.3s linear,
        transform 0.3s ease;
    }

    .waifu-tool span {
      display: block;
      width: 20px;
      height: 20px;
      cursor: pointer;
      line-height: 20px;
      text-align: center;
      transition:
        color 0.2s ease,
        transform 0.2s ease;

      &:hover,
      &:focus {
        color: #34495e;
        outline: 0;
        transform: scale(1.12);
      }

      &::before {
        font-family: 'Font Awesome 7 Free';
        font-weight: 900;
      }
    }

    .fui-home::before {
      content: '\f015';
    }

    .fui-chat::before {
      content: '\f075';
    }

    .fui-bot::before {
      content: '\f544';
    }

    .fui-eye::before {
      content: '\f06e';
    }

    .fui-user::before {
      content: '\f007';
    }

    .fui-photo::before {
      content: '\f030';
    }

    .fui-info-circle::before {
      content: '\f05a';
    }

    .fui-cross::before {
      content: '\f00d';
    }

    .gptInput {
      position: fixed;
      bottom: 0;
      left: 0;
      z-index: 23;
      display: flex !important;
      width: 300px;
      gap: 6px;
      padding: 8px;
      opacity: 0;
      pointer-events: none;
      transform: translateY(100%);
      transition:
        opacity 0.3s linear,
        transform 0.3s ease;
    }

    .gptInput.show {
      opacity: 0.8;
      pointer-events: auto;
      transform: translateY(-6px);
    }

    .gptInput input,
    .gptInput button {
      height: 30px;
      border: 1px solid rgba(224, 186, 140, 0.62);
      border-radius: 6px;
      color: #32373c;
      background: rgba(236, 217, 188, 0.88);
      font-size: 13px;
      line-height: 30px;
      outline: 0;
      box-shadow: 0 3px 15px 2px rgba(191, 158, 118, 0.18);
    }

    .gptInput input {
      min-width: 0;
      flex: 1;
      padding: 0 8px;
    }

    .gptInput button {
      flex: none;
      padding: 0 10px;
      cursor: pointer;
    }
  }

  &__live2d-canvas {
    position: relative;
    width: 280px;
    height: 250px;
    pointer-events: auto;
    transform-origin: 50% 82%;
    will-change: transform;
  }

}

@media (max-width: 768px) {
  @include blog.block {
    &__live2d-widget {
      display: none;
    }
  }
}

@keyframes kt-blog-card-show {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}
