/*----------------------------------------*/
/*  03. Sidebar Area
/*----------------------------------------*/
.tab-container {
  display: flex;
}

.tab-menu {
  position: relative;
  background: #101010;
  flex: 0 0 auto;
  width: 380px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);

  &.short {
    height: auto;
  }

  @media (max-width: 1680px) {
    width: 25%;
  }

  .tab-menu-left-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none; // Removed overlay for cleaner look
  }
}

.easydocs-tab {
  display: none;

  &.tab-active {
    display: block;
  }
}

.easydocs-navbar {
    padding: 20px 0;
    margin: 0;
}

.easydocs-navitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 12px 22px;
  margin: 0 0 5px;
  cursor: pointer;
  @include property;
  position: relative;
  border-radius: 0 8px 8px 0;
  border-left: 3px solid transparent; 
  transition: all 0.2s ease;

  .link-wrapper {
    display: none;
    align-items: center;
    justify-content: end;
    width: auto;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
  }

  &.is-active {
    background: rgba(54, 153, 255, 0.1);
    color: #fff;
    border-left-color: var(--frmx_brand_color);
    
    .title {
      color: #fff;
      opacity: 1;
      
      .featured-image {
        // background: var(--frmx_brand_color);
        
         span.dashicons {
             color: #fff;
         }
         
         img {
             opacity: 0.9;
         }
      }
    }

    .total-page {
      background: var(--frmx_brand_color);
      color: #fff;
      opacity: 1;
    }
  }

  .title {
    display: flex;
    align-items: center;
    gap: 15px;
    @include property;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    color: #a2a3b7;
    flex: 1;
    overflow: hidden;

    .featured-image {
      width: 36px;
      height: 36px;
      flex-shrink: 0;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.05);
      transition: all 0.2s ease;

      img {
        width: 100%;
        height: auto;
        border-radius: 6px;
      }

      span.dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
        color: #82859a;
        transition: all 0.2s ease;
      }
    }

    span.easydocs-forums-title {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .total-page {
    font-size: 11px;
    font-weight: 600;
    color: #8c8fa8;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    transition: all 0.2s ease;
  }

  &:hover {
    &:not(.is-active) {
      background: rgba(255, 255, 255, 0.03);
      
      .title {
          color: #dcdde8;
          
          .featured-image {
              background: rgba(255, 255, 255, 0.1);
              span.dashicons {
                  color: #dcdde8;
              }
          }
      }
    }

    .link-wrapper {
      opacity: 1;
      transform: translateX(0);
      display: flex;
    }
    
    .total-page {
        opacity: 0; 
        display: none;
    }
  }

  // Sub-forum toggle button
  .subforum-toggle {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0.5;

    .dashicons {
      font-size: 14px;
      width: 14px;
      height: 14px;
      color: #ccccd3;
    }

    &:hover {
        opacity: 1;
    }

    &[aria-expanded="false"] {
      transform: translateY(-50%) rotate(-90deg);
    }
  }

  // Sub-forum styling
  &.is-subforum {
    padding-left: 35px;
    margin-left: 0;
    border-left: 3px solid transparent; // Consistent with parent

    .featured-image {
      width: 28px;
      height: 28px;
      
      span.dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
      }
    }

    .title {
      font-size: 14px;
    }
    
    &.depth-1 { padding-left: 35px; }
    &.depth-2 { padding-left: 55px; }
    &.depth-3 { padding-left: 75px; }
  }
}

// Sub-forum container
.easydocs-subforum-container {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;

  &.is-collapsed {
    max-height: 0 !important;
    opacity: 0;
  }
}

.easydocs-subforums {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.link-wrapper {
  .link {
    display: inline-flex; // Ensure flex
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-left: 2px;
    transition: all 0.2s;
    text-decoration: none;
  
    a {
      text-decoration: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    .dashicons {
      color: #7e8299;
      font-size: 16px;
      width: 16px;
      height: 16px;
    }
  
    &:hover {
      background: rgba(255, 255, 255, 0.1);
      .dashicons {
        color: #fff;
      }
    }
    
    &.add-subforum:hover .dashicons {
        color: #4ade80;
    }
    &.forum-delete:hover .dashicons {
        color: #f1416c;
    }
  }
}

.easydocs-tab-content {
  flex: 1;
  width: auto;
  padding: 0 40px 40px 40px;
  @media (max-width: 1680px) {
    width: 70%;
  }
  @media (max-width: 1440px) {
    width: 70%;
    padding: 20px;
  }

  .button {
    padding: 6px 25px;
  }
}

.easydocs-filter-container {
  background: var(--clr-white);
  padding: var(--gutter-15) var(--gutter-30);
  border-radius: rem(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(125.95deg, #C700BF 10.95%, #7DA900 100%), linear-gradient(341.1deg, #00C2FF 7.52%, #4E00B1 77.98%), linear-gradient(222.34deg, #A90000 12.99%, #00FFE0 87.21%), linear-gradient(130.22deg, #8FA600 18.02%, #5A31FF 100%);
  background-blend-mode: screen, color-dodge, color-dodge, normal;
  padding-left: 16px;
  @media (max-width: 1440px) {
    padding: 10px 20px;
  }
}

.single-item-filter {
  display: flex;
  align-items: center;
  gap: 5px;

  &.all-available {
    li {
      padding: 5px 15px;
    }
  }

  .easydocs-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    gap: rem(5px);
    --btn-fs: var(--fs-14);
    transition: all .3s;
    border-radius: 15px;
    padding: 5px 25px;
    cursor: pointer;
    margin: 0;
    &:hover {
      background-color: rgba(#000, 0.1);
    }
    &.is-active {
      background-color: rgba(#000, 0.8);
      color: #f1f1f1;

      img {
        filter: brightness(0) invert(1);
      }
    }

    &.easydocs-btn-black-light {
      --btn-icon: #0D0E2B;

      svg {
        fill: #0D0E2B;
      }

      &.mixitup-control-active {
        --btn-bg: #0D0E2B;
        --btn-clr: var(--clr-white);
        --btn-icon: var(--clr-white);

        svg {
          fill: #ffffff;
        }
      }
    }

    &.easydocs-btn-green-light {
      --btn-icon: #2DB22D;

      svg {
        fill: #2DB22D;
      }

      &.mixitup-control-active {
        --btn-bg: #2DB22D;
        --btn-clr: var(--clr-white);
        --btn-icon: var(--clr-white);

        svg {
          fill: #ffffff;
        }
      }
    }

    &.easydocs-btn-blue-light {
      --btn-icon: #0275D8;

      svg {
        fill: #0275D8;
      }

      &.mixitup-control-active {
        --btn-bg: #0275D8;
        --btn-clr: var(--clr-white);
        --btn-icon: var(--clr-white);

        svg {
          fill: #fff;
        }
      }
    }

    &.easydocs-btn-orange-light {
      --btn-icon: #CC8033;

      svg {
        fill: #CC8033;
      }

      &.mixitup-control-active {
        --btn-bg: #CC8033;
        --btn-clr: var(--clr-white);
        --btn-icon: var(--clr-white);

        svg {
          fill: #fff;
        }
      }
    }

    &.easydocs-btn-gray-light {
      --btn-icon: #424242;

      &.mixitup-control-active {
        --btn-bg: #424242;
        --btn-clr: var(--clr-white);
        --btn-icon: var(--clr-white);
      }
    }
    @media screen and (max-width: 1440px) {
      padding: 5px 15px;
    }
  }
}

.single-grid-container {
  display: flex;
  align-items: center;
  border: 1px solid #EDEAE9;
  border-radius: rem(6px);
  --grid-icon: #9199A1;

  a {
    text-decoration: none;
    padding: 0.3rem 0.5rem 0.5rem;
    height: rem(30px);

    &:first-child {
      border-right: 1px solid #EDEAE9;
    }
  }

  .is-active {
    background: rgba(37, 39, 51, 0.05);
    --grid-icon: var(--clr-blue);
  }
}
