// Navbar
.main-nav {
  height: var(--navbar-height);
  box-shadow: rgb(0 0 0 / 5%) 0px 6px 24px 0px, rgb(0 0 0 / 8%) 0px 0px 0px 1px;

  // Logo
  .main-nav__logo {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
  }

  .main-nav__logo-img {
    width: 132px;
  }

  .wrapper {
    display: flex;
    align-items: center;
  }
}

.main-nav__label {
  flex: 1;

  .title {
    font-size: 2.4rem;
    color: var(--primary-color);
  }
}

// Action CSS
.main-nav__action {
  display: flex;
  align-items: center;

  // Notification
  .notification {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 36px;
    height: 36px;
    margin-right: 24px;
    cursor: pointer;

    &:hover {
      .notification__icon {
        color: rgb(244, 244, 244);
        background-color: rgb(119, 119, 119);
      }
    }

    // Icon
    .notification__icon {
      font-size: 1.8rem;
      border-radius: 50%;
      padding: 9px 10px;
      color: #4f4f4f;
      background-color: #ccc;
    }

    // Warning
    .notification__warning {
      position: absolute;
      top: -8px;
      right: -6px;
      width: 20px;
      height: 20px;
      background-color: #d90000;
      color: var(--white-color);
      border-radius: 50%;
      text-align: center;
      display: none;

      i {
        font-size: 1.2rem;
      }
    }

    .notification__warning.active {
      display: block;
    }
  }

  .notification.active {
    .notification__icon {
      color: var(--white-color);
      background-color: #4ca9ff;
    }
  }

  .profile {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;

    .profile__infor {
      margin-right: 8px;
      text-align: right;

      .infor__name {
        font-size: 1.6rem;
        margin-bottom: 0;
      }

      .infor__role {
        font-size: 1.4rem;
      }
    }

    .profile__avatar {
      .avatar__img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid #3b89fc;
      }
    }

    &:hover {
      background-color: #dad9d9;
    }
  }

  .profile.active {
    background-color: #399fff;

    .profile__infor {
      color: var(--white-color);
    }

    .avatar__img {
      border-color: var(--white-color);
    }
  }

  .menu-sidebar-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background-color: #ccc;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-left: 12px;
    cursor: pointer;

    i {
      color: #4f4f4f;
      font-size: 1.8rem;
    }

    &:hover {
      background-color: rgb(119, 119, 119);

      i {
        color: rgb(244, 244, 244);
      }
    }
  }

  .menu-sidebar-btn.active {
    background-color: #4ca9ff;

    i {
      color: var(--white-color);
    }
  }
}

.main-nav-body {
  position: relative;

  // List notification
  .notification__list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10;
    max-width: 400px;
    padding: 16px 0 8px 0;
    border-radius: 6px;
    background-color: var(--white-color);
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
      rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
    cursor: default;
    display: none;
    animation: fadeIn 0.15s linear;

    .notification__list-header {
      display: flex;
      align-items: center;
      padding: 0 16px 8px 16px;

      h3 {
        flex: 1;
        font-size: 2.4rem;
        margin-bottom: 0;
      }

      a {
        color: var(--primary-color);
        display: block;
        padding: 8px 0px 8px 8px;

        &:hover {
          color: #74bcff;
        }
      }
    }

    .notification__list-items {
      list-style: none;
      padding-left: 0;
      max-height: 80vh;
      overflow-y: auto;

      .notification__item {
        position: relative;

        .marker {
          position: absolute;
          top: 50%;
          right: 10px;
          width: 10px;
          height: 10px;
          border-radius: 50%;
          transform: translateY(-50%);
          background-color: var(--primary-color);
        }

        a {
          display: flex;
          padding: 8px 16px;
          transition: all 0.2s ease;

          &:hover {
            background-color: rgb(228, 228, 228);
            color: #000;
          }
        }

        .notification__item-icon {
          font-size: 4.8rem;
          padding-right: 16px;
        }

        .notification__item-icon.report {
          color: #dc3545;
        }

        .notification__item-icon.success {
          color: #3de600;
        }

        .notification__item-info {
          flex: 1;

          .notification__item-name {
            display: flex;
            font-weight: 500;
            font-size: 1.8rem;

            .room {
              flex: 1;
            }

            .hostel {
              span {
                font-weight: 400;
                font-size: 1.6rem;
              }
            }
          }

          .notification__item-content {
            font-size: 1.6rem;
            line-height: 2.2rem;
            max-height: 4.4rem;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            margin: 4px 0;
          }

          .notification__item-time {
            font-size: 1.4rem;
            color: var(--primary-color);
          }
        }
      }

      .notification__item.readed {
        .marker {
          display: none;
        }

        .notification__item-time {
          color: var(--text-color);
        }
      }
    }
  }

  // Profile dropdown
  .profile__actions {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10;
    width: 300px;
    padding: 8px 4px;
    border-radius: 6px;
    background-color: var(--white-color);
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
      rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
    cursor: default;
    animation: fadeIn 0.15s linear;
    display: none;

    .spacer {
      border-top: 1px solid #ccc;
    }

    a {
      display: flex;
      padding: 10px 8px;
      border-radius: 6px;
      align-items: center;
      transition: all 0.1s ease;

      &:hover {
        background-color: rgb(237, 237, 237);
        color: #000;
      }

      .action__image {
        border-radius: 50%;
        width: 40px;
        height: 40px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 8px;
        background-color: #ccc;

        img {
          width: 100%;
          height: 100%;
        }

        i {
          font-size: 2rem;
        }
      }

      .action__content {
        flex: 1;
        font-size: 1.8rem;
        line-height: 2rem;

        .title {
          font-weight: 600;
        }

        .subtitle {
          font-size: 1.6rem;
        }
      }
    }

    .action__view-profile-link {
      .action__image {
        width: 60px;
        height: 60px;
      }
    }
  }
}

// Responsive
@media (max-width: 768px) {
  .main-nav__label {
    .title {
      display: none;
    }
  }

  .profile {
    .profile__infor {
      display: none;
    }
  }
}

@media (max-width: 992px) {
  .main-nav__action {
    .notification {
      margin-right: 12px;
    }
    .menu-sidebar-btn {
      display: flex;
    }
  }
}
