@import "../../../assets/scss/variables";


:root {
  --hover-color: white;
}

:root[data-theme="dark"] {
  --hover-color: #40474F;
}


/*-----General-----*/
.quick-access {

  .my-day {
    background-color: $attention-color;
    height: 44px;
  }

  overflow-y: hidden;
  overflow-x: hidden;
  white-space: nowrap;

  .quick-note {
    display: flex;
    flex-grow: 1;
    height: calc(100% - 610px);
    flex-direction: column;
    min-height: 110px;
    justify-content: flex-start;

    :focus-within {
      #clear-btn {
        display: block;
      }
    }

    .note-area {
      padding-top: 1rem;
      height: 50%;
      max-height: 260px;
    }

    #clear-btn {
      display: none;
      position: relative;
      top: -30px;
      left: 275px;
    }

    textarea {

      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-color: $gray-border #e9f0f9;
      scrollbar-width: thin;
      scroll-behavior: smooth;

      &::-webkit-scrollbar {
        width: 5px;
        height: 50% !important;
        transform: scaleY(0.5) !important;
      }

      /* Track */
      &::-webkit-scrollbar-track {
        background: #e9f0f9;
        border-radius: 10px;
      }

      /* Handle */
      &::-webkit-scrollbar-thumb {
        background: $gray-border;
        border-radius: 10px;
      }

      /* Handle on hover */
      &::-webkit-scrollbar-thumb:hover {
        background: transparent;
      }

      border-radius: 4px;
      padding: 10px;
      border: 1px dashed $alternate-text-color;
      background-color: $quick-access-background;
      width: 100%;
      resize: none;
      height: 100%;
      color: $text-color;
      outline: none;

      &:focus-visible {
        border: 1px dashed $secondary-color;
        background-color: var(--hover-color);
      }

      &:hover {
        border: 1px dashed $secondary-color;
        background-color: var(--hover-color);
      }


    }
  }


  & > div {
    overflow-y: hidden;
  }

  /*-----Quick access header-----*/


  .quick-access-header, .personal-file-header {
    padding-left: 0rem;
    padding-bottom: 2rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid $gray-border;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
margin-top: 6px;
    & h3,
    & p {
      margin-bottom: 0;
      font-size: 1.5rem;
      font-weight: bold;
      color: $title-color;
    }
    h3{
      padding-bottom: 2px;
    }

    .quick-access-app-sum,
    .personal-file-sum {
      margin-bottom: -2px;
    }
  }

  /*-----Quick access blocks-----*/

  .qa-block-list{
    display: flex;
    flex-direction: column;
    gap: 0;

    .qa-block-container, {

      position: relative;
      height: 55px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 0;
      padding-left: 36px;

      .normal {
        padding-right: 25px;
      }

      &::after {
        content: " ";
        position: absolute;
        bottom: -2px;
        left: 1.3rem;
        right: 1.3rem;
        border-bottom: 1px dashed $gray-border;
      }

      .garbage-bin,

      .drag {
        display: none;
      }

      .qa-block-left,{

        .qa-role,{
          font-size: 1.4rem;
          font-weight: 500;
          letter-spacing: 0.24px;
          color: $title-color;

          line-height: 1.2;
        }

        .qa-role {
          font-weight: 900;
          font-size: 1rem;
          margin-bottom: 0.2rem;
          overflow: hidden;
        }

        .qa-title,
        .pf-content {
          font-size: 1.4rem;
          font-weight: normal;
          letter-spacing: 0;
          color: $title-color;
          text-transform: capitalize;
          line-height: 1.2;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }

      &:hover {
        background-color: #177BFF11;

        .normal {

          .qa-block-left,
          .pf-block-left {

            .garbage-bin {
              display: block;
              position: absolute;
              right: 12px;
              top: 50%;
              transform: translateY(-50%);
            }
          }

          .drag {
            display: block;
          }
        }
      }
    }


    .pf-block-container {
      padding: 1rem 1.33rem 1rem 4rem;
      margin-top: -9px;

      &::after {

        content: " ";
        position: absolute;
        bottom: 2px;
        left: 1.3rem;
        right: 1.3rem;
        border-bottom: 1px dashed $gray-border;
        margin-bottom: 2px;
      }

      &:hover {
        .pf-tag {
          margin-left: 0.1rem;
        }
      }

      .pf-tag {
        text-transform: capitalize !important;
        font-size: 1.4rem !important;
        margin-right: 0.9rem;
      }
    }

    .qa-block-link {
      position: relative;

    }


    .qa-block-container:has(.to-be-deleted) {
      padding: 0 !important;


      &:hover {
        padding: 0;
      }

      &::after {
        display: none;
      }
    }

    /*-----Empty blocks-----*/

    .add-block {

      background-color: $quick-access-background;
      border: 1px dashed $gray-border;
      border-radius: 0.5rem;
      text-align: center;
      margin: 9.31px 13px;
      transition: 0.5s;

      & img {
        padding: 0.9rem 0;
      }

      &:hover {
        background-color: var(--hover-color);
        cursor: pointer;
      }

      &:first-child {
        margin-top: 1rem;
      }
    }
  }


  /*-----Delete block styles-----*/

  .to-be-deleted {
    width: 100%;
    margin-left: 0;
    padding: 1rem 1.33rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: $secondary-color;
    cursor: pointer;
    border-bottom: none;
    z-index: 9999999999;

    .qa-block-left-deleted {
      display: flex;
      align-items: center;
      gap: 1.33rem;

      .delete-msg {
        font-size: 1.4rem;
        letter-spacing: 0.28px;
        color: $white;
      }
    }

    .qa-block-right-deleted {
      min-width: 11rem;
      align-items: center;
      justify-content: space-between;

      button {
        font-size: 1.2rem;
        font-weight: 700;
        letter-spacing: 0.24px;
        padding: 0.7rem 1.5rem;
        border: none;
        border-radius: 5px;
        background-color: $white;
        color: $main-color;
        cursor: pointer;
        box-shadow: 0 3px 6px #00000029;
        transition: 0.3s;

        &:hover {
          color:#1A73E8;
        }
      }
    }
  }

  &:hover {
    &::-webkit-scrollbar {
      display: block;
    }
  }

  img, svg{
    filter: $svg-default;
  }

}

/*-----Quick access bar visibility toggle-----*/

.closed {
  .qa {
    overflow: hidden;
  }

  .quick-note,
  .my-day {
    display: none;
  }

  .personal-file,
  .pf-block-list,
  .qa-header,
  .qa-block-list {
    display: none;
    transition: 0.4s;
    pointer-events: none;
  }
}

.my-day {
  margin-top: -38px;
  color: $white;

  &--icon {
    margin: 0 20px;
  }
}


.quick-access.open {
  .scrollbar {
    scrollbar-color: $gray-border #e9f0f9;
    scrollbar-width: thin;
    scroll-behavior: smooth;
  }

  .qa {
    flex-grow: 1;
  }

  .personal-file {
    margin-top: 15px;
  }


  .myday,
  .personal-file,
  .pf-block-list,
  .qa-header,
  .qa-block-list {
    opacity: 1;
    transition: 0.4s;
    pointer-events: all;
  }

  .qa-header {
    position: relative;
    top: 0;
    left: 0;

  }

  .qa-block-list {
    opacity: 1;
    transition: 0.4s;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100% - 44px); // Subtract the height of the header from the available height

    //height: 100%;
    pointer-events: all;

    &::-webkit-scrollbar {
      width: 5px;
      height: 50% !important;
      transform: scaleY(0.5) !important;
    }

    /* Track */
    &::-webkit-scrollbar-track {
      background: #e9f0f9;
      border-radius: 10px;
    }

    /* Handle */
    &::-webkit-scrollbar-thumb {
      background: $gray-border;
      border-radius: 10px;
    }

    /* Handle on hover */
    &::-webkit-scrollbar-thumb:hover {
      background: transparent;
    }
  }
}

.drag-container {
  position: relative;

  .drag-handle {
    z-index: 9999999;
    position: absolute;
    height: 100%;
    width: 34px;
    display: flex !important;
    align-items: center;
    justify-content: center;

  }

}

