/* =============================================
   LEADER EduCRM — Header Styles
   File: header.css
   ============================================= */

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* -----------------------------------------------
   HEADER WRAPPER
----------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #ffffff;
  border-bottom: 1px solid transparent;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;

  /* Load vào: slideDown ngay */
  animation: slideDown 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  border-bottom: 1px solid oklch(92.8% 0.006 264.531);
}

/* Scroll xuống nhưng chưa tới 150px: ẩn lên trên — dùng transition */
.site-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  animation: none; /* tắt animation, để transition xử lý */
}

/* Scroll qua 150px: tắt transition, để keyframe slideDown chạy */
.site-header.is-scrolled {
  border-color: rgba(0, 32, 88, 0.1);
  box-shadow: var(--shadow-md);
  animation: slideDown 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* -----------------------------------------------
   CONTAINER
----------------------------------------------- */
.site-header .container {
  max-width: var(--container-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
  box-sizing: border-box;
}

/* -----------------------------------------------
   LOGO (dùng chung)
----------------------------------------------- */
.header-logo {
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.logo-green {
  color: var(--color-secondary);
}
.logo-blue {
  color: var(--color-text);
}

/* -----------------------------------------------
   BUTTONS (dùng chung)
----------------------------------------------- */
.btn-outline {
  padding: 9px 22px;
  background: transparent;
  border: 2px solid var(--color-secondary);
  color: var(--color-secondary);
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
  transition:
    background var(--transition-normal),
    color var(--transition-normal);
}
.btn-outline:hover {
  background: var(--color-secondary);
  color: #ffffff;
}

.btn-fill {
  padding: 9px 22px;
  background: linear-gradient(135deg, #1e9e5a 0%, var(--color-secondary) 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
  transition:
    box-shadow var(--transition-normal),
    filter var(--transition-fast);
}
.btn-fill:hover {
  box-shadow: 0 6px 18px rgba(57, 166, 83, 0.4);
  filter: brightness(1.06);
}

/* ===============================================
   DESKTOP HEADER
   Hiện từ 1025px trở lên
=============================================== */
.header-desktop {
  display: block;
}

.header-mobile {
  display: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height); /* 80px */
}

/* Nav links */
.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav a {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.header-nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--color-secondary);
}

.header-nav a:hover::after,
.header-nav a.active::after {
  width: 100%;
}

/* Action buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ===============================================
   MOBILE HEADER
   Hiện dưới 1025px
=============================================== */
@media (max-width: 1024px) {
  .header-desktop {
    display: none;
  }
  .header-mobile {
    display: block;
  }
}

/* Topbar: logo + hamburger */
.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 20px;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition:
    transform var(--transition-normal),
    opacity var(--transition-fast);
}

/* Hamburger → X khi open */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile dropdown menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  background: #ffffff;
  border-top: 1px solid rgba(0, 32, 88, 0.08);
  padding: 12px 20px 24px;
  box-shadow: var(--shadow-lg);
}

.mobile-menu.open {
  display: flex;
  animation: slideDown 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Mobile nav links */
.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  padding: 13px 0;
  border-bottom: 1px solid rgba(0, 32, 88, 0.06);
  transition: color var(--transition-fast);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--color-secondary);
}

/* Mobile action buttons */
.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.mobile-actions .btn-outline,
.mobile-actions .btn-fill {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  text-align: center;
}

/* -----------------------------------------------
   SCROLL PROGRESS BAR
----------------------------------------------- */
.scroll-bar {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--color-secondary) 0%,
    var(--color-primary-light) 100%
  );
  border-radius: 0 2px 2px 0;
  transition: width 0.08s linear;
  pointer-events: none;
}
