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

/* NAVBAR */
.nav {
  background: #0f0f0f;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid variables.$col-border-lining;
  position: relative;
  z-index: 100;
}

/* LEFT */
.nav__left {
  h4 {
    font-size: 0.9rem;
    color: variables.$col-white;
    font-weight: 500;
  }
}

/* RIGHT */
.nav__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

/* ICON BEFORE AVATAR */
.iconSection {
  display: flex;
  align-items: center;
  justify-content: center;
  color: variables.$col-white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.25s ease;

  &:hover {
    background: rgba(255, 255, 255, 0.12);
  }
}

/* DIVIDER */
.divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 0.5rem;
}

/* AVATAR SECTION */
.avatarSection {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;

  .nav__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid variables.$col-border-lining;
  }

  .username {
    font-size: 0.85rem;
    color: variables.$col-white;
    font-weight: 500;
  }
}

/* DROPDOWN */
.dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background: #151515;
  border: 1px solid variables.$col-border-lining;
  border-radius: 14px;
  min-width: 240px;
  padding: 0.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  animation: fadeIn 0.18s ease;
  z-index: 200;

  .dropdownHeader {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;

    .dropdownAvatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      object-fit: cover;
    }

    .userInfo {
      display: flex;
      flex-direction: column;

      .name {
        font-weight: 600;
        color: variables.$col-white;
        font-size: 0.85rem;
      }

      .email {
        font-weight: 400;
        font-size: 0.78rem;
        color: rgba(255, 255, 255, 0.7);
        word-break: break-all;
      }
    }
  }

  .dropdownLinks {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;

    .dropdownLink {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.7rem;
      border-radius: 8px;
      font-size: 0.85rem;
      color: variables.$col-white;
      text-decoration: none;
      cursor: pointer;

      &:hover {
        background: rgba(255, 255, 255, 0.06);
      }
    }

    .logoutBtn {
      all: unset;
      margin-top: 0.6rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.55rem;
      width: 100%;
      padding: 0.65rem;
      border-radius: 12px;
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      width: 92%;

      /* 🔥 Destructive gradient */
      background: linear-gradient(
        135deg,
        rgba(255, 77, 77, 0.95),
        rgba(200, 40, 40, 0.95)
      );

      color: #fff;
      cursor: pointer;
      transition: all 0.25s ease;
      box-shadow:
        0 10px 20px rgba(255, 77, 77, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);

      svg {
        font-size: 1rem;
      }

      &:hover {
        transform: translateY(-1px);
        box-shadow:
          0 14px 28px rgba(255, 77, 77, 0.45),
          inset 0 0 0 1px rgba(255, 255, 255, 0.15);
      }

      &:active {
        transform: translateY(0);
        box-shadow:
          0 6px 14px rgba(255, 77, 77, 0.35),
          inset 0 0 0 1px rgba(0, 0, 0, 0.25);
      }
    }
  }
}

/* HAMBURGER – MOBILE ONLY */
.hamburger {
  display: none;
  color: variables.$col-white;

  @media (max-width: 1000px) {
    display: flex;
  }
}

/* ANIMATION */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
