/* ── SHARED NAV ── */

#mainNav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6%;
    transition: background 300ms ease, box-shadow 300ms ease;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
}

#mainNav.scrolled {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #eef0f8;
    box-shadow: 0 1px 16px rgba(0, 0, 0, 0.05);
}

/* ── LOGO ── */
#mainNav .logo {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity 150ms ease;
}
#mainNav .logo:hover { opacity: 0.75; }

#mainNav .logo-img {
    width: 220px;
    height: 42px;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* ── NAV LINKS ── */
#mainNav .nav-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

#mainNav .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: color 150ms ease;
    white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
    #mainNav .nav-link:hover { color: #111; }
}

#mainNav .nav-link--accent {
    color: #3B5BDB;
    font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
    #mainNav .nav-link--accent:hover { color: #2f4ac0; }
}

/* Primary CTA — sits at the far right, visually distinct */
#mainNav .nav-cta {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #3B5BDB;
    padding: 8px 18px;
    border-radius: 100px;
    white-space: nowrap;
    margin-left: 8px;
    transition: background 150ms ease, opacity 150ms ease;
}
#mainNav .nav-cta:active { opacity: 0.75; }
@media (hover: hover) and (pointer: fine) {
    #mainNav .nav-cta:hover { background: #2f4ac0; }
}

/* ── HAMBURGER ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .hamburger:hover { background: #f0f0f0; }
}
.hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: #111;
    border-radius: 2px;
    transform-origin: center;
    transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 12px 6% 16px;
    z-index: 199;
    flex-direction: column;
    gap: 2px;
    animation: navSlideDown 200ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.mobile-menu.open { display: flex; }

@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-link {
    display: block;
    padding: 11px 4px;
    font-size: 15px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    border-radius: 8px;
    transition: color 150ms ease;
    font-family: inherit;
}
@media (hover: hover) and (pointer: fine) {
    .mobile-link:hover { color: #111; }
}

.mobile-link--accent { color: #3B5BDB; font-weight: 600; }

.mobile-divider { height: 1px; background: #eee; margin: 8px 0; }

.mobile-cta {
    display: block;
    text-align: center;
    background: #3B5BDB;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 13px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 150ms ease;
    font-family: inherit;
}
@media (hover: hover) and (pointer: fine) {
    .mobile-cta:hover { background: #2f4ac0; }
}

/* ── USER CHIP ── */
.nav-user-wrap {
    position: relative;
}

.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 1.5px solid #e2e6f3;
    border-radius: 100px;
    padding: 5px 12px 5px 5px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 150ms ease, background 150ms ease;
}
.nav-user-btn:active { opacity: 0.7; }
@media (hover: hover) and (pointer: fine) {
    .nav-user-btn:hover { background: #f5f7ff; border-color: #c8cfe8; }
}

.nav-user-av {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #3B5BDB;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e8eaf2;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
    min-width: 160px;
    overflow: hidden;
    z-index: 200;
    transform-origin: top right;
    animation: navMenuIn 160ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.nav-user-menu.open { display: block; }

.nav-user-item {
    display: block;
    width: 100%;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #111;
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f8;
    transition: background 120ms ease;
}
.nav-user-item:last-child { border-bottom: none; }
@media (hover: hover) and (pointer: fine) {
    .nav-user-item:hover { background: #f7f8fc; }
}

.nav-user-logout { color: #dc2626; }

/* mobile logout button */
.mobile-logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    color: #dc2626;
    cursor: pointer;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    #mainNav .nav-right { display: none; }
    .hamburger          { display: flex; }
}
