@use '../globals';

.navbar {
  @include globals.flex-center();
  justify-content: space-between;
  padding: 1em;
  background: var(--color-background);
  color: var(--color-text);
  height: 65px;

  &__name {
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--color-text);
    text-decoration: none;
  }

  &__container {
    &__button {
      @extend %button-reset;
      @extend %hover-lift;
      padding: 0.6rem 1.2rem;
      border-radius: 8px;
      transition: box-shadow 0.2s ease, transform 0.2s ease;

      &:active {
        box-shadow: 0 2px 4px var(--box-shadow-active);
        transform: translateY(0);
      }
    }
  }

  &__burger-button {
    @include globals.flex-center();
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 17px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;

    &__item {
      display: block;
      height: 3px;
      width: 100%;
      background-color: var(--color-text);
      border-radius: 2px;
      transition: all 0.3s ease;
      margin: 1px 0;
    }

    &:hover &__item {
      background-color: var(--color-primary);
    }

    &.active {
      &__item:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
      }
      &__item:nth-child(2) {
        opacity: 0;
      }
      &__item:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
      }
    }
  }

  /* Mobile Menu Dropdown */
  .navbar__mobile-menu {
    @include globals.flex-center();
    position: absolute;
    right: 0;
    background: var(--color-background);
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    padding: 0.5em;
    gap: 0.5em;
    box-shadow: 0 4px 12px var(--box-shadow-hover);
    z-index: 10;

    button {
      @extend %button-reset;
      padding: 0.5em 1em;
      text-align: right;
      border-radius: 4px;
      transition: background 0.2s;

      &:hover {
        background: var(--box-shadow-active);
      }
    }
  }
}

@include globals.mobile-only {
  .navbar__container__button {
    display: none;
  }
}

@include globals.desktop-only {
  .navbar__burger-button {
    display: none;
  }
}
