/* ===== NSB WEBSITE - HEADER STYLES ===== */
/* File: /css/header.css */
/* Purpose: Main website header styles with vertical scrolling dropdowns */
/* Dependencies: CSS variables from main.css */
/* Last Updated: [CURRENT_DATE] */

/* ===== RESET AND BASE STYLES START ===== */
.header-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* ===== RESET AND BASE STYLES END ===== */

/* ===== HEADER LAYOUT START ===== */
.header-wrapper {
    display: flex;
    flex-direction: column;
}

.header-top-section {
    display: flex;
    width: 100%;
}

.utility-split-container {
    width: 75%;
    display: flex;
    flex-direction: column;
}
/* ===== HEADER LAYOUT END ===== */

/* ===== LOGO STYLES START ===== */
.logo-container {
    width: 25%;
    background-color: var(--nsb-white);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--nsb-light);
    overflow: hidden;
}

.logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
}

.nsb-logo {
    max-width: 100%;
    max-height: 60px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.logo-icon, .logo-text, .logo-title, .logo-subtitle, .logo-established {
    display: none;
}
/* ===== LOGO STYLES END ===== */

/* ===== UTILITY BAR START ===== */
.utility-bar {
    background-color: var(--nsb-primary);
    color: var(--nsb-white);
    flex: 1;
}

.utility-bar-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.utility-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.utility-nav ul {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.utility-nav a {
    color: var(--nsb-white);
    text-decoration: none;
    transition: opacity 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.utility-nav a:hover {
    opacity: 0.8;
}

.utility-search {
    display: flex;
    align-items: center;
}

.utility-search-btn {
    background: transparent;
    border: none;
    color: var(--nsb-white);
    cursor: pointer;
    padding: 0.5rem;
    transition: opacity 0.2s;
}

.utility-search-btn:hover {
    opacity: 0.8;
}

.utility-search-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}
/* ===== UTILITY BAR END ===== */

/* ===== MAIN HEADER START ===== */
.main-header {
    background-color: var(--nsb-white);
    border-bottom: 1px solid var(--nsb-light);
    transition: all 0.3s ease;
}

.main-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
}
/* ===== MAIN HEADER END ===== */

/* ===== NAVIGATION START ===== */
.nav-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: space-between;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 60%;
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-trigger {
    background: transparent;
    border: none;
    color: var(--nsb-text-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
}

.nav-trigger:hover {
    color: var(--nsb-primary);
}

.nav-trigger svg {
    width: 1rem;
    height: 1rem;
    transition: transform var(--transition-normal);
}

.nav-item.active .nav-trigger svg {
    transform: rotate(180deg);
}

/* ===== DROPDOWN STYLES START ===== */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    background: var(--nsb-white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 80vh;
    overflow: hidden;
}

.nav-item.active .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Vertical scroll container */
.dropdown-scroll-container {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
    width: 100%;
}

/* Custom vertical scrollbar */
.dropdown-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.dropdown-scroll-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.dropdown-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.dropdown-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Hide horizontal scrollbar */
.dropdown-scroll-container::-webkit-scrollbar:horizontal {
    display: none;
    height: 0;
}

/* For Firefox */
.dropdown-scroll-container {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

/* Dropdown list */
.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-item {
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item > a,
.dropdown-item-with-nested .dropdown-main-link {
    display: block;
    padding: 15px 25px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-radius: 6px;
    margin: 0 10px;
}

.dropdown-item > a:hover,
.dropdown-item-with-nested .dropdown-main-link:hover {
    background: rgba(252, 163, 17, 0.1);
    border-color: var(--nsb-accent);
    transform: translateX(5px);
}

.dropdown-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--nsb-text-primary);
    margin-bottom: 4px;
    font-family: var(--font-primary);
}

.dropdown-description {
    font-size: 0.8125rem;
    color: var(--nsb-text-secondary);
    line-height: 1.25;
    font-family: var(--font-secondary);
}

/* Nested items - displayed inline */
.dropdown-item.has-nested-items {
    padding-bottom: 10px;
}

.dropdown-item-with-nested {
    display: block;
}

.nested-items-list {
    list-style: none;
    margin: 10px 0 0 25px;
    padding: 0;
    border-left: 2px solid #f0f0f0;
}

.nested-item {
    margin: 8px 0;
}

.nested-item a {
    display: block;
    padding: 8px 12px;
    color: #555;
    font-size: 14px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nested-item a:hover {
    background: #f0f7ff;
    color: #007bff;
    padding-left: 16px;
}

/* Text wrapping to prevent horizontal scroll */
.dropdown-item > a,
.dropdown-item-with-nested .dropdown-main-link,
.nested-item a {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.dropdown-title,
.dropdown-description {
    max-width: 100%;
    word-break: break-word;
}
/* ===== DROPDOWN STYLES END ===== */
/* ===== NAVIGATION END ===== */

/* ===== CTA BUTTONS START ===== */
.cta-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.cta-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: var(--font-weight-semi-bold);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
}

.btn-outline {
    background-color: transparent;
    color: var(--nsb-text-primary);
    border: 2px solid var(--nsb-accent);
}

.btn-outline:hover {
    background-color: var(--nsb-accent);
    color: var(--nsb-white);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--nsb-light);
    color: var(--nsb-text-primary);
    border: 2px solid var(--nsb-light);
}

.btn-secondary:hover {
    background-color: var(--nsb-text-secondary);
    color: var(--nsb-white);
    border-color: var(--nsb-text-secondary);
    transform: translateY(-2px);
}

.btn-solid {
    background-color: var(--nsb-accent);
    color: var(--nsb-white);
    border: 2px solid var(--nsb-accent);
}

.btn-solid:hover {
    background-color: var(--nsb-primary);
    border-color: var(--nsb-primary);
    transform: translateY(-2px);
}
/* ===== CTA BUTTONS END ===== */

/* ===== SEARCH BAR START ===== */
.search-container {
    display: none;
    background-color: var(--nsb-white);
    border-bottom: 1px solid var(--nsb-light);
    padding: 1rem 0;
}

.search-container.active {
    display: block;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--nsb-light);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    font-family: var(--font-secondary);
    transition: all var(--transition-normal);
}

.search-input:focus {
    border-color: var(--nsb-primary);
    box-shadow: 0 0 0 3px rgba(20, 33, 61, 0.1);
}
/* ===== SEARCH BAR END ===== */

/* ===== MOBILE MENU START ===== */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    justify-content: space-between;
    width: 2rem;
    height: 1.5rem;
}

.mobile-menu-toggle .hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--nsb-text-primary);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background-color: var(--nsb-white);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--nsb-text-primary);
    padding: 0.5rem;
}

.mobile-nav-list {
    list-style: none;
    margin-top: 3rem;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

.mobile-nav-item,
.mobile-cta-btn,
.mobile-utility-item {
    display: block;
    padding: 0.75rem 0;
    text-decoration: none;
    color: var(--nsb-text-primary);
    font-size: 1rem;
    border-bottom: 1px solid var(--nsb-light);
    transition: all 0.2s ease;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
}

.mobile-cta-btn {
    background-color: var(--nsb-accent);
    color: var(--nsb-white);
    text-align: center;
    border-radius: 6px;
    margin: 0.5rem 0;
    border: none;
    font-weight: var(--font-weight-semi-bold);
}

.mobile-menu-divider {
    height: 1px;
    background-color: var(--nsb-light);
    margin: 1rem 0;
    list-style: none;
    border: none;
}

.mobile-utility-item {
    font-size: 0.9rem !important;
    color: var(--nsb-text-secondary) !important;
}

.mobile-nav-item:last-child,
.mobile-utility-item:last-child {
    border-bottom: none;
}

.mobile-nav-item:hover,
.mobile-utility-item:hover {
    color: var(--nsb-primary);
}

.mobile-cta-btn:hover {
    background-color: var(--nsb-primary);
}

/* Mobile nested items */
.mobile-nested-items {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.mobile-nested-item {
    display: block;
    padding: 10px 0;
    color: #666;
    text-decoration: none;
    white-space: normal;
    word-wrap: break-word;
}

.mobile-nested-subitem {
    display: block;
    padding: 8px 0 8px 20px;
    color: #888;
    font-size: 14px;
    text-decoration: none;
    white-space: normal;
    word-wrap: break-word;
}
/* ===== MOBILE MENU END ===== */

/* ===== RESPONSIVE DESIGN START ===== */
@media (max-width: 1200px) {
    .main-nav {
        gap: 0.5rem;
        max-width: 55%;
    }
    
    .nav-trigger {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .cta-buttons .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 1024px) {
    .main-nav {
        display: none;
    }
    
    .cta-buttons {
        margin-left: auto;
        display: flex;
        gap: 0.25rem;
    }
    
    .cta-buttons .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.7rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
        margin-left: 0.5rem;
    }
}

@media (max-width: 768px) {
    .header-top-section {
        flex-direction: column;
    }
    
    .logo-container {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 1rem;
    }
    
    .utility-split-container {
        width: 100%;
    }
    
    .utility-nav ul {
        gap: 1rem;
        font-size: 0.75rem;
    }
    
    .cta-buttons {
        display: none;
    }
    
    .cta-buttons .btn {
        padding: 0.375rem 1rem;
        font-size: 0.75rem;
    }
    
    .header-content {
        height: 4rem;
    }
    
    .mobile-menu-container {
        width: 100%;
    }
    
    .mobile-nav-list {
        max-height: calc(100vh - 100px);
    }
    
    /* Mobile dropdown adjustments */
    .nav-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--nsb-light);
        border-radius: 0;
        margin-top: 0;
        padding: 0.5rem 1rem;
        max-height: none;
    }
    
    .dropdown-scroll-container {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .utility-nav ul {
        gap: 0.75rem;
        font-size: 0.7rem;
    }
    
    .utility-nav {
        overflow-x: auto;
        padding: 0.5rem 0;
    }
    
    .utility-nav ul {
        flex-wrap: nowrap;
        padding: 0 1rem;
    }
    
    .cta-buttons {
        gap: 0.25rem;
    }
    
    .cta-buttons .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.7rem;
    }
}

/* Button text optimization for smaller screens */
@media (max-width: 1100px) {
    .btn-text-long {
        display: none;
    }
    .btn-text-short {
        display: inline;
    }
}

.btn-text-short {
    display: none;
}
/* ===== RESPONSIVE DESIGN END ===== */

/* ===== CLICK-BASED NAVIGATION SUPPORT START ===== */
.nav-item.active .nav-dropdown {
    display: block;
}

body.has-dropdown-open {
    overflow: hidden;
}

body.has-dropdown-open .nav-dropdown {
    pointer-events: auto;
}
/* ===== CLICK-BASED NAVIGATION SUPPORT END ===== */

/* ===== SCROLL INDICATORS (Optional) ===== */
.dropdown-scroll-container {
    position: relative;
}

.dropdown-scroll-container::before,
.dropdown-scroll-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.dropdown-scroll-container::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.dropdown-scroll-container::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.dropdown-scroll-container.scrollable-top::before {
    opacity: 1;
}

.dropdown-scroll-container.scrollable-bottom::after {
    opacity: 1;
}
/* ===== SCROLL INDICATORS END ===== */

/* End of header.css */