/* Header Styles
 *
 * Every selector below is scoped under `.header` on purpose. This file is now loaded on every
 * page, including the course pages, whose Bootstrap-based theme also uses `.nav-link`,
 * `.dropdown` and `.login-btn` for unrelated components. */

.header {
  background: #ffffff;
  color: #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
  overflow: visible;
  flex-direction: column;
  display: flex;
}

.header .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 84px;
  position: relative;
  z-index: 200;
  width: 100%;
}

.header .logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

.header .main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
  justify-content: center;
}

.header .nav-link {
  color: #1e293b;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  padding: 4px 0;
  font-size: 15px;
  text-decoration: none;
}

.header .nav-link:hover,
.header .nav-link.active {
  color: #00B4D8;
}

.header .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #00B4D8;
}

/* Dropdown styles */
.header .dropdown {
  position: relative;
}

.header .dropdown-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  min-width: 240px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.header .dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
}

.header .dropdown-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #1e293b;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.header .dropdown-link:hover {
  background: #f1f5f9;
  color: #00B4D8;
}

.header .dropdown-link .material-icons {
  font-size: 20px;
  color: #64748b;
}

.header .dropdown-link:hover .material-icons {
  color: #00B4D8;
}

.header .header-cta {
  margin-left: 24px;
}

.header .login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: #00B4D8;
  color: white;
  border-radius: 6px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.header .login-btn:hover {
  background: #0096b7;
  color: #fff;
  transform: translateY(-1px);
}

.header .announcement-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0077B6;
  color: #fff;
  padding: 8px 20px;
  font-size: 14px;
  gap: 12px;
  position: relative;
  z-index: 150;
  width: 100%;
  margin: 0;
}

.header .announcement-bar span {
  background-color: #00B4D8;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.header .announcement-bar p {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  padding: 0;
  line-height: 1.4;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

.header .announcement-link {
  color: #fff;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  opacity: 0.9;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.1);
}

.header .announcement-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

/* Mobile menu. These rules used to live in an inline <style> partial that only seven templates
   remembered to include; without them the hamburger and its panel rendered on desktop too. */
.header .mobile-menu-button {
  background: none;
  border: none;
  font-size: 26px;
  color: #1e293b;
  cursor: pointer;
  display: none;
  margin-left: auto;
}

.header .dropdown-menu-mobile {
  display: none;
  position: absolute;
  /* px, not rem: the course pages run on a theme with a 10px rem base, which shrank this menu's
     offsets to 62.5% of the value used everywhere else. */
  right: 16px;
  top: 70px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  z-index: 9999;
  width: 260px;
}

.header .dropdown-menu-mobile a,
.header .dropdown-menu-mobile button.submenu-toggle {
  display: block;
  width: 100%;
  padding: 10px 15px;
  color: #0A2647;
  text-align: left;
  font-size: 15px;
  background: none;
  border: none;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.header .mobile-submenu {
  display: none;
  padding-left: 16px;
}

.header .mobile-submenu a {
  display: block;
  padding: 8px 15px;
  font-size: 14px;
  color: #333;
  border-bottom: none;
}

.header .announcement-bar-mobile {
  display: none !important;
}

.header .announcement-bar-desktop .announcement-link::after {
  display: none;
}

@media (max-width: 768px) {
  .header .announcement-bar-desktop {
    display: none !important;
  }

  .header .announcement-bar-mobile {
    display: block !important;
  }

  .header .announcement-bar-mobile .announcement-link::after {
    display: none;
  }

  .header .announcement-bar-mobile p {
    font-size: 14px;
  }

  .header .header-cta-desktop {
    display: none;
  }

  .header .mobile-menu-button {
    display: block;
  }
}

/* Add class for header scroll effect */
.header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
  opacity: 0;
}

.header.visible {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .header .main-nav {
    gap: 24px;
  }

  .header .nav-link {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .header .header-container {
    padding: 0 16px;
    height: 64px;
  }

  .header .main-nav {
    display: none;
  }

  .header .header-cta {
    margin-left: 16px;
  }

  .header .login-btn {
    padding: 8px 16px;
    font-size: 14px;
  }

  .header .announcement-bar {
    padding: 8px 16px;
    text-align: center;
    flex-direction: column;
    gap: 6px;
  }

  .header .announcement-bar p {
    font-size: 13px;
    width: 100%;
  }

  .header .announcement-bar span {
    padding: 2px 6px;
    font-size: 11px;
  }

  .header .announcement-link {
    font-size: 13px;
    margin: 2px 0;
  }
}
