@use "../../../styles/abstracts/variables";

// ===============================
// OVERLAY
// ===============================
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;

  &.fadeIn {
    opacity: 1;
    pointer-events: auto;
  }

  &.fadeOut {
    opacity: 0;
    pointer-events: none;
  }
}

// ===============================
// MOBILE SIDEBAR
// ===============================
.mobileSidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow-y: auto;
  padding: 0.5rem 0.8rem;
  transition: transform 0.3s ease;

  &.slideIn {
    transform: translateX(0%);
  }

  &.slideOut {
    transform: translateX(-100%);
  }

  // ===============================
  // ADMIN HEADER
  // ===============================
  &__admin {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;

    h3 {
      font-size: 0.88rem;
      font-weight: 600;
      color: #003845;
    }

    small {
      font-size: 0.65rem;
      font-weight: 500;
      color: rgba(0, 56, 69, 0.7);
    }
  }

  // ===============================
  // LINKS CONTAINER
  // ===============================
  &__links {
    flex: 1;
    padding: 1rem 0.5rem 6rem;

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-track {
      background: #f3f4f6;
    }

    &::-webkit-scrollbar-thumb {
      background: #003845;
      border-radius: 3px;
    }

    &::-webkit-scrollbar-thumb:hover {
      background: #002b36;
    }
  }

  // ===============================
  // SECTIONS
  // ===============================
  &__section {
    margin-bottom: 1.1rem;

    &:not(:first-child) {
      padding-top: 0.5rem;
      border-top: 1px dashed rgba(0, 56, 69, 0.15);
    }

    &__title {
      display: block;
      margin: 0.5rem 0 0.35rem 0.75rem;
      font-size: 0.62rem;
      font-weight: 600;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: rgba(0, 0, 0, 0.45);
    }
  }

  // ===============================
  // LINKS
  // ===============================
  .link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    color: #1f1f1f;
    position: relative;
    transition: all 0.25s ease;

    &:hover {
      background: rgba(0, 56, 69, 0.08);

      .icon {
        background: rgba(0, 56, 69, 0.15);
        color: #003845;
      }

      .link-label {
        color: #003845;
      }

      .link-desc {
        color: rgba(0, 56, 69, 0.7);
        opacity: 1;
      }
    }
  }

  // ===============================
  // ACTIVE LINK
  // ===============================
  .active {
    @extend .link;

    background: linear-gradient(
      135deg,
      rgba(0, 56, 69, 0.18),
      rgba(0, 56, 69, 0.08)
    );

    box-shadow: 0 4px 10px rgba(0, 56, 69, 0.15);
    border: 1px solid rgba(0, 56, 69, 0.25);

    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 25%;
      width: 4px;
      height: 50%;
      background: #003845;
      border-radius: 3px;
    }

    .icon-active {
      background: #003845;
      color: #ffffff;
    }

    .active-arrow {
      color: #003845;
    }

    .link-label {
      color: #003845;
      font-weight: 600;
    }

    .link-desc {
      color: rgba(0, 56, 69, 0.7);
      opacity: 1;
    }
  }

  // ===============================
  // ICONS
  // ===============================
  .icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
  }

  .icon-active {
    @extend .icon;
    background: #003845;
    color: #ffffff;
  }

  // ===============================
  // TEXT
  // ===============================
  .link-text {
    display: flex;
    flex-direction: column;
    flex: 1;

    .link-label {
      font-size: 0.88rem;
      font-weight: 500;
    }

    .link-desc {
      font-size: 0.65rem;
      opacity: 0.7;
      color: #6b7280;
    }
  }

  .active-arrow {
    margin-left: auto;
  }

  // ===============================
  // FOOTER
  // ===============================
  &__footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 280px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;

    &__avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: #003845;
      color: #ffffff;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    &__text {
      display: flex;
      flex-direction: column;

      h4 {
        font-size: 0.85rem;
        font-weight: 600;
        color: #1f1f1f;
      }

      small {
        font-size: 0.7rem;
        color: #6b7280;
      }
    }
  }
}