@import './font.scss';
@import './icons.scss';
@import './vars.scss';

.q-params {
  --q-params-gap: 2em;
  display: inline-flex;
  align-items: center;
  & > * {
    &:not(:last-child) {
      margin-right: 0.5em;
    }
  }
  &.top-right {
    position: absolute;
    right: var(--q-params-gap);
    top: var(--q-params-gap);
  }
  &.top-left {
    position: absolute;
    left: var(--q-params-gap);
    top: var(--q-params-gap);
  }
}
.q-overlay {
  background: rgba(var(--q-color), 0.5);
  height: 100vh !important;
}

.q-text-editor {
  .buttons-wrapper {
    height: auto;
    width: 0;
    .editor-buttons {
      background: rgba(255, 255, 255, 1);
      color: rgba(var(--q-color), 1);
      display: inline-flex;
      border-radius: 3px;
      padding: 3px;
      box-shadow: var(--q-wow-shadow);
      margin-bottom: 2px;
      &:last-child {
        margin-bottom: 0;
      }
    }
  }
  .editor-button {
    width: 27px;
    height: 27px;
    border-radius: inherit;
    font-family: inherit;
    font-weight: 600;
    background: none;
    color: inherit;
    cursor: pointer;
    transition: 0.4s;
    margin-right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(var(--q-color), 1) !important;
    text-decoration: none !important;
    i {
      font-size: 18px !important;
    }
    &:last-child {
      margin-right: 0;
    }
    &:hover {
      background: rgba(0, 0, 0, 0.05);
      color: rgba(var(--q-main), 1);
    }
    &.active {
      background: rgba(var(--q-blue), 1);
      color: #fff !important;
    }
  }
}

.editor__content {
  .ProseMirror {
    min-width: 2px;
    ::selection {
      background: rgba(var(--q-main), 1);
      color: #fff;
    }
  }
}

.material-icons-new {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-size: contain;
}

.icon-white {
  -webkit-filter: contrast(4) invert(1);
  -moz-filter: contrast(4) invert(1);
  -o-filter: contrast(4) invert(1);
  -ms-filter: contrast(4) invert(1);
  filter: contrast(4) invert(1);
}

.abs {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}
.no-scroll {
  overflow: hidden;
}

.kolbins-title,
.kolbins-h1 {
  font-size: 2em;
  font-family: var(--q-font);
  font-weight: 700;
  margin-bottom: 0.7em;
}
.kolbins-small-title {
  font-size: 1.3em;
  font-family: var(--q-font);
  font-weight: 500;
  margin-bottom: 0.7em;
  opacity: 0.9;
}
.kolbins-subtitle {
  font-size: 0.85em;
  font-weight: 500;
  color: $secondary;
  margin-bottom: 1em;
  font-family: var(--q-font);
}
.kolbins-link {
  font-size: 0.875em;
  font-weight: 600;
  color: $blue;
  cursor: pointer;
  &:hover {
    text-decoration: underline;
  }
}
.kolbins-h2 {
  font-size: 1.5em;
  font-family: var(--q-font);
  font-weight: 600;
  margin-bottom: 0.7em;
}
.kolbins-grid {
  display: grid;
  grid-gap: 30px;
}
.columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.kolbins-block {
  div {
    & > input[type='checkbox'],
    & > input[type='radio'] {
      & + label {
        margin-bottom: 1em;
      }
    }
  }
  select {
    font-family: var(--q-font);
    font-size: 1em;
    display: block;
    height: 3.5em;
    width: 100%;
    margin-bottom: 1.5em;
    background: rgba(var(--q-background), 1);
    border-radius: var(--q-small-border-radius);
    padding: 0 0.7em;
  }
}
.kolbins-block label,
.kolbins-input label {
  font-family: var(--q-font);
  font-size: var(--q-xs-text);
  display: block;
  font-weight: 600;
  margin-bottom: 0.5em;
}
.kolbins-block input,
.kolbins-block textarea,
input.kolbins-input,
textarea.kolbins-input {
  font-size: 1em;
  font-family: var(--q-font);
  border: none;
  padding: 1.125em 1em;
  background: rgba(var(--q-background), 1);
  border-radius: var(--q-small-border-radius);
  width: 100%;
  color: rgba(var(--q-color), 1);
  transition: 0.3s;
  resize: vertical;
  font-weight: 500;
  &:focus {
    background: #fff;
    box-shadow: 0px 10px 30px rgba(var(--q-main), 0.1);
  }
  &::-webkit-input-placeholder {
    color: rgba(var(--q-fair-text), 1);
  }
  &::-moz-placeholder {
    color: rgba(var(--q-fair-text), 1);
  }
  &:-moz-placeholder {
    color: rgba(var(--q-fair-text), 1);
  }
  &:-ms-input-placeholder {
    color: rgba(var(--q-fair-text), 1);
  }
}

.q-thumbler {
  border: solid 2px rgba(var(--q-main), 1);
  border-radius: var(--q-small-border-radius);
  display: flex;
  overflow: hidden;
  & > * {
    flex-shrink: 0;
    flex-grow: 1;
    text-align: center;
    color: rgba(var(--q-main), 1);
    padding: 0.6em 0.5em;
    cursor: pointer;
    &.active {
      background: rgba(var(--q-main), 1);
      color: #fff;
    }
    .m-icon {
      font-size: 1.125em;
    }
  }
}
.q-tag {
  font-size: var(--q-s-text);
  background: rgba(var(--q-main), 0.1);
  border-radius: 60px;
  color: rgba(var(--q-main), 1);
  display: inline-flex;
  font-weight: 600;
  padding: 0.2em 0.7em;
  margin-right: 0.2em;
  margin-bottom: 0.2em;
  transition: 0.3s;
  cursor: pointer;
  position: relative;
  &:hover {
    background: rgba(var(--q-main), 0.3);
  }
  &.active {
    background: rgba(var(--q-main), 1);
    color: #fff;
  }
}

@supports (-webkit-appearance: none) or (-moz-appearance: none) {
  .kolbins-block {
    input[type='checkbox'],
    input[type='radio'] {
      --active: #275efe;
      --active-inner: #fff;
      --focus: 2px rgba(39, 94, 254, 0.3);
      --border: #bbc1e1;
      --border-hover: #275efe;
      --background: #fff;
      --disabled: #f6f8ff;
      --disabled-inner: #e1e6f9;
      -webkit-appearance: none;
      -moz-appearance: none;
      height: 21px;
      padding: 0;
      outline: none;
      display: inline-block;
      vertical-align: top;
      position: relative;
      margin: 0;
      cursor: pointer;
      border: 1px solid var(--bc, var(--border));
      background: var(--b, var(--background));
      transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
      &:after {
        content: '';
        display: block;
        left: 0;
        top: 0;
        position: absolute;
        transition: transform var(--d-t, 0.3s) var(--d-t-e, ease),
          opacity var(--d-o, 0.2s);
      }
      &:checked {
        --b: var(--active);
        --bc: var(--active);
        --d-o: 0.3s;
        --d-t: 0.6s;
        --d-t-e: cubic-bezier(0.2, 0.85, 0.32, 1.2);
      }
      &:disabled {
        --b: var(--disabled);
        cursor: not-allowed;
        opacity: 0.9;
        &:checked {
          --b: var(--disabled-inner);
          --bc: var(--border);
        }
        & + label {
          cursor: not-allowed;
        }
      }
      &:hover {
        &:not(:checked) {
          &:not(:disabled) {
            --bc: var(--border-hover);
          }
        }
      }
      &:focus {
        box-shadow: 0 0 0 var(--focus);
      }
      & + label {
        font-size: 14px;
        line-height: 21px;
        display: inline-block;
        vertical-align: top;
        cursor: pointer;
        margin-left: 4px;
      }
    }
    input[type='checkbox'] {
      width: 38px;
      border-radius: 11px;
      &:after {
        left: 2px;
        top: 2px;
        border-radius: 50%;
        width: 15px;
        height: 15px;
        background: var(--ab, var(--border));
        transform: translateX(var(--x, 0));
      }
      &:checked {
        --ab: var(--active-inner);
        --x: 17px;
      }
      &:disabled {
        &:not(:checked) {
          &:after {
            opacity: 0.6;
          }
        }
      }
      &.not-switch {
        border-radius: 7px;
        width: 21px;
        &:after {
          width: 5px;
          height: 9px;
          border: 2px solid var(--active-inner);
          border-top: 0;
          border-left: 0;
          left: 6px;
          top: 3px;
          transform: rotate(var(--r, 20deg));
          opacity: 0;
          background: var(--active);
          border-radius: 0;
        }
        &:checked {
          --r: 43deg;
          &:after {
            opacity: 1;
          }
        }
      }
    }
    input[type='radio'] {
      border-radius: 50%;
      width: 21px;
      // background: #fff;
      &:after {
        width: 19px;
        height: 19px;
        border-radius: 50%;
        background: var(--active-inner);
        // opacity: 0;
        transform: scale(var(--s, 0.7));
      }
      &:checked {
        --s: 0.5;
      }
    }
  }
}

.kolbins-image {
  height: 15em;
  position: relative;
  background: rgba(blue, 0.05);
  border-radius: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 1em;
  .bg {
    border-radius: inherit;
  }
  &.contain {
    .bg {
      background-size: contain !important;
      background-position: center !important;
      background-repeat: no-repeat !important;
    }
  }
  &.cover {
    .bg {
      background-size: cover !important;
      background-position: center !important;
      background-repeat: no-repeat !important;
    }
  }
}

.q-label {
  width: 20px;
  height: 20px;
  background: rgba(var(--q-main), 1);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  position: absolute;
  right: -3px;
  top: -3px;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
  &.small {
    width: 14px;
    height: 14px;
    font-size: 8px;
  }
}

.kolbins-input-self {
  width: 100%;
  display: block;
  font-family: var(--q-font);
  font-size: 1em;
  background: rgba(0, 0, 0, 0.02);
  border: solid 1px rgba(0, 0, 0, 0.01);
  padding: 1em 1em;
  border-radius: 5px;
  transition: 0.3s;
  resize: vertical;
  margin-bottom: 0.7em;
  &.invalid {
    border-color: rgb(204, 92, 92);
  }
  &:focus {
    box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.1);
    background: #fff;
  }
}

.ogImage {
  width: 40em;
  max-width: 100%;
  height: 20em;
  position: relative;
  margin-bottom: 1.5em;
  border-radius: 10px;
  overflow: hidden;
  .bg {
    background-size: cover !important;
    background-position: center !important;
    padding: 0 !important;
  }
}

.ui-card {
  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.05);
  border-radius: var(--q-small-border-radius);
  position: relative;
  &.interactive {
    transition: 0.3s;
    cursor: pointer;
    &:hover {
      box-shadow: 0px 15px 20px rgba(0, 0, 0, 0.05);
    }
  }
}
