/**
 * Shared Navigation Styles — single header + footer for all consumer pages.
 * Must override any leftover inline nav{} element styles from legacy HTML pages.
 */

:root {
  --nav-navy: #0b1a2e;
  --nav-amber: #f0a830;
  --nav-white: #fff;
  --nav-text: #1e293b;
  --nav-slate: #64748b;
  --nav-sand: #faf7f0;
  --nav-border: rgba(255, 255, 255, 0.06);
  --nav-hover: rgba(255, 255, 255, 0.1);
}

/* ─── HEADER ─── */
.shared-nav-wrap {
  background: var(--nav-navy);
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(11, 26, 46, 0.1);
  /* Reset any inline nav{} element styles from legacy pages */
  padding: 0;
  display: block;
  max-width: none;
  margin: 0;
}

.shared-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.shared-nav-logo {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--nav-white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.shared-nav-logo:hover {
  opacity: 0.9;
}

.shared-nav-logo span {
  color: var(--nav-amber);
}

/* ─── NAV LINKS (desktop) ─── */
.shared-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}

.shared-nav-link {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', -apple-system, sans-serif;
  white-space: nowrap;
}

.shared-nav-link:hover {
  color: var(--nav-white);
  background: var(--nav-hover);
}

.shared-nav-link--active {
  color: var(--nav-amber);
  font-weight: 600;
}

/* ─── DROPDOWN ─── */
.shared-nav-dropdown {
  position: relative;
}

.shared-nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.shared-nav-caret {
  font-size: 0.55rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.shared-nav-dropdown--open .shared-nav-caret {
  transform: rotate(180deg);
}

.shared-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--nav-navy);
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(11, 26, 46, 0.2);
  z-index: 1001;
}

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

.shared-nav-dropdown-item {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

.shared-nav-dropdown-item:first-child {
  border-radius: 7px 7px 0 0;
}

.shared-nav-dropdown-item:last-child {
  border-radius: 0 0 7px 7px;
}

.shared-nav-dropdown-item:hover {
  color: var(--nav-white);
  background: var(--nav-hover);
}

.shared-nav-dropdown-item--active {
  color: var(--nav-amber);
  font-weight: 600;
}

/* ─── ACTIONS (Get Started / profile) ─── */
.shared-nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.shared-nav-cta {
  background: var(--nav-amber);
  color: var(--nav-navy);
  font-weight: 700;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.2s ease;
  display: inline-block;
  white-space: nowrap;
}

.shared-nav-cta:hover {
  background: #ffd56b;
}

/* ─── PROFILE DROPDOWN ─── */
.shared-nav-profile {
  position: relative;
}

.shared-nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nav-amber);
  color: var(--nav-navy);
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.shared-nav-avatar:hover {
  opacity: 0.9;
}

.shared-nav-profile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--nav-navy);
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(11, 26, 46, 0.2);
  z-index: 1001;
}

.shared-nav-avatar[aria-expanded="true"] ~ .shared-nav-profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.shared-nav-profile-email {
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--nav-border);
  word-break: break-all;
}

.shared-nav-profile-item {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  transition: color 0.2s ease, background 0.2s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

.shared-nav-profile-item:hover {
  color: var(--nav-white);
  background: var(--nav-hover);
}

.shared-nav-profile-item:last-child {
  border-radius: 0 0 7px 7px;
}

/* ─── HAMBURGER (mobile) ─── */
.shared-nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-shrink: 0;
}

.shared-nav-hamburger span {
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.shared-nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.shared-nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.shared-nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── MOBILE MENU ─── */
.shared-nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--nav-navy);
  border-top: 1px solid var(--nav-border);
  padding: 0.5rem 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.shared-nav-mobile--open {
  max-height: 600px;
  padding: 0.5rem 0 1rem;
}

.shared-nav-mobile .shared-nav-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 2rem;
  border-radius: 0;
}

.shared-nav-mobile-section-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.shared-nav-mobile-section--open .shared-nav-mobile-section-items {
  max-height: 200px;
}

.shared-nav-mobile-section--open .shared-nav-caret {
  transform: rotate(180deg);
}

.shared-nav-sub-link {
  padding-left: 3rem !important;
  font-size: 0.825rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.shared-nav-sub-link:hover {
  color: var(--nav-white) !important;
}

.shared-nav-mobile-actions {
  border-top: 1px solid var(--nav-border);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* ─── FOOTER ─── */
.shared-footer {
  background: var(--nav-navy);
  color: var(--nav-white);
  border-top: 1px solid var(--nav-border);
  margin-top: 4rem;
  padding: 3rem 2rem 1.5rem;
}

.shared-footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.shared-footer-section h3 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--nav-white);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shared-footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.shared-footer-section li {
  margin-bottom: 0.5rem;
}

.shared-footer-section a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.shared-footer-section a:hover {
  color: var(--nav-amber);
}

.shared-footer-bottom {
  border-top: 1px solid var(--nav-border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.shared-footer-bottom p {
  margin: 0.25rem 0;
}

/* ─── MOBILE (≤768px) ─── */
@media (max-width: 768px) {
  .shared-nav-container {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .shared-nav-logo {
    font-size: 1.1rem;
  }

  .shared-nav-hamburger {
    display: flex;
  }

  .shared-nav-links {
    display: none;
  }

  .shared-nav-actions {
    display: none;
  }

  .shared-nav-mobile {
    display: flex;
  }

  .shared-footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

/* ─── SMALL MOBILE (≤480px) ─── */
@media (max-width: 480px) {
  .shared-nav-container {
    padding: 0.65rem 0.75rem;
  }

  .shared-nav-logo {
    font-size: 1rem;
  }

  .shared-nav-mobile .shared-nav-link {
    font-size: 0.8rem;
    padding: 0.65rem 1.25rem;
  }

  .shared-footer {
    padding: 2rem 1rem 1rem;
  }

  .shared-footer-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .shared-footer-section h3 {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .shared-footer-section a {
    font-size: 0.8rem;
  }

  .shared-footer-bottom {
    font-size: 0.75rem;
    padding-top: 1rem;
  }
}
