/* Header Navigation CSS - Portable across all Alberta Tradesman subdomains */

/* ===== Navigation Menu ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.nav-link:hover::before {
  width: 300px;
  height: 300px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

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

.header-button {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.header-button:hover {
  background: white;
  color: var(--color-sky-blue);
  border-color: white;
  transform: scale(1.05);
}

.header-button.primary {
  background: white;
  color: var(--color-sky-blue);
  border-color: white;
}

.header-button.primary:hover {
  background: var(--color-blue-light);
  color: var(--color-blue-dark);
  transform: translateY(-2px);
}

/* ===== Mobile Menu Toggle ===== */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== Subdomain Dropdown ===== */
.header-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.dropdown-arrow {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.header-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(43, 108, 176, 0.2);
  border-radius: 1rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: var(--z-dropdown, 1001);
  overflow: hidden;
}

.header-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  background: var(--gradient-primary);
  color: white;
  padding: 1rem;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  position: relative;
}

.dropdown-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--color-charcoal);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  position: relative;
  overflow: hidden;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.dropdown-item:hover::before {
  width: 4px;
}

.dropdown-item:hover {
  background: rgba(43, 108, 176, 0.05);
  color: var(--color-sky-blue);
  transform: translateX(5px);
}

.dropdown-item span {
  font-weight: 600;
  font-size: 1rem;
}

.dropdown-item small {
  color: var(--color-gray-500);
  font-size: 0.8rem;
  font-weight: 400;
  margin-left: auto;
}

.dropdown-item.current {
  background: rgba(43, 108, 176, 0.1);
  border-left-color: var(--color-sky-blue);
  font-weight: 700;
}

.dropdown-item.current::after {
  content: '📍';
  margin-left: auto;
  font-size: 1.2rem;
}

.dropdown-item.main-site {
  border-top: 2px solid rgba(43, 108, 176, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(43, 108, 176, 0.2) 20%,
    rgba(221, 107, 32, 0.2) 80%,
    transparent 100%);
  margin: 0.5rem 0;
}

/* ===== Dropdown Animations ===== */
.dropdown-item:nth-child(1) { animation-delay: 0.1s; }
.dropdown-item:nth-child(2) { animation-delay: 0.15s; }
.dropdown-item:nth-child(3) { animation-delay: 0.2s; }
.dropdown-item:nth-child(4) { animation-delay: 0.25s; }
.dropdown-item:nth-child(5) { animation-delay: 0.3s; }
.dropdown-item:nth-child(6) { animation-delay: 0.35s; }

.header-dropdown.open .dropdown-item {
  animation: slide-in-item 0.4s ease-out forwards;
}

@keyframes slide-in-item {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== Responsive Navigation Design ===== */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gradient-primary);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: var(--z-dropdown, 1001);
  }

  .nav-menu.mobile-open {
    display: flex;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  /* Mobile Dropdown Adjustments */
  .dropdown-menu {
    right: -1rem;
    left: -1rem;
    min-width: auto;
    width: calc(100vw - 2rem);
    max-width: 350px;
    margin: 0 auto;
  }

  .dropdown-toggle {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .dropdown-item {
    padding: 0.8rem 1rem;
  }

  .dropdown-item span {
    font-size: 0.9rem;
  }

  .dropdown-item small {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header-actions {
    flex-direction: column;
    gap: 0.3rem;
  }

  .header-button {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  .dropdown-menu {
    right: -2rem;
    left: -2rem;
    width: calc(100vw - 1rem);
  }
}

/* ===== Focus States for Accessibility ===== */
.nav-link:focus,
.header-button:focus,
.mobile-menu-toggle:focus,
.dropdown-toggle:focus {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}