/* ===== SHARED HEADER STYLES ===== */

/* ===== BUTTON STYLES FOR NON-BOOTSTRAP ENVIRONMENTS ===== */
.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.btn:focus,
.btn:active:focus,
.btn.active:focus {
    outline: thin dotted;
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}

.btn:hover,
.btn:focus {
    color: #333;
    text-decoration: none;
}

.btn:active,
.btn.active {
    background-image: none;
    outline: 0;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn.disabled,
.btn[disabled] {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.65;
    filter: alpha(opacity=65);
    box-shadow: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.btn-outline-light {
    color: rgba(255, 255, 255, 0.85);
    background-color: transparent;
    border: 1px solid transparent;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}

.btn-outline-light:active,
.btn-outline-light.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.header {
    width: 100%;
    background: linear-gradient(90deg, #2F4FAA 75%, #7B3F98);
    background-attachment: fixed;
}

.col-auto {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header .row {
    min-height: 72px; 
}

.header .col.text-center nav,
.header .col.text-center ul {
    display: inline-block;
    background-color: transparent !important;
}

.header .col.text-center ul li {
    display: inline-block;
    margin: 0 3px;
}

.header .row.align-items-center > div {
    display: flex;
    align-items: center;
}



/* ===== MODERN HEADER ===== */
.modern-header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.modern-header .container-fluid {
    width: 100%;
    height: 100%;
    padding-right: 0 !important;
    max-width: none;
}

.modern-header .row.align-items-center {
    display: flex;
    flex-wrap: nowrap;
    height: 65px;
    width: 100%;
    align-items: center !important; 
}

.modern-header .header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    float: none;
    padding-left: 50px;
}

.modern-header .header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.modern-header .header-logo .logo {
    max-height: 40px;
    width: auto;
    transition: transform 0.3s ease;
    background-color: transparent;
}

.modern-header .header-logo .logo:hover {
    transform: scale(1.05);
}

.header-logo {
    float: left;
    height: 79px;
    display: flex;
    align-items: center;
    padding-right: 5px;
    background-color: transparent;
}

.header-logo img {
    max-height: 65px;
    width: auto;
    vertical-align: middle;
}

.modern-header .header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0 15px;
    max-width: calc(100% - 300px);
    overflow: visible;
    z-index: 1;
}

.header-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-nav-menu li {
    margin: 0;
    padding: 0;
}

.modern-header .header-nav-menu li a,
.header-nav-menu li a {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    font-weight: 600;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 16px;
    white-space: nowrap;
    display: block;
}

.modern-header .header-nav-menu li a:hover,
.header-nav-menu li a:hover {
    color: #ffffff !important;
    background-color: #194185 !important;
    text-decoration: none;
}

.modern-header .header-nav-menu li.active a,
.header-nav-menu li.active a {
    color: #ffffff !important;
    background-color: #194185 !important;
    text-decoration: none;
}

.modern-header .col.header-nav.text-center {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-direction: row !important;
    float: none !important;
    text-align: center !important;
    height: 100% !important;
}

.modern-header .col.header-nav.text-center > ul,
.modern-header .col.header-nav.text-center > div > ul,
.modern-header .col.header-nav.text-center > nav > ul,
.modern-header .col.header-nav.text-center > * > * > ul {
    display: flex !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100% !important;
    float: none !important;
}

.modern-header .col.header-nav.text-center li {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

.modern-header .header-user {
    display: flex;
    justify-content: flex-end;
    align-items: center !important;
    float: none;
    height: 100% !important;
    padding-right: 15px;
    margin-left: auto;
    align-self: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    z-index: 10;
    position: relative;
}

.modern-header .header-user .user-info {
    color: #ffffff;
    font-weight: 500;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.modern-header .header-user .user-name {
    margin: 0 10px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-header .header-user .fa-user-circle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

.user-info-container {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    position: relative;
    z-index: 11;
}

.user-initials-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #717680;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.user-welcome-text {
    color: white;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 20px;
    padding-right: 5px;
}

.user-profile-wrapper {
    position: relative;
    cursor: pointer;
}

.user-profile-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 4px;
    padding: 5px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
    z-index: 1000;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.user-profile-popup:after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    margin-left: -5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid white;
}

.user-profile-popup a {
    color: #2a4b8d;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.user-profile-popup a:hover {
    text-decoration: underline;
}

.user-profile-wrapper:hover .user-profile-popup {
    opacity: 1;
    visibility: visible;
}

.user-profile-wrapper:hover .user-initials-circle {
    transform: scale(1.05);
}

.user-welcome-text,
.user-initials-circle,
.modern-header .header-user .btn-outline-light {
    margin-top: auto !important;
    margin-bottom: auto !important;
}

.modern-header .user-info-container {
    height: 100%;
    display: flex;
    align-items: center;
}

.modern-header .user-welcome {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modern-header .logout-text {
    display: inline-block;
    margin-left: 3px;
}

/* ===== STREAMLINED RESPONSIVE BREAKPOINTS ===== */

/* COMPACT DESKTOP (992px - 1299px) - Show navigation but make it compact */
@media (max-width: 1299px) and (min-width: 992px) {
    .modern-header .header-logo {
        padding-left: 15px !important;
    }
    
    .header-nav-menu {
        gap: 1px;
        padding-left: 10px !important;
    }
    
    .header-nav-menu li a {
        padding: 3px 3px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
    }
    
    .modern-header .header-user {
        padding-right: 10px !important;
    }
    
    .modern-header .header-user .user-name {
        display: none !important;
    }
    
    .modern-header .logout-text {
        display: none !important;
    }
    
    .user-welcome-text {
        font-size: 13px !important;
    }
    
    .user-initials-circle {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        margin-right: 6px !important;
    }
}

@media (max-width: 1100px) {
    .user-welcome-text {
        display: none;
    }
}

/* TABLET & MOBILE (991px and below) - Show hamburger menu ONLY if user is authenticated */
@media (max-width: 991px) {
    .header, .legacy-header {
        height: auto;
        min-height: 79px;
        padding: 10px 15px;
        margin-bottom: 10px;
    }

    .after-header {
        border-top: 1px solid #eee;
        margin-top: 5px;
        padding-top: 5px;
    }

    /* Hide navigation on mobile for all users */
    .modern-header .header-nav,
    .modern-header .col.header-nav,
    .modern-header .col.header-nav.text-center,
    .modern-header div.header-nav, 
    .modern-header ul.header-nav-menu,
    .modern-header .header-nav-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }
    
    .modern-header .header-nav li,
    .modern-header .header-nav-menu li,
    .modern-header .header-nav a,
    .modern-header .header-nav-menu a {
        display: none !important;
    }
    
    /* Default: Hide hamburger menu on mobile */
    .hamburger-menu {
        display: none !important;
        margin-left: auto;
        margin-right: 15px;
    }
    
    /* Show hamburger menu only if user is authenticated */
    .modern-header.user-authenticated .hamburger-menu {
        display: flex !important;
    }
    
    /* Hide user area only if user is authenticated (hamburger will replace it) */
    .modern-header.user-authenticated .header-user {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Keep user area visible if user is NOT authenticated (no hamburger menu) */
    .modern-header:not(.user-authenticated) .header-user {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .modern-header .row.align-items-center {
        flex-direction: row !important;
        justify-content: space-between !important;
        height: 65px !important;
    }
    
    .modern-header .header-logo {
        padding-left: 15px !important;
        padding-right: 0 !important;
    }

    .user-login {
        padding-right: 15px;
    }
}

/* LARGE DESKTOP (992px+) - Ensure desktop navigation is shown */
@media (min-width: 992px) {
    .hamburger-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .mobile-nav-menu {
        display: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }
    
    .modern-header .header-nav,
    .modern-header .col.header-nav,
    .modern-header .col.header-nav.text-center {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .modern-header .header-user {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* EXTRA WIDE SCREENS (1400px+) - More generous spacing */
@media (min-width: 1400px) {
    .modern-header .header-logo {
        padding-left: 50px !important;
    }
    
    .header-nav-menu li a {
        padding: 10px 16px;
        font-size: 16px;
    }

    .modern-header .header-user {
        padding-right: 15px !important;
    }
    
    .modern-header .header-user .user-name {
        display: block !important;
        max-width: 200px;
    }
    
    .modern-header .logout-text {
        display: inline-block !important;
    }
}

.modern-header * {
    box-sizing: border-box;
}

.header:after, .legacy-header:after {
    content: "";
    display: table;
    clear: both;
}

.after-header {
    clear: both !important;
    display: block !important;
    width: 100% !important;
}

.btn img {
    pointer-events: none;
}

.modern-header .header-user .btn-outline-light {
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.modern-header .header-user .btn-outline-light:hover {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ===== HAMBURGER MENU STYLES ===== */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    position: relative;
    z-index: 12;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.hamburger-menu:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hamburger-menu .hamburger-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    filter: brightness(0) invert(1);
}

.hamburger-menu:hover .hamburger-icon {
    transform: scale(1.1);
}

.hamburger-menu.active .hamburger-icon {
    transform: rotate(90deg);
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
}

.mobile-nav-menu {
    position: fixed;
    top: 75px; 
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #2F4FAA 75%, #7B3F98); 
    background-attachment: fixed;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1099;
    max-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.35s ease-out;
}

.mobile-nav-menu.active {
    max-height: calc(100vh - 85px);
}

.mobile-nav-menu ul.mobile-nav-links,
.mobile-nav-menu ul.mobile-nav-links li {
    float: none !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.mobile-nav-links li {
    margin: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-links li:last-child {
    border-bottom: none;
}

.mobile-nav-links li a {
    display: block !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    padding: 15px 10px !important;
    font-size: 16px !important;
    transition: all 0.3s ease;
    background-color: transparent !important;
}

.mobile-nav-links li a:hover,
.mobile-nav-links li.active a {
    color: #ffffff !important;
    background-color: #194185 !important;
    padding-left: 20px !important;
}

.mobile-user-controls {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 600;
}

.mobile-user-buttons {
    display: flex;
    gap: 10px;
}

.mobile-user-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.mobile-user-buttons a {
    display: block !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    padding: 15px 10px !important;
    font-size: 16px !important;
    transition: all 0.3s ease;
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-user-buttons a:last-child {
    border-bottom: none;
}

.mobile-user-buttons a:hover {
    color: #ffffff !important;
    background-color: #194185 !important;
    padding-left: 20px !important;
}

.mobile-nav-open {
    overflow: hidden !important;
}

/* Greeting Bar Styles */
.greeting-bar {
    min-height: 50px;
    margin-bottom: 20px;
}

.sub-text {
    color: #535862;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
}

.greeting-bar .container-fluid {
    padding: 0 15px;
}

.greeting-bar .row {
    display: flex;
    align-items: center;
    margin: 0;
    width: 100%;
}

.greeting-bar .col-md-6 {
    padding: 0 15px;
}

.greeting-bar .col-md-6:first-child {
    display: flex;
    align-items: center;
}

.greeting-bar .col-md-6.right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.greeting-text {
    font-size: 2rem;
    color: #495057;
    font-weight: 600;
    margin: 0;
}

.client-logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.client-logo img {
    max-height: 50px;
    width: auto;
}

#userFirstName {
    font-weight: 600;
    color: #2c3e50;
} 