/* ==========================================================================
   NAVIGATION BAR STYLES
   ========================================================================== */

.site-navbar {
    position: fixed;
    top: 12px;
    left: 50%;
    z-index: 9999;
    width: calc(100% - 48px);
    max-width: 1400px;
    transform: translateX(-50%);
    transition: 
        top var(--transition-normal, 0.3s ease),
        width var(--transition-normal, 0.3s ease),
        transform var(--transition-normal, 0.3s ease);
}

/* Solid White Outer Bar */
.navbar-inner {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    height: 80px;
    padding: 0 16px 0 0;
    background: #ffffff; /* Guaranteed solid white background */
    border: 1px solid rgba(23, 111, 145, 0.12);
    border-radius: var(--navbar-radius, 20px);
    box-shadow: 0 8px 30px rgba(13, 50, 66, 0.08);
}

.navbar-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 80px;
    overflow: hidden;
    border-radius: var(--navbar-radius, 20px) 0 0 var(--navbar-radius, 20px);
    text-decoration: none;
}

.navbar-logo {
    display: block;
    width: 40px;
    height: 40px;
    max-width: 100%;
    object-fit: contain;
    transition: transform var(--transition-normal, 0.3s ease);
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.04);
}

/* Links Container */
.navbar-navigation {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    gap: clamp(18px, 2.4vw, 38px);
}

.nav-item {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 0;
    color: var(--iherd-blue, #176f91);
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    border: 0;
    outline: none;
    background: transparent;
    cursor: pointer;
    transition: 
        color var(--transition-fast, 0.15s ease),
        transform var(--transition-fast, 0.15s ease);
}

.nav-item::after {
    position: absolute;
    right: 0;
    bottom: 4px;
    left: 0;
    width: 0;
    height: 2px;
    margin: auto;
    content: "";
    background: var(--iherd-gold, #cfc18c);
    border-radius: 20px;
    transition: width var(--transition-normal, 0.3s ease);
}

.nav-item:hover {
    color: var(--iherd-blue-dark, #0f4c64);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

.nav-item.active {
    color: var(--iherd-gold, #cfc18c);
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-dropdown-button {
    gap: 5px;
    margin: 0;
    padding-right: 0;
    padding-left: 0;
}

.nav-dropdown-button::after {
    display: none;
}

.media-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal, 0.3s ease);
}

.nav-dropdown:hover .media-arrow,
.nav-dropdown.open .media-arrow {
    transform: rotate(180deg);
}

.media-menu {
    position: absolute;
    top: calc(100% - 5px);
    left: 50%;
    display: flex;
    flex-direction: column;
    width: 190px;
    min-width: 190px;
    padding: 9px;
    visibility: hidden;
    opacity: 0;
    transform: translate(-50%, 12px);
    background: #ffffff; /* Solid White Submenu */
    border: 1px solid rgba(23, 111, 145, 0.12);
    border-radius: 15px;
    box-shadow: 0 12px 35px rgba(13, 50, 66, 0.15);
    pointer-events: none;
    transition: 
        opacity var(--transition-normal, 0.3s ease),
        visibility var(--transition-normal, 0.3s ease),
        transform var(--transition-normal, 0.3s ease);
}

.nav-dropdown:hover .media-menu,
.nav-dropdown.open .media-menu {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.media-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 13px;
    overflow: hidden;
    color: var(--iherd-blue, #176f91);
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    border-radius: 9px;
    transition: 
        color var(--transition-fast, 0.15s ease),
        background var(--transition-fast, 0.15s ease),
        padding-left var(--transition-fast, 0.15s ease);
}

.media-link:hover {
    padding-left: 17px;
    color: var(--iherd-blue-dark, #0f4c64);
    background: var(--iherd-blue-light, #f0f7f9);
}

/* Action Button */
.navbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    margin-left: 18px;
}

.signup-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 137px;
    height: 52px;
    padding: 0 18px 0 21px;
    overflow: hidden;
    color: #ffffff;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    background: var(--iherd-blue, #176f91);
    border: 1px solid var(--iherd-blue, #176f91);
    border-radius: 30px;
    outline: none;
    transition: 
        background var(--transition-normal, 0.3s ease),
        border-color var(--transition-normal, 0.3s ease),
        transform var(--transition-normal, 0.3s ease),
        box-shadow var(--transition-normal, 0.3s ease);
}

.signup-button:hover {
    background: var(--iherd-blue-dark, #0f4c64);
    border-color: var(--iherd-blue-dark, #0f4c64);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(23, 111, 145, 0.28);
}

.signup-text {
    display: inline-block;
}

.signup-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transform: translateX(0);
    transition: transform var(--transition-normal, 0.3s ease);
}

.signup-button:hover .signup-icon {
    animation: signupArrow 0.8s ease-in-out infinite;
}

@keyframes signupArrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Highly Visible Mobile Toggle & Hamburger Lines */
.mobile-toggle {
    position: relative;
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    background: #f0f7f9; /* Subtle light background for clear distinction */
    border: 1px solid rgba(23, 111, 145, 0.25); /* Crisp outline */
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    transition: 
        background var(--transition-normal, 0.3s ease),
        border-color var(--transition-normal, 0.3s ease),
        transform var(--transition-normal, 0.3s ease);
}

.mobile-toggle:hover {
    background: #e1eff3;
    border-color: var(--iherd-blue, #176f91);
}

.hamburger-line {
    position: absolute;
    left: 11px;
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--iherd-blue, #176f91); /* Bold high-contrast blue color */
    border-radius: 10px;
    transform-origin: center;
    transition: 
        transform var(--transition-slow, 0.35s ease),
        opacity var(--transition-normal, 0.25s ease),
        background-color var(--transition-fast, 0.15s ease);
}

.hamburger-line:nth-child(1) {
    transform: translateY(-7px);
}

.hamburger-line:nth-child(2) {
    transform: translateY(0);
}

.hamburger-line:nth-child(3) {
    transform: translateY(7px);
}

/* Active Hamburger Animation (Cross Icon) */
.mobile-toggle.active {
    background: var(--iherd-blue, #176f91);
    border-color: var(--iherd-blue, #176f91);
}

.mobile-toggle.active .hamburger-line {
    background: #ffffff; /* Turns white when active for strong contrast */
}

.mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(0) rotate(45deg);
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
}

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    visibility: hidden;
    background: rgba(10, 39, 50, 0.4);
    opacity: 0;
    backdrop-filter: blur(3px);
    pointer-events: none;
    transition: 
        opacity var(--transition-normal, 0.3s ease),
        visibility var(--transition-normal, 0.3s ease);
}

.mobile-menu-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.site-navbar.scrolled {
    top: 7px;
}

.site-navbar.scrolled .navbar-inner {
    box-shadow: 0 10px 35px rgba(13, 50, 66, 0.12);
}

body.mobile-menu-open {
    overflow: hidden;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 1180px) {
    .site-navbar {
        width: calc(100% - 34px);
    }
    .navbar-inner {
        height: 76px;
    }
    .navbar-brand {
        width: 88px;
        height: 76px;
    }
    .navbar-logo {
        width: 72px;
        height: 72px;
    }
    .navbar-navigation {
        gap: clamp(13px, 1.7vw, 25px);
    }
    .nav-item {
        font-size: 14px;
    }
    .navbar-actions {
        margin-left: 12px;
    }
    .signup-button {
        min-width: 126px;
        height: 50px;
        padding-right: 15px;
        padding-left: 17px;
    }
}

@media (max-width: 1020px) {
    .site-navbar {
        width: calc(100% - 28px);
    }
    .navbar-inner {
        height: 72px;
        padding-right: 10px;
    }
    .navbar-brand {
        width: 80px;
        height: 72px;
    }
    .navbar-logo {
        width: 68px;
        height: 68px;
    }
    .navbar-navigation {
        gap: 14px;
    }
    .nav-item {
        font-size: 13px;
    }
    .signup-button {
        min-width: 112px;
        height: 46px;
        padding: 0 13px;
        font-size: 13px;
    }
    .signup-icon {
        margin-left: 5px;
    }
}

@media (max-width: 900px) {
    .site-navbar {
        top: 10px;
        width: calc(100% - 24px);
    }
    .navbar-inner {
        height: 70px;
        padding-right: 9px;
    }
    .navbar-brand {
        width: 78px;
        height: 70px;
    }
    .navbar-logo {
        width: 65px;
        height: 65px;
    }

    /* Mobile Dropdown Navigation Panel */
    .navbar-navigation {
        position: fixed;
        top: calc(100% + 10px);
        right: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 100px);
        padding: 14px;
        overflow-y: auto;
        overflow-x: hidden;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
        background: #ffffff; /* Solid White Mobile Menu Drawer */
        border: 1px solid rgba(23, 111, 145, 0.12);
        border-radius: 18px;
        box-shadow: 0 15px 40px rgba(13, 50, 66, 0.18);
        pointer-events: none;
        transition: 
            opacity var(--transition-normal, 0.3s ease),
            visibility var(--transition-normal, 0.3s ease),
            transform var(--transition-slow, 0.35s ease);
        scrollbar-width: thin;
    }

    .navbar-navigation.mobile-open {
        visibility: visible;
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .nav-item {
        justify-content: flex-start;
        width: 100%;
        min-height: 50px;
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .nav-item::after {
        display: none;
    }

    .nav-item:hover {
        background: var(--iherd-blue-light, #f0f7f9);
    }

    .nav-item.active {
        color: var(--iherd-blue, #176f91);
        background: rgba(207, 193, 140, 0.18);
    }

    .nav-dropdown {
        display: block;
        width: 100%;
        height: auto;
    }

    .nav-dropdown-button {
        display: flex;
        width: 100%;
        min-height: 50px;
        padding: 12px 14px;
    }

    .nav-dropdown-button .media-arrow {
        margin-left: auto;
    }

    .media-menu {
        position: static;
        display: grid;
        width: 100%;
        min-width: 0;
        max-height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        visibility: visible;
        opacity: 1;
        transform: none;
        border: 0;
        border-radius: 10px;
        box-shadow: none;
        pointer-events: auto;
        transition: 
            max-height var(--transition-slow, 0.35s ease),
            padding var(--transition-normal, 0.3s ease);
    }

    .nav-dropdown.open .media-menu {
        max-height: 220px;
        padding: 4px 0 6px;
    }

    .media-link {
        min-height: 44px;
        padding: 10px 26px;
        font-size: 13px;
    }

    .navbar-actions {
        margin-left: auto;
    }

    .mobile-toggle {
        display: flex; /* Show Hamburger Button on screens <= 900px */
    }
}

@media (max-width: 600px) {
    .site-navbar {
        top: 8px;
        width: calc(100% - 16px);
    }
    .navbar-inner {
        height: 66px;
        padding-right: 7px;
        border-radius: 15px;
    }
    .navbar-brand {
        width: 72px;
        height: 66px;
        border-radius: 15px 0 0 15px;
    }
    .navbar-logo {
        width: 61px;
        height: 61px;
    }
    .navbar-actions {
        gap: 6px;
    }
    .signup-button {
        min-width: auto;
        height: 43px;
        padding: 0 12px;
        border-radius: 24px;
        font-size: 12px;
    }
    .signup-icon {
        margin-left: 3px;
    }
    .signup-icon svg {
        width: 17px;
        height: 17px;
    }
    .mobile-toggle {
        width: 44px;
        height: 44px;
    }
    .hamburger-line {
        left: 10px;
    }
    .navbar-navigation {
        top: calc(100% + 8px);
        max-height: calc(100vh - 88px);
        padding: 9px;
        border-radius: 16px;
    }
    .nav-item {
        min-height: 48px;
        padding: 11px;
    }
    .media-link {
        padding-right: 20px;
        padding-left: 25px;
    }
}

@media (max-width: 420px) {
    .site-navbar {
        width: calc(100% - 12px);
    }
    .navbar-inner {
        height: 62px;
    }
    .navbar-brand {
        width: 65px;
        height: 62px;
    }
    .navbar-logo {
        width: 57px;
        height: 57px;
    }
    .signup-button {
        height: 40px;
        padding: 0 10px;
    }
    .signup-icon svg {
        width: 16px;
        height: 16px;
    }
    .mobile-toggle {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 340px) {
    .navbar-brand {
        width: 58px;
    }
    .navbar-logo {
        width: 52px;
        height: 52px;
    }
    .signup-text {
        font-size: 11px;
    }
    .signup-icon {
        display: none;
    }
    .mobile-toggle {
        width: 39px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}