/* Navbar Styles */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  height: 70px;
  width: 100%;
  transition: all 0.3s ease;
}

/* Navbar khi scroll */
.navbar.scrolled {
  top: 20px;
  padding: 0.8rem 0 0.8rem 0;
  height: 60px;
  border-radius: 30px;
  width: 850px;
  max-width: 850px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  transition: all 0.3s ease;
}

.navbar.scrolled .navbar-container {
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.navbar-logo img {
  height: 30px;
  width: auto;
  transition: all 0.3s ease;
}

.navbar.scrolled .navbar-logo img {
  height: 25px;
}

.navbar-logo a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 0.25rem;
}

.navbar-logo-text {
  font-size: 8px;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  transition: all 0.3s ease;
}

.navbar.scrolled .navbar-logo-text {
  font-size: 7px;
}

.navbar-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex: 1;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.navbar-menu li {
  margin: 0;
  padding: 0;
}

.navbar-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: var(--font-size-base);
  transition: all 0.3s ease;
  position: relative;
  display: block;
}

.navbar.scrolled .navbar-menu a {
  font-size: 1rem;
}

/* Gạch ngang dưới cho desktop */
.navbar-menu a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
}

.navbar-icons {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.navbar-icon-link {
  color: var(--text-color);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-icon-link:hover {
  color: var(--primary-color);
}

.navbar-icon-link i {
  font-size: 1.3rem;
  stroke-width: 1.5;
  transition: all 0.3s ease;
}

.navbar.scrolled .navbar-icon-link i {
  font-size: 1.2rem;
}

.navbar-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff0000;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  transition: all 0.3s ease;
}

/* Ẩn sidebar và overlay trên desktop */
.navbar-overlay,
.navbar-sidebar {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    z-index: 1002;
  }

  /* Ẩn navbar-menu và navbar-icons trên mobile */
  .navbar-menu,
  .navbar-icons {
    display: none;
  }

  .navbar-container {
    position: relative;
    justify-content: space-between;
  }

  /* Giữ nguyên navbar trên mobile khi scroll */
  .navbar.scrolled {
    top: 0;
    padding: 1rem 0;
    height: 70px;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .navbar.scrolled .navbar-container {
    padding: 0 2rem;
    gap: 2rem;
  }

  .navbar.scrolled .navbar-logo img {
    height: 30px;
  }

  .navbar.scrolled .navbar-logo-text {
    font-size: 8px;
  }

  /* Hiển thị sidebar và overlay trên mobile */
  .navbar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .navbar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Sidebar menu */
  .navbar-sidebar {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 350px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
    flex-direction: column;
  }

  .navbar-sidebar.active {
    right: 0;
  }

  /* Sidebar header */
  .sidebar-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: #024bd2;
  }

  .sidebar-header h3 {
    display: none;
  }

  .sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }

  .sidebar-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
  }

  /* Sidebar menu items */
  .sidebar-menu {
    flex: 1;
    padding: 1.2rem 0 0 0;
  }

  .sidebar-menu .navbar-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    list-style: none;
    margin: 0;
  }

  .sidebar-menu .navbar-menu li {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .sidebar-menu .navbar-menu a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: var(--font-size-base);
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    color: var(--text-color);
    position: relative;
  }

  /* Ẩn gạch ngang trên mobile */
  .sidebar-menu .navbar-menu a.active::after {
    display: none;
  }

  /* Ẩn gạch dọc bên trái trên mobile */
  .sidebar-menu .navbar-menu a.active::before {
    display: none;
  }

  /* Sidebar icons */
  .sidebar-icons {
    padding: 0.7rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    gap: 1rem;
  }

  .sidebar-icons .navbar-icons {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    justify-content: space-around;
  }

  .sidebar-icons .navbar-icon-link {
    font-size: 1.5rem;
  }

  /* Menu toggle animation khi active */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
}
