/* ==========================================================================
   Top Announcement Bar & Header Navigation
   ========================================================================== */

/* Topbar */
.top-bar {
  background: var(--primary-900);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.825rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 101;
  width: 100%;
  max-width: 100%;
}

[data-theme="dark"] .top-bar {
  background: #050a10;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .top-bar {
    padding: 0.35rem 0;
    font-size: 0.725rem;
  }
  .top-bar-inner {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 0.25rem;
  }
  .top-bar-left, .top-bar-right {
    justify-content: center;
    gap: 0.5rem;
  }
  .top-info-item {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .top-info-item.hide-mobile {
    display: none;
  }
}

.top-info-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.top-info-item:hover {
  color: var(--accent-300);
}

.top-info-item svg {
  width: 13px;
  height: 13px;
  stroke: var(--accent-400);
  flex-shrink: 0;
}

.top-badge {
  background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
  color: #ffffff;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  animation: pulseGlow 2s infinite ease-in-out;
}

/* Main Header */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  max-width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  transition: all var(--transition-normal);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
  background: var(--bg-glass);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 1rem;
  width: 100%;
  max-width: var(--container-max);
}

@media (max-width: 768px) {
  .header-container {
    height: 64px;
    gap: 0.5rem;
  }
}

/* Brand / Logo */
.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .brand-logo-img {
    width: 38px;
    height: 38px;
  }
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-700);
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .brand-name {
    font-size: 0.8rem;
  }
}

[data-theme="dark"] .brand-name {
  color: #ffffff;
}

.brand-tagline {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .brand-tagline {
    font-size: 0.625rem;
  }
}

@media (max-width: 360px) {
  .brand-tagline {
    font-size: 0.575rem;
  }
}

/* Navigation Links */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 1024px) {
  .desktop-nav {
    display: none;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active {
  color: var(--primary-300);
  background: rgba(13, 148, 136, 0.15);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: var(--primary-600);
  border-radius: 2px;
}

[data-theme="dark"] .nav-link.active::after {
  background: var(--primary-400);
}

/* Dropdown */
.nav-dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 240px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  z-index: 105;
}

.nav-dropdown-wrapper:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--primary-50);
}

[data-theme="dark"] .dropdown-item:hover {
  background: rgba(13, 148, 136, 0.15);
}

.dropdown-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown-item:hover .dropdown-item-title {
  color: var(--primary-600);
}

[data-theme="dark"] .dropdown-item:hover .dropdown-item-title {
  color: var(--primary-300);
}

.dropdown-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* On mobile, hide the desktop CTA button so it does NOT push the menu button off screen */
@media (max-width: 768px) {
  .header-actions .btn-primary {
    display: none;
  }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--primary-600);
  border-color: var(--primary-400);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
  }
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
}

/* Mobile Drawer */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 320px;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  padding: 1.25rem;
  overflow-y: auto;
}

.mobile-drawer-overlay.open .mobile-drawer {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: var(--primary-50);
  color: var(--primary-700);
}

[data-theme="dark"] .mobile-nav-link:hover, [data-theme="dark"] .mobile-nav-link.active {
  background: rgba(13, 148, 136, 0.15);
  color: var(--primary-300);
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
