/**
 * Research & Innovation Portal Navbar Stylesheet
 * Senior Creative Direction: Master Website Dark Teal Interface (#073F43)
 */

/* Master Color System Variables - Official Website Theme */
:root {
    --color-deep-teal: #073F43;
    --color-dark-teal: #042C2E;
    --color-primary-teal: #08777A;
    --color-turquoise: #11AEB0;
    --color-aqua: #55E6E2;
    --color-light-aqua: #9AF3EE;

    --color-white: #FFFFFF;
    --color-soft-white: #FAFAFA;

    --color-text: #E0F2F1;
    --color-text-muted: #80CBC4;
    --color-border: rgba(85, 230, 226, 0.25);

    --navbar-height-desktop: 76px;
    --navbar-height-scrolled: 76px;
}

/* Base Header Bar - Solid White Background */
.portal-navbar-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height-desktop);
    background: #FFFFFF !important; /* Pure white background as requested */
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(7, 63, 67, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    transition: background 300ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1),
        border-color 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Atmospheric Line - None */
.portal-navbar-header::before {
    display: none;
}

/* Scrolled State - Solid White Background Maintained */
.portal-navbar-header.scrolled {
    background: #FFFFFF !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-bottom-color: rgba(7, 63, 67, 0.15);
}

/* Navbar Content Container */
.portal-navbar-container {
    height: 100%;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Left Brand Identity - Logo displayed directly on white background */
.portal-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    transition: opacity 200ms ease, transform 200ms ease;
    background: transparent;
    padding: 0;
}

.portal-brand-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.brand-logo-img {
    height: 100px;
    max-height: 100px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-text-wrapper {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    color: #073F43;
    letter-spacing: 0.08em;
    line-height: 1;
}

.brand-subtitle {
    font-family: var(--font-heading);
    font-size: 10.5px;
    font-weight: 700;
    color: #08777A;
    letter-spacing: 0.18em;
    margin-top: 0.2rem;
    line-height: 1;
}

/* Center Desktop Main Navigation - Streamlined Capsule */
.portal-desktop-nav {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 4px 8px;
    list-style: none;
    background: #FFFFFF;
    border-radius: 40px;
    border: 1.5px solid #073F43; /* Website theme color border */
    box-shadow: 0 3px 12px rgba(7, 63, 67, 0.06);
}

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

.nav-link {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 600;
    color: #073F43; /* Website theme color text */
    text-decoration: none;
    position: relative;
    padding: 6px 15px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.nav-link:hover {
    color: #08777A;
    background: #E8F5F5;
}

/* Active Navigation State - Solid Website Teal Capsule with Pure White Text */
.nav-link.active {
    color: #FFFFFF !important;
    background: #073F43;
    box-shadow: 0 2px 10px rgba(7, 63, 67, 0.25);
}

/* Right Navbar Action Tools */
.portal-navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Quick Find Control */
.nav-quick-find-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    background: #FFFFFF;
    border: 1.5px solid #073F43;
    border-radius: 8px;
    color: #073F43;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-quick-find-btn svg {
    stroke: #073F43;
    transition: stroke 200ms ease;
}

.nav-quick-find-btn:hover {
    border-color: #073F43;
    background: #073F43;
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(7, 63, 67, 0.2);
    transform: translateY(-1px);
}

.nav-quick-find-btn:hover svg {
    stroke: #FFFFFF;
}

.nav-quick-find-btn:hover .quick-find-label {
    color: #FFFFFF;
}

.quick-find-label {
    color: #073F43;
    transition: color 200ms ease;
}

/* Dedicated Login CTA Button - Solid Primary Teal */
.nav-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    background: #073F43;
    border: 1.5px solid #073F43;
    border-radius: 8px;
    color: #FFFFFF !important;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(7, 63, 67, 0.2);
    transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

.nav-login-btn svg {
    stroke: #FFFFFF;
}

.nav-login-btn:hover {
    background: #08777A;
    border-color: #08777A;
    box-shadow: 0 4px 18px rgba(8, 119, 122, 0.35);
    transform: translateY(-1px);
    color: #FFFFFF !important;
}

.mobile-login-highlight {
    font-weight: 700 !important;
    color: #55E6E2 !important;
}

/* Refined Dark-Teal Gradient Explore Projects CTA */
.portal-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    background: #08777A;
    border: none;
    border-radius: 6px;
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(7, 63, 67, 0.22);
    transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.portal-cta-btn:hover {
    background: #059669;
    box-shadow: 0 8px 25px rgba(7, 63, 67, 0.32);
    transform: translateY(-1px);
    color: #FFFFFF;
}

.cta-arrow-icon {
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.portal-cta-btn:hover .cta-arrow-icon {
    transform: translateX(4px);
}

/* Mobile Hamburger Toggle */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-bar {
    width: 100%;
    height: 2.5px;
    background-color: #073F43;
    border-radius: 2px;
    transition: all 200ms ease;
}

/* Video-to-Navbar Staggered Entrance Keyframes (Specification Step 15) */
@keyframes navFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-entrance-active .nav-brand-anim {
    animation: navFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.30s forwards;
    opacity: 0;
}

.nav-entrance-active .nav-menu-anim {
    animation: navFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.40s forwards;
    opacity: 0;
}

.nav-entrance-active .nav-quickfind-anim {
    animation: navFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
    opacity: 0;
}

.nav-entrance-active .nav-cta-anim {
    animation: navFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.70s forwards;
    opacity: 0;
}

/* Mobile Full-Screen Dark-Teal Navigation Panel */
.mobile-offcanvas-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 300ms ease, opacity 300ms ease;
}

.mobile-offcanvas-drawer.open {
    visibility: visible;
    opacity: 1;
}

.offcanvas-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.offcanvas-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 88%;
    max-width: 380px;
    height: 100%;
    background: #073F43;
    border-left: 1px solid rgba(85, 230, 226, 0.2);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: right 350ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
}

.mobile-offcanvas-drawer.open .offcanvas-content {
    right: 0;
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(85, 230, 226, 0.15);
}

.offcanvas-close-btn {
    font-size: 2rem;
    color: var(--color-white);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.mobile-menu-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0;
    list-style: none;
}

.mobile-nav-link {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-white);
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
    transition: color 200ms ease;
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
    color: #55E6E2;
    font-weight: 700;
    text-decoration: underline;
}

.offcanvas-footer {
    margin-top: auto;
    padding-top: 2rem;
}

/* ============================================================
 * MODAL QUICK SEARCH OVERLAY (CENTERED & PROPER THEME COLOR)
 * ============================================================ */
.quick-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex !important;
    justify-content: center !important; /* Centered horizontally */
    align-items: center !important;     /* Centered vertically in viewport */
    padding: 20px;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: visibility 250ms ease, opacity 250ms ease;
}

.quick-search-modal.active {
    visibility: visible;
    opacity: 1;
}

.search-modal-backdrop {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 44, 46, 0.85); /* Master dark teal backdrop */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.search-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 740px;
    margin: 0 auto !important; /* Center part */
    background: #073F43 !important; /* Proper website theme color code */
    border: 1.5px solid rgba(85, 230, 226, 0.4) !important;
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(2, 23, 25, 0.75), 0 0 35px rgba(85, 230, 226, 0.15) !important;
    overflow: hidden;
    z-index: 10;
    transform: scale(0.96) translateY(0);
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), opacity 250ms ease;
}

.quick-search-modal.active .search-modal-dialog {
    transform: scale(1) translateY(0);
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.75rem;
    background: #042C2E; /* Dark teal accent header strip */
    border-bottom: 1px solid rgba(85, 230, 226, 0.2);
}

.search-input-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.search-input-box svg {
    stroke: #55E6E2 !important;
}

.search-input-box input {
    width: 100%;
    color: #FFFFFF !important;
    font-size: 1.15rem;
    font-weight: 500;
    background: transparent;
    border: none;
    outline: none;
}

.search-input-box input::placeholder {
    color: #80CBC4 !important;
}

.search-modal-close {
    font-size: 2rem;
    color: #55E6E2;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.85;
    transition: all 200ms ease;
    line-height: 1;
    padding: 0 4px;
}

.search-modal-close:hover {
    opacity: 1;
    color: #FFFFFF;
    transform: scale(1.1);
}

/* Prepared Visual Categories */
.search-modal-categories {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    background: #053336;
    border-bottom: 1px solid rgba(85, 230, 226, 0.15);
    overflow-x: auto;
}

.search-cat-pill {
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #B2DFDB;
    background: rgba(4, 44, 46, 0.8);
    border: 1px solid rgba(85, 230, 226, 0.25);
    cursor: pointer;
    white-space: nowrap;
    transition: all 200ms ease;
}

.search-cat-pill:hover {
    background: #08777A;
    color: #FFFFFF;
    border-color: #55E6E2;
}

.search-cat-pill.active {
    background: #08777A;
    color: #FFFFFF;
    border-color: #55E6E2;
    box-shadow: 0 0 12px rgba(85, 230, 226, 0.3);
}

.search-modal-results {
    padding: 2rem;
    max-height: 420px;
    overflow-y: auto;
    background: #073F43;
}

.search-prompt-text {
    color: #B2DFDB;
    opacity: 0.85;
    font-size: 0.95rem;
    text-align: center;
}

/* Keyboard Focus Accessibility State */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #55E6E2 !important;
    outline-offset: 3px !important;
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .portal-navbar-container {
        padding: 0 28px;
    }

    .nav-menu {
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .portal-desktop-nav {
        display: none !important;
    }

    .mobile-nav-toggle {
        display: flex !important;
    }

    .portal-cta-btn {
        padding: 0 16px;
    }

    /* Hide Search & Login buttons in header on mobile screens - show menu icon ONLY */
    .portal-navbar-header .portal-navbar-actions .nav-quick-find-btn,
    .portal-navbar-header .portal-navbar-actions .nav-login-btn {
        display: none !important;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height-desktop: 68px;
        --navbar-height-scrolled: 68px;
    }

    .portal-navbar-container {
        padding: 0 16px;
    }

    .brand-logo-img {
        height: 64px;
        max-height: 64px;
    }

    .quick-find-label {
        display: none;
    }
}

/* Reduced Motion Handling */
@media (prefers-reduced-motion: reduce) {
    .portal-navbar-header,
    .nav-link,
    .portal-cta-btn,
    .brand-logo-icon,
    .nav-link::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}