@import "../../../style/vars_mixins";

.submit-page {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;

  @media (min-width: $lg-break) {
    flex-direction: row;
    height: calc(100% - 104px) !important;
  }

  .editor-panel,
  .preview-panel,
  .advanced-panel {
    border-radius: $input-border-radius * 0.5;
    flex-basis: 49%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 400px;
    margin-bottom: 20px;
    position: relative;

    @media (min-width: $lg-break) {
      height: 100%;
      margin-bottom: 0;
    }

    @include themify(day) {
      @apply bg-light-200;
    }

    @include themify(night) {
      @apply bg-dark-600;
    }

    .bottom-toolbar {
      height: 44px;
      flex-shrink: 0;
      padding: 0 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;

      .action-buttons {
        display: flex !important;
      }
    }
  }

  .editor-panel {
    .community-input {
      height: 44px;
      padding-left: 10px;
      display: flex;
      align-items: center;
      @media (max-width: $sm-break) {
        height: 64px;
        margin: 10px 0;
      }
    }

    .title-input,
    .body-input,
    .tag-input {
      margin-top: 10px;
      position: relative;

      .form-control {
        border-radius: 8px;
        background: transparent;
        border: none;

        &:focus, &.intro-tour-focused {
          @include themify(day) {
            @apply bg-warning-046;
          }

          @include themify(night) {
            @apply bg-dark-600-010-light;
          }
        }

        @include themify(night) {
          @apply text-silver;
        }
      }
    }

    .title-input {
      .form-control {
        font-size: 24px;
        font-weight: 700;
      }
    }

    .body-input {
      flex-grow: 1;
      display: flex;

      textarea {
        resize: none;
        font-size: 21px;

        line-height: 1.5;
        flex-grow: 1;
      }
    }
  }

  .preview-panel,
  .advanced-panel {
    margin-bottom: 14px;

    @media (min-width: $lg-break) {
      margin-bottom: 0;
    }

    .panel-header {
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 8px;
      flex-shrink: 0;

      .panel-header-title {
        @apply text-blue-dark-sky;
        font-size: 18px;
        font-weight: 500;
        margin: 0;
      }

      .words-count {
        @apply text-gray-steel-010;
        margin-right: 20px;

        .words {
          margin-right: 10px;
        }
      }
    }
  }

  .preview-panel {
    .preview-title,
    .preview-tags,
    .preview-body {
      padding: 5px 12px;
      margin-top: 10px;
      font-size: 21px;

      @include themify(day) {
        @apply text-tundora;
      }

      @include themify(night) {
        @apply text-white;
      }
    }

    .preview-title {
      font-size: 24px;
      font-weight: 700;
      overflow: hidden;
      white-space: nowrap;
      height: 43px;
      flex-shrink: 0;

      @include themify(day) {
        @apply text-gray-charcoal;
      }

      @include themify(night) {
        @apply text-gray-pinkish;
      }
    }

    .preview-tags {
      display: flex;
      align-items: center;
      flex-wrap: wrap;

      flex-shrink: 0;

      .preview-tag {
        border-radius: 25px;
        font-size: 14px;
        line-height: 1em;
        margin: 0 4px 2px 0;
        padding: 4px 12px;

        @include tag;
      }
    }

    .preview-body {
      overflow-x: auto;
      flex-grow: 1;
    }
  }

  .advanced-panel {
    .panel-body {
      overflow-x: auto;
      flex-grow: 1;
    }
  }

  &:not(.editing) {
    .preview-panel, .advanced-panel {
      .panel-header {
        @media (min-width: $lg-break) {
          margin-bottom: 36px;
        }
      }
    }
  }

  .submit-video-attachments {

    .alert {
      font-size: 0.875rem;
    }

    .submit-video-attachments-list {
      display: flex;
      gap: 1rem;
      justify-content: flex-start;
      overflow-x: auto;

      .attachment-item {
        transition: .3s;
        border-radius: 1rem;
        border: 1px solid var(--border-color);
        background-size: cover;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 0.5rem;

        .type {
          position: absolute;
          @apply bg-blue-dark-sky;
          @apply text-white;
          rotate: -45deg;
          padding: 0.125rem;
          text-align: center;
          width: 100px;
          top: 0.75rem;
          left: -1.75rem;
          font-size: 0.675rem;
          text-transform: uppercase;
        }

        .title {
          padding: 0.5rem;
          @apply bg-white;
          border-radius: 0.75rem;
          border: 1px solid var(--border-color);
        }

        .remove {
          position: absolute;
          top: 0.5rem;
          right: 0.5rem;
          @apply bg-white;
          display: flex;
          align-items: center;
          justify-content: center;
          cursor: pointer;

          @include button-variant(rgba($primary, 0.35), rgba($primary, 0.35));
          @include padding(0.5rem);
          @include border-radius(0.75rem);

          svg {
            width: 1rem;
            height: 1rem;
          }
        }
      }
    }
  }
}

.selection-item {
  width: 100px;
  height: 100px;
  background-repeat: no-repeat;
  background-size: cover;
  border-width: 5px;
  border-style: solid;
  border-radius: 1.25rem;
  cursor: pointer;
  @apply bg-light-periwinkle;
  @apply border-light-periwinkle;
}

.selected {
  border: 5px solid;
  @apply border-blue-dark-sky;
  @apply bg-blue-dark-sky;
}

.selection-container {
  max-height: 300px;
  overflow-y: auto;
  @media (max-width: $sm-break) {
    justify-content: center;
    padding: 0;
  }

  .check {
    font-size: 14px;
    top: 9px;
    right: 25px;

    svg {
      width: 25px;
    }
  }
}
