@import './common/general.less';
@import './common/list.less';
@import './common/navbar.less';
@import './common/toolbar.less';
@import './common/link.less';
@import './common/notification.less';
@import './common/card.less';
@import './common/smart-select.less';
@import './common/dialog.less';
@import './common/badge.less';

.button-backdrop {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 13000;
  visibility: hidden;
  opacity: 0;
  transition-duration: 400ms;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  &.not-animated {
    transition-duration: 0ms;
  }

  &.backdrop-in {
    visibility: visible;
    opacity: 1;
  }

  .preloader {
    width: 100%;
    height: 100%;
    max-width: 20px;
    max-height: 20px;
  }
  .preloader-inner-left {
    margin-left: auto !important;
  }
}

.swipeout-actions-left,
.swipeout-actions-right {
  z-index: 10;
}

.avatar {
  border-radius: 6px;
  border: 1px solid transparent;
}

.avatar12 {
  height: 12px;
  width: 12px;
}

.avatar16 {
  height: 16px;
  width: 16px;
}

.avatar24 {
  height: 24px;
  width: 24px;
}

.avatar32 {
  height: 32px;
  width: 32px;
}

.avatar48 {
  height: 48px;
  width: 48px;
}

.avatar24-wrapper {
  height: 24px;
  display: flex;
}

i.icon {
  img {
    border-radius: 6px;
    border: 1px solid transparent;
  }
}

.eb-loadmore {
  text-align: center;
  color: var(--f7-block-footer-text-color);
  margin-top: 10px;
  margin-bottom: 10px;
  position: relative;
  height: 50px;

  .eb-preloader {
    margin-top: 0;
    top: 0;
  }
}

.progressbar-container {
  margin-top: 20px;
}

.alert-success {
  color: #3c763d;
  background-color: #dff0d8;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #d6e9c6;
  border-radius: 4px;
}

.alert-info {
  color: #31708f;
  background-color: #d9edf7;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #bce8f1;
  border-radius: 4px;
}

.alert-warning {
  color: #8a6d3b;
  background-color: #fcf8e3;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #faebcc;
  border-radius: 4px;
}

.alert-danger {
  color: #a94442;
  background-color: #f2dede;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #ebccd1;
  border-radius: 4px;
}

input[type='search'] {
  -webkit-appearance: none;
}

input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
}

.eb-text-overflow-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.eb-text-overflow-ellipsis-block {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.eb-box-iframe {
  overflow: hidden;
}

.eb-dragdrop-tooltip {
  position: absolute;
  height: 16px;
  min-width: 16px;
  padding: 0 2px;
  font-size: 10px;
  text-align: center;
  background: rgba(128, 128, 128, 0.6);
  z-index: 20000;
  pointer-events: none;
}

.eb-icon-badge {
  position: absolute !important;
  left: 100% !important;
  margin-left: -10px !important;
  top: -2px !important;
  font-family: var(--f7-font-family) !important;
  --f7-badge-font-size: var(--f7-badge-in-icon-font-size) !important;
  --f7-badge-size: var(--f7-badge-in-icon-size) !important;
}

.eb-component-error {
  padding-left: 6px;
  padding-right: 6px;
}

.eb-box-grid-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  .box-grid-cell {
    display: block;
    width: 80px;
    text-align: center;
    margin: 6px;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--f7-list-item-title-text-color);
    &:hover {
      border: 1px solid var(--f7-list-group-title-bg-color);
      background: var(--f7-list-group-title-bg-color);
      color: var(--f7-theme-color);
    }
    .box-grid-cell-label {
      font-size: var(--f7-list-item-title-font-size);
      font-weight: var(--f7-list-item-title-font-weight);
    }
  }
}

.eb-scrollable {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  &::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    -webkit-appearance: none;
    opacity: 0 !important;
  }
}

:root {
  .eb-vertical-align {
    vertical-align: middle;
  }

  .eb-cursor-pointer {
    cursor: pointer;
  }

  .eb-accordion-list {
    .accordion-item {
      > a.item-link {
        background-color: var(--f7-list-group-title-bg-color);
      }
    }
  }

  .login-screen-page {
    --f7-login-screen-blocks-max-width: none;
  }

  textarea:disabled {
    font-size: var(--f7-list-item-after-font-size);
    color: var(--f7-list-item-after-text-color);
    background-color: var(--f7-page-bg-color);
  }

  textarea.json-textarea,
  div.json-textarea textarea {
    border: 1px solid var(--f7-text-editor-border-color);
    // margin: 10px;
    padding: 6px;
    line-height: 1.5;
    font-family: monospace;
  }

  textarea.json-textarea-margin {
    margin: 10px;
  }

  input.eb-form-button-submit-hidden {
    position: absolute;
    top: -1000px;
    left: -1000px;
    -webkit-appearance: none;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    line-height: 0;
    height: 0;
    width: 0;
    border: 0;
  }

  .after-title-search {
    margin: 0 10px;
  }

  .sheet-modal.sheet-modal-bottom.eb-sheet-no-backdrop:before {
    content: '';
    position: absolute;
    left: 0;
    right: auto;
    width: 100%;
    top: 0;
    bottom: auto;
    height: 8px;
    pointer-events: none;
    background: var(--f7-navbar-shadow-image);
    transform-origin: none;
    transform: none;
  }

  .button {
    display: flex;
  }

  .popover {
    // > sidebar 20000
    z-index: 21000;

    .list.inset {
      margin-top: 0;
      margin-bottom: 0;
    }
  }

  .treeview-item {
    .treeview-item-root-end {
      flex-grow: 1;
      display: flex;
      justify-content: flex-end;
      align-items: center;

      .link + .link {
        margin-left: 4px;
      }
    }

    .treeview-item-label {
      display: flex;
      align-items: center;
    }
  }

  .eb-divider-line {
    height: 1px;
    border-top: 1px solid var(--f7-text-editor-border-color);
    .text {
      position: relative;
      transform: translateY(-50%);
      background: var(--f7-page-bg-color);
      display: inline-block;
      padding: 0 8px;
    }
  }

  .eb-list-item-render-buttons {
    .buttons-wrapper {
      display: flex;
      .button {
        & + .button {
          margin-left: 6px;
        }
      }
    }
  }

  .eb-list-item-render-image {
    .item-content {
      .item-inner {
        &::after {
          display: none !important;
        }
      }
    }
    .item-input-wrap {
      .item-input-info,
      .item-input-error-message {
        top: 30%;
      }
      input {
        display: none;
      }
      &::after {
        display: none !important;
      }
    }
    .item-input-with-error-message,
    .item-input-with-info {
      padding-bottom: 0;
    }
    .images-container {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      width: 100%;

      .image-item {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 6px;
        padding: 0;
        border: 1px solid var(--f7-list-group-title-bg-color);
        border-radius: 6px;
        cursor: pointer;
        &:hover {
          border: 1px solid var(--f7-list-group-title-bg-color);
          background: var(--f7-list-group-title-bg-color);
          color: var(--f7-theme-color);
        }
      }
      .image-item.image-preview {
        img {
          width: 100%;
          height: 100%;
          border-radius: 6px;
          border: 1px solid var(--f7-list-group-title-bg-color);
        }
        .image-delete {
          position: absolute;
          right: -12px;
          top: -12px;
          background: var(--f7-list-group-title-bg-color);
          border-radius: 12px;
        }
      }
      .image-delete-single {
        position: relative;
        right: 18px;
        top: -6px;
        background: var(--f7-list-group-title-bg-color);
        border-radius: 12px;
        height: 26px;
      }
    }
  }
}
