@use "variables.scss";

#document-edit {
  display: flex;
  background-color: variables.$light-grey-background;
  position: relative;
  display: flex;
  height: 100%;

  .pages-section {
    width: 100%;
    overflow-y: scroll;
    border-right: variables.$component-border;
    border-left: variables.$component-border;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .grid-header {
      height: 60px;
      background-color: variables.$background;
      border-bottom: variables.$component-border;
      display: flex;
      align-items: center;

      .header-title {
        color: variables.$text-color;
        font-weight: 600;
        font-size: 18px;
        line-height: 18px;
        padding-left: 28px;
      }
    }

    .document-grid {
      padding: 32px;
      display: flex;
      flex-wrap: wrap;
      row-gap: 16px;

      .image-section {
        cursor: grab;
        display: flex;
        align-items: center;
        flex-direction: column;

        .top-section {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          height: 100%;
          align-items: center;
        }
        .bottom-section {
          text-align: center;
        }

        .page-number {
          margin-top: 8px;
          color: variables.$text-lighter;
          font-size: 12px;
          line-height: 12px;
          font-weight: 400;
          align-self: center;
          padding-right: 60px;
        }

        .splitting-lines {
          cursor: pointer;
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          width: 54px;

          .lines {
            display: flex;
            align-items: center;
            justify-content: center;
          }

          .scissors-icon {
            display: none;
            transform: translate(10%) rotate(-90deg);
            position: absolute;
            z-index: 999;
          }

          &:hover {
            .scissors-icon {
              display: block;
            }
          }

          &.active-split {
            .lines {
              margin-left: 15px;
              margin-right: 3px;
              padding-right: 12px;
            }

            &:hover {
              .scissors-icon {
                display: none;
              }
            }
          }
        }

        &:last-child {
          .splitting-lines {
            display: none;
          }
          .page-number {
            padding-right: 0px;
          }
        }
      }
    }

    .info-bar {
      position: sticky;
      width: -moz-fit-content;
      width: fit-content;
      bottom: 20px;
      left: 0;
      right: 0;
      margin: 0 auto;
      padding: 10px;
      z-index: 999;

      .split-info-bar {
        padding: 5px 13px;
        min-height: 32px;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background-color: variables.$text-color;
        color: variables.$white;
        font-weight: 400;
        font-size: 14px;
        border-radius: 52px;
        text-align: center;
      }
    }
  }

  .sidebar {
    width: 45%;
    max-width: 300px;
    min-width: 270px;
    background-color: variables.$background;

    .edit-sidebar {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      text-align: center;
      height: 100%;

      .buttons-container {
        width: 85%;
        display: flex;
        flex-direction: column;
        color: variables.$grey-dark;

        .pages-selected {
          font-weight: 400;
          font-size: 14px;
          margin-bottom: 15px;

          &.disabled {
            color: variables.$grey;
          }
        }

        .edit-buttons {
          display: flex;
          flex-direction: column;
          gap: 8px;
          border-bottom: 1px solid variables.$grey-detail;

          .sidebar-buttons {
            .edit-mode-btn {
              display: flex;
              width: 100%;

              .button-content {
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 9px;

                .button-text {
                  font-size: 14px;
                  font-weight: 500;
                }
              }
            }

            &:first-child {
              margin-top: 14px;
            }

            &:last-child {
              margin-bottom: 14px;
            }
          }

          &:first-child {
            margin-top: 14px;
          }

          &:last-child {
            margin-bottom: 14px;
          }
        }
      }

      .smart-split {
        .switch-info {
          display: flex;
          align-items: center;
          gap: 8px;

          .control-label {
            .switch-text {
              font-size: 14px;
              padding-right: 10px;
              color: variables.$grey-dark;
              font-weight: 500;
            }
          }

          .new-badge {
            background: linear-gradient(90deg, #c1ff79 0%, #79fff7 100%);
            border-radius: 36px;
            font-weight: 700;
            font-size: 11px;
            padding: 5px;
            color: variables.$text-color;
          }
        }
      }
    }
  }

  @media (max-width: 1150px) {
    .sidebar {
      width: 50%;
    }
  }

  @media (max-width: 1100px) {
    .sidebar {
      width: 60%;
    }
  }

  &.rename-and-categorize-component {
    background-color: variables.$background;
    min-width: 600px;

    .rename-and-categorize-section {
      padding-left: 30px;
      padding-right: 10px;
      overflow-y: scroll;
      width: 100%;
    }

    .rename-and-categorize {
      margin-top: 20px;
      img {
        height: 30px !important;
        width: 30px !important;
      }

      .back-section {
        display: flex;
        align-items: center;
        gap: 11px;
        width: fit-content;
        margin-bottom: 26px;
        cursor: pointer;

        .back-btn-section {
          padding-top: 4px;
        }

        .back-text {
          color: variables.$grey;
          font-weight: 400;
          font-size: 14px;
          line-height: 20px;
        }
      }

      .rename-and-categorize-title {
        color: variables.$text-color;
        font-size: 16px;
        font-weight: 600;
      }

      .new-documents-container {
        padding-bottom: 30px;
        padding-top: 35px;
        padding-right: 10px;

        .document-details {
          display: flex;
          align-items: center;
          gap: 20px;
          padding-bottom: 40px;

          .rename-and-categorize-thumbnails {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 60px;

            .split-documents {
              display: flex;
              align-items: center;

              .image-container {
                .thumbnail {
                  display: flex;
                  align-items: center;
                  justify-content: center;

                  .page-thumbnail {
                    border: variables.$component-border;
                    border-radius: 2px;
                  }

                  &.page-stack {
                    .page-thumbnail {
                      box-shadow: 2px 2px variables.$white,
                        3px 3px variables.$detail, 5px 5px variables.$white,
                        6px 6px variables.$detail;
                    }
                  }

                  &:hover {
                    cursor: pointer;
                  }
                }
              }
            }
          }

          .doc-info {
            display: flex;
            justify-content: space-between;
            flex: 1;
            gap: 8px;

            .file-name-section {
              display: flex;
              height: 40px;
              flex: 2;

              .control {
                .input {
                  border-radius: 4px 0 0 4px !important;
                  box-shadow: none !important;
                  border-right: 0;

                  &:hover {
                    border-color: variables.$grey-outline;
                  }
                }
              }

              .name-input {
                display: flex;
                align-items: center;
                height: 100%;
                width: 100%;
                max-width: 100%;
                padding: 12px;
                border-radius: 4px 0 0 4px;
                border: 1px solid variables.$grey-outline;
                border-right: 0;
                background-color: variables.$white;
                cursor: text;
              }

              .file-extension-container {
                display: flex;
                align-items: center;
                padding: 13px;
                height: 40px;
                border-radius: 0 4px 4px 0;
                border: 1px solid variables.$grey-outline;
                background-color: variables.$white;
                color: variables.$grey-blue;
              }
            }

            .category {
              flex: 1;
            }
          }
        }
      }
    }
  }
}
