/* ============================================
   SHARED NAVBAR — Hostmate
   Single source of truth for all pages
   ============================================ */

/* ── Base — transparent over hero ── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    height: 96px;
    display: flex;
    align-items: center;
    transition: background 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── Scrolled (past hero) — solid white ── */
.navbar.scrolled {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--gray-200);
}

/* ── navbar-light — on light hero (transparent bg, dark text) ── */
.navbar.navbar-light {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.navbar.navbar-light.scrolled {
    border-bottom-color: var(--gray-200);
}

/* ── Bottom fade gradient (only on dark hero, not scrolled) ── */
.navbar::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(12, 16, 37, 0.35), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar:not(.scrolled):not(.navbar-light)::after {
    opacity: 0;
}

.navbar.scrolled::after,
.navbar.navbar-light::after {
    opacity: 0;
}

/* ── Container ── */
.navbar .container {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 48px;
    max-width: 100%;
    padding: 0 48px;
}

/* ── Logo ── */
.navbar-logo {
    display: flex;
    align-items: baseline;
    gap: 1px;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-logo .logo-host {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    transition: color 0.35s ease;
}

.navbar-logo .logo-mate {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    transition: color 0.35s ease;
}

.navbar-logo .logo-dot {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 1px;
}

.navbar-logo .logo-ai {
    font-size: 13px;
    font-weight: 300;
    color: #fff;
    position: relative;
    top: -12px;
    margin-left: 2px;
    letter-spacing: 0.5px;
    transition: color 0.35s ease;
}

/* ── Links ── */
.navbar-links {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
    height: 100%;
    margin: 0;
    padding: 0;
}

.navbar-links > li {
    height: 100%;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    position: relative;
}

.navbar-links > li > a {
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 4px;
    transition: color var(--transition-fast);
}

.navbar-links > li > a:hover { color: #fff; }

.navbar-links .chevron {
    width: 10px;
    height: 10px;
    opacity: 0.5;
    transition: opacity var(--transition-fast), transform 0.3s ease;
}

.navbar-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
}
.navbar.scrolled .navbar-submenu-toggle,
.navbar.navbar-light .navbar-submenu-toggle,
.navbar.mega-active .navbar-submenu-toggle { color: var(--gray-700); }
.navbar-submenu-toggle:hover .chevron { opacity: 0.8; }
.navbar-links > li > a:focus-visible,
.navbar-submenu-toggle:focus-visible,
.mobile-menu__link:focus-visible,
.mobile-menu__toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 8px;
}

/* ── Actions ── */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-left: auto;
    flex-shrink: 0;
}

.navbar-actions .login-link,
.navbar-actions .login-link:link,
.navbar-actions .login-link:visited,
.navbar-actions .login-link:active {
    font-size: 17px;
    font-weight: 500;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    -webkit-text-decoration: none !important;
    transition: opacity var(--transition-fast), color 0.35s ease;
}

.navbar-actions .login-link span {
    font-size: 18px;
    transition: transform var(--transition-fast);
}

.navbar-actions .login-link:hover { opacity: 0.85; }
.navbar-actions .login-link:hover span { transform: translateX(3px); }

/* ── Scrolled text colors (dark text on white bg) ── */
.navbar.scrolled .logo-host,
.navbar.scrolled .logo-mate {
    color: var(--gray-900);
}

.navbar.scrolled .logo-ai {
    color: var(--blue-600);
}

.navbar.scrolled .navbar-links > li > a {
    color: var(--gray-700);
}

.navbar.scrolled .navbar-links > li > a:hover {
    color: var(--gray-900);
}

.navbar.scrolled .navbar-links .chevron {
    color: var(--gray-500);
    opacity: 1;
}

.navbar.scrolled .navbar-actions .login-link,
.navbar.scrolled .navbar-actions .login-link:link,
.navbar.scrolled .navbar-actions .login-link:visited {
    color: var(--gray-900) !important;
}

.navbar.scrolled .navbar-actions .login-link:hover {
    color: var(--gray-900) !important;
    opacity: 0.7;
}

/* ── navbar-light text colors (dark text, for light hero) ── */
.navbar.navbar-light .logo-host,
.navbar.navbar-light .logo-mate {
    color: var(--gray-900);
}

.navbar.navbar-light .logo-ai {
    color: var(--blue-600);
}

.navbar.navbar-light .navbar-links > li > a {
    color: var(--gray-700);
}

.navbar.navbar-light .navbar-links > li > a:hover {
    color: var(--gray-900);
}

.navbar.navbar-light .navbar-links .chevron {
    color: var(--gray-500);
    opacity: 1;
}

.navbar.navbar-light .navbar-actions .login-link,
.navbar.navbar-light .navbar-actions .login-link:link,
.navbar.navbar-light .navbar-actions .login-link:visited {
    color: var(--gray-900) !important;
}

.navbar.navbar-light .navbar-actions .login-link:hover {
    color: var(--gray-900) !important;
    opacity: 0.7;
}

/* ── Mega Menu ── */
.mega-menu {
    position: fixed;
    top: 96px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    padding: 40px 0 48px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.1s ease;
    z-index: 200;
}

.has-mega.mega-open .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.has-mega > a {
    position: relative;
}

.has-mega::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--blue-600);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.15s ease;
}

.has-mega.mega-open::after {
    transform: scaleX(1);
}

.has-mega.mega-open > .navbar-submenu-toggle .chevron {
    transform: rotate(180deg);
}

/* ── Mega-active override (mega menu open) ── */
.navbar.mega-active {
    background: #fff !important;
    backdrop-filter: none !important;
    border-bottom-color: var(--gray-200) !important;
}

.navbar.mega-active .logo-host,
.navbar.mega-active .logo-mate {
    color: var(--gray-900);
}

.navbar.mega-active .navbar-links > li > a {
    color: var(--gray-700);
}

.navbar.mega-active .navbar-links > li > a:hover {
    color: var(--gray-900);
}

.navbar.mega-active .navbar-links .chevron {
    color: var(--gray-500);
}

.navbar.mega-active .navbar-actions .login-link,
.navbar.mega-active .navbar-actions .login-link:link,
.navbar.mega-active .navbar-actions .login-link:visited {
    color: var(--gray-700) !important;
}

.navbar.mega-active .logo-ai {
    color: var(--blue-600);
}

.navbar.mega-active::after {
    opacity: 0 !important;
}

/* ── Mega Menu Inner ── */
.mega-menu__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.mega-menu--2col .mega-menu__inner {
    grid-template-columns: repeat(2, 1fr);
}

.mega-menu__col-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--blue-600);
    margin-bottom: 20px;
}

.mega-menu__items {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mega-menu__link {
    text-decoration: none;
    display: block;
    transition: opacity var(--transition-fast);
}

.mega-menu__link:hover {
    opacity: 0.7;
}

.mega-menu__link-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.mega-menu__link-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--gray-500);
    line-height: 1.4;
    margin-top: 3px;
}

.mega-menu__badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-100);
    border-radius: 100px;
    padding: 1px 6px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.5;
}

/* ── Buttons (navbar variants) ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--button-radius);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 50%, var(--accent-light) 100%);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-nav {
    padding: 11px 24px;
    font-size: 16px;
}

/* ── Hamburger button (hidden on desktop) ── */
.navbar-hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    z-index: 101;
    -webkit-tap-highlight-color: transparent;
}
.navbar-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    pointer-events: none;
}
.navbar.scrolled .navbar-hamburger span,
.navbar.navbar-light .navbar-hamburger span {
    background: var(--gray-900);
}

/* Hamburger → X animation */
.navbar-hamburger.active span {
    background: var(--gray-900);
}
.navbar-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.navbar-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.navbar-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Mobile Menu Drawer ── */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 99;
    padding: 100px 32px 40px;
    flex-direction: column;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    overflow-y: auto;
}
.mobile-menu.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu__links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-left: -32px;
    margin-right: -32px;
}
.mobile-menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 32px;
    font-size: 18px;
    font-weight: 500;
    font-family: inherit;
    color: var(--gray-900);
    text-decoration: none;
    background: none;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu__heading {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--gray-100);
}
.mobile-menu__heading .mobile-menu__link {
    flex: 1;
    width: auto;
    border-bottom: 0;
    padding-right: 16px;
}
.mobile-menu__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 64px;
    min-height: 64px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu__toggle svg {
    color: var(--gray-400);
    transition: transform 0.3s ease;
}
.mobile-menu__item.open .mobile-menu__toggle svg {
    transform: rotate(90deg);
}
.mobile-menu__link:hover {
    color: var(--blue-600);
}

/* ── Mobile Sub-menu (accordion) ── */
.mobile-menu__sub {
    display: flex;
    flex-direction: column;
    max-height: 0;
    visibility: hidden;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding-left: 32px;
    padding-right: 32px;
}
.mobile-menu__item.open .mobile-menu__sub {
    max-height: 2000px;
    visibility: visible;
}
.mobile-menu__sub-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--blue-600);
    padding: 24px 0 12px;
    margin: 0;
}
.mobile-menu__sub a {
    display: block;
    padding: 14px 0;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}
.mobile-menu__sub a:hover {
    opacity: 0.7;
}
.mobile-menu__sub-link-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}
.mobile-menu__sub-link-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--gray-500);
    line-height: 1.4;
    margin-top: 2px;
}

.mobile-menu__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 32px;
}
.mobile-menu__btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 16px;
}
.mobile-menu__login {
    font-size: 16px;
    font-weight: 500;
    color: var(--blue-600);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.mobile-menu__login span {
    transition: transform 0.2s ease;
}
.mobile-menu__login:hover span {
    transform: translateX(3px);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .navbar-links { display: none; }
    .navbar .container { padding: 0 24px; }
    .navbar-hamburger { display: flex; }
    .navbar-actions { display: none; }
}

@media (max-width: 768px) {
    .navbar { height: 72px; }
    .mega-menu { top: 72px; }
    .navbar .container { gap: 16px; }
    .navbar-logo .logo-host,
    .navbar-logo .logo-mate { font-size: 24px; }
    .navbar-logo .logo-ai { font-size: 11px; top: -10px; }
    .mobile-menu { padding-top: 88px; }
}
