/* 
 * header-2025.css
 * Modern responsive header styling for EventsXP
 * Created: October 2025
 */

/* Header Variables */
:root {
  --header-bg: var(--color-white); /* White background */
  --header-bg-scrolled: var(--color-white); /* White background when scrolled */
  --header-height: 80px;
  --header-height-mobile: 70px;
  --header-border-color: var(--color-border);
  --header-shadow: none;
  --header-shadow-scrolled: 0 4px 10px rgba(0, 0, 0, 0.05);
  --header-transition: all 0.3s ease;
  --menu-transition: transform 0.3s ease-in-out;
}

/* Base Header Styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: #ffffff !important;
  border-bottom: 1px solid var(--header-border-color);
  box-shadow: var(--header-shadow);
  z-index: 1000;
  transition: var(--header-transition);
}

.site-header.scrolled {
  background-color: #ffffff !important;
  border-bottom-color: var(--header-border-color);
  box-shadow: var(--header-shadow-scrolled);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  font-family: var(--font-family-base);
}

/* Logo Styles */
.logo-wrapper {
  flex-shrink: 0;
}

.logo-link {
  display: block;
}

.logo-link img {
  display: block;
  height: auto;
  max-height: 60px;
  width: auto;
}

/* Ensure all header text uses Nunito Sans */
.site-header,
.site-header * {
  font-family: var(--font-family-base);
}

/* Main Navigation */
.main-nav {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-item > a {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 100%;
  color: var(--color-text-soft);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
  transition: color 0.2s ease;
  position: relative;
  font-family: var(--font-family-base);
}

.nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-brand-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.nav-item > a:hover {
  color: var(--color-brand-primary);
}

.nav-item > a:hover::after,
.nav-item > a.active::after {
  transform: scaleX(1);
}

/* Dropdown Menu */
.nav-item .submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  z-index: 100;
}

.nav-item:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.submenu li {
  display: block;
  margin: 0;
  padding: 0;
}

.submenu li a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-regular);
  font-family: var(--font-family-base);
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}

.submenu li a:hover {
  background-color: var(--color-brand-tint);
  color: var(--color-brand-primary);
}

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

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-brand-primary);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-sm);
  transition: all 0.2s ease;
}

.cta-button:hover {
  background-color: var(--color-brand-primary-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(19, 142, 158, 0.2);
}

/* Header CTA Button - Responsive */
.header-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-brand-primary);
  color: #ffffff !important;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-sm);
  font-family: var(--font-family-base);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.header-cta-button .cta-text {
  color: #ffffff !important;
  font-weight: var(--font-weight-semibold);
}

.header-cta-button:hover {
  background-color: var(--color-brand-primary-soft);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.header-cta-button i {
  font-size: 0.875rem;
  color: #ffffff !important;
  transition: transform 0.3s ease;
}

.header-cta-button:hover i {
  transform: translateX(2px);
  color: #ffffff !important;
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family-base);
  color: var(--color-text-soft);
  position: relative;
  z-index: 1002;
}

/* Mobile Menu Icon */
.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--color-brand-primary);
  transition: all 0.3s ease;
}

.mobile-toggle.active .hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

.mobile-toggle.active .hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .site-header {
    height: var(--header-height-mobile);
  }

  .nav-item > a {
    padding: 0 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 900px) {
  .cta-button {
    padding: 0.5rem 1rem;
  }
}

/* Tablet responsiveness for header CTA */
@media (max-width: 1024px) and (min-width: 769px) {
  .header-cta-button {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }

  .logo-link img {
    max-height: 52px;
  }
}

@media (max-width: 768px) {
  /* Mobile Menu Styles */
  .mobile-toggle {
    display: flex;
    align-items: center;
  }

  /* Responsive Header CTA */
  .header-cta-button {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }

  /* Responsive Logo Size */
  .logo-link img {
    max-height: 48px;
  }
}

/* Hide CTA text only on very small screens */
@media (max-width: 480px) {
  .header-cta-button .cta-text {
    display: none; /* Hide text on small mobile screens only */
  }

  .mobile-toggle span:not(.hamburger span) {
    display: none; /* Hide text, show only icon */
  }

  .mobile-toggle .hamburger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 350px;
    height: 100vh;
    background-color: var(--color-surface); /* Pure white from brand tokens */
    z-index: 1000;
    display: block;
    transform: translateX(100%);
    transition: var(--menu-transition);
    padding-top: var(--header-height-mobile);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Better scrolling on iOS */
  }

  .main-nav.active {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    height: auto;
    width: 100%;
    padding: 1rem 0;
  }

  .nav-item {
    height: auto;
    width: 100%;
  }

  .nav-item > a {
    height: auto;
    width: 100%;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 500;
  }

  .nav-item > a::after {
    display: none;
  }

  /* Mobile Dropdown */
  .nav-item .submenu {
    position: static;
    transform: none;
    box-shadow: none;
    opacity: 1;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(
      --color-surface-alt
    ); /* Light background from brand tokens */
    border-left: 3px solid var(--color-brand-primary); /* Brand accent */
    border-radius: 0;
  }

  .nav-item.active .submenu {
    visibility: visible;
    max-height: 500px;
  }

  .submenu li a {
    padding: 0.75rem 2.5rem;
    font-size: 0.95rem;
    background-color: var(--color-surface-alt);
  }

  /* Hide CTA button in header actions */
  .header-actions .cta-button {
    display: none;
  }

  /* Add CTA to mobile menu */
  .mobile-cta {
    padding: 1.5rem;
    width: 100%;
    display: flex;
  }

  .mobile-cta .cta-button {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0.75rem 1.5rem;
  }
}

/* Force white background on all header states */
header.site-header,
.site-header,
#site-header {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* Body padding adjustment */
body {
  padding-top: var(--header-height);
}

@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile);
  }
}
