:root {
    --primary-red: #AB0003;

    --text-color-black: #222;
    --text-color-white: #fff;
    --text-color-red: #AB0003;
    --text-color-blue: #143d8d;

    --background-color-black: #282C2F;
    --background-color-white: #fff;
    --background-color-dark-gray: #393D3F;
    --background-color-soft-gray: #e5e5e5;
    --background-color-red: #AB0003;

    --border-color: #e2e8f0;
    --hr-color: #22222236;

    --font-family-primary: "Roboto", sans-serif;
    --font-family-secondary: "Kanit", sans-serif;

    /* WID and NTSA Related */
    --background-color-dark-blue: #002855;
    --primary-blue: #002855;
}

/* netForum Overrides Fix */
#eWebLeftPaneTableCell {
    display: block;
}
#sidebar-links.nav {
    --bs-nav-link-padding-x: 1rem;
    --bs-nav-link-padding-y: 0.5rem;
    --bs-nav-link-font-weight: ;
    --bs-nav-link-color: var(--bs-link-color);
    --bs-nav-link-hover-color: var(--bs-link-hover-color);
    --bs-nav-link-disabled-color: var(--bs-secondary-color);
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
a:hover, a:focus {
    text-decoration: none;
}

/* Fix for modal open screen shift */
body#BodyTag.modal-open {
    padding-right: 0px !important;
    left: -7px !important;
}
body#BodyTag.modal-open.menu-fixed .site-logo {
    left: calc(50% - 551px + 3px);
}
body#BodyTag.modal-open.menu-fixed.sidebar-collapsed .site-logo {
    left: calc(50% - 637px + 3px);
}

/* netForum NDIA.css fix */
.site-logo, .search-button {
    transition: none;
}
.login-link {
    right: 70px;
    position: relative;
}
.search-button {
    right: calc(50% - 580px + 10px);
}
@media (min-width: 1200px) {
    .main-menu {
        position: relative;
        text-align: left;
        height: 110px;
        left: calc(50% - 645px + 300px);
        width: fit-content;
    }
    .aux-menu {
        right: calc(50% - 590px + 105px);
    }
}
#ContentPane {
    max-width: 1200px;
}
.site-logo {
    left: calc(50% - 614px + 10px);
}
.soft-sidebar.collapsed ~ #PageFrameWorkTable .site-logo,
.soft-sidebar.collapsed ~ .site-logo {
    left: calc(50% - 614px + 10px);
}
/* .site-logo states for .menu-fixed and sidebar collapsed/expanded */
body.menu-fixed.sidebar-collapsed .site-logo {
    left: calc(50% - 637px + 10px);
}

body.menu-fixed.sidebar-expanded .site-logo {
    left: calc(50% - 551px + 10px);
}
body.menu-fixed.sidebar-expanded .main-menu {
    left: calc(50% - 770px + 300px);
}
body.menu-fixed.sidebar-expanded .search-button {
    right: calc(50% - 453px + 10px);
}
@media only screen and (max-width: 1466px) {
    body.sidebar-expanded .site-logo {
        left: 30px;
    }
    body.sidebar-expanded .tagline {
        left: 5px;
    }
    body.sidebar-expanded .aux-menu {
        right: 150px;
    }

    body.menu-fixed.sidebar-collapsed .site-logo {
        left: 84px;
    }
    body.menu-fixed.sidebar-expanded .site-logo {
        left: 234px;
    }
}
@media screen and (max-width: 1376px) {
    .main-menu li a {
        padding: 35px 10px 36px 10px;
    }
    .sidebar-expanded .search-button {
        right: calc(50% - 560px + 10px);
    }
}
@media only screen and (max-width: 1322px) {
    body.sidebar-collapsed .site-logo {
        left: 30px;
    }
    body.sidebar-collapsed .tagline {
        left: 5px;
    }
}
@media only screen and (max-width: 1308px) {
    body.sidebar-collapsed .aux-menu {
        right: 115px;
    }
    .main-menu li a {
        padding: 35px 8px 36px 8px;
    }
    .sidebar-expanded .search-button {
        right: calc(50% - 537px + 10px);
    }
    .sidebar-expanded .main-menu {
        left: calc(50% - 634px + 300px);
    }
    body.menu-fixed.sidebar-expanded .search-button {
        right: calc(50% - 405px + 10px);
    }
}
@media only screen and (max-width: 1276px) {
    .main-menu li a {
        padding: 35px 5px 36px 5px;
    }
    .sidebar-expanded .search-button {
        right: calc(50% - 495px + 10px);
    }
    body.sidebar-expanded .site-logo {
        left: 15px;
    }
    .sidebar-expanded .site-logo img {
        width: 160px;
    }
}


@media only screen and (max-width: 1200px) {
    .site-logo {
        left: unset !important;
    }
}
#header-top, #footer {
    width: 107%;
}
.footer-top {
    padding: 70px 30px 70px 0px;
}
.footer-middle {
    padding: 60px 20px 20px 10px;
}
.footer-bottom {
    padding: 30px 30px 125px 10px;
}

/* Mobile-first approach - sidebar collapsed by default */
.soft-sidebar {
    width: 56px;
    background-color: var(--background-color-white);
    color: var(--text-color-black);
    min-height: 100%;
    transition: width 0.2s;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    padding-top: 3px;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    font-size: 0.92rem;
    border-right: 2px solid var(--border-color);
    /* Hide initially to prevent flicker */
    visibility: hidden;
}

/* Show sidebar once JavaScript has determined the correct state */
.soft-sidebar.initialized {
    visibility: visible;
}

/* Disable transitions during initial load to prevent flicker */
.soft-sidebar:not(.initialized) {
    transition: none !important;
}

.soft-sidebar:not(.initialized) ~ #PageFrameWorkTable {
    transition: none !important;
}

.soft-sidebar.expanded {
    width: 220px;
}

#PageFrameWorkTable {
    margin-left: 56px !important;
    width: calc(100% - 56px);
    transition: margin-left 0.2s, width 0.2s;
}

#PageFrameWorkTable.expanded {
    margin-left: 220px !important;
    width: calc(100% - 220px);
}

/* Hide text in mobile view by default */
.soft-sidebar .sidebar-scroll .nav-link span {
    display: none;
    color: var(---text-color-black);
}

/* Show text when expanded in mobile view */
.soft-sidebar.expanded .sidebar-scroll .nav-link span {
    display: inline;
}

/* Desktop view - sidebar expanded by default */
@media (min-width: 992px) {
    .soft-sidebar {
        width: 220px;
    }

    .soft-sidebar.collapsed {
        width: 56px;
    }

    #PageFrameWorkTable {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    #PageFrameWorkTable.collapsed {
        margin-left: 56px;
        width: calc(100% - 56px);
    }

    /* Show text in desktop view by default */
    .soft-sidebar .sidebar-scroll .nav-link span {
        display: inline;
    }

    /* Hide text when collapsed in desktop view */
    .soft-sidebar.collapsed .sidebar-scroll .nav-link span {
        display: none;
    }
}

/* Hide sidebar toggle button in tablet and mobile view */
@media (max-width: 991px) {
    .soft-sidebar .sidebar-toggle-wrapper {
        display: none !important;
    }
}

.soft-navbar {
    background: var(--bs-light);
    border-bottom: 1px solid var(--bs-border-color);
}

.soft-navbar .navbar-brand {
    font-size: 1.25rem;
    color: var(--bs-dark);
}

.soft-navbar .soft-navbar-title {
    color: var(--bs-dark);
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.soft-navbar .nav-link {
    color: var(--bs-dark) !important;
    font-weight: 500;
    font-size: 1rem;
    margin-right: 0.5rem;
    transition: color 0.2s;
}

.soft-navbar .nav-link:hover,
.soft-navbar .nav-link.active {
    color: var(--bs-primary) !important;
}

.soft-navbar .nav-link.text-danger {
    color: var(--bs-danger) !important;
}

.soft-navbar .nav-link.text-danger:hover {
    color: var(--bs-danger) !important;
    opacity: 0.8;
}

.soft-logo {
    height: 40px;
    width: auto;
    border-radius: 0.5rem;
    background: var(--bs-light);
    padding: 0.2rem;
}

.soft-main {
    margin-left: 0;
    transition: margin-left 0.2s;
}

.soft-main.collapsed {
    margin-left: -10rem;
}

.soft-sidebar .sidebar-toggle-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    margin-top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--hr-color);
    padding-bottom: 10px;
}

.soft-sidebar .sidebar-toggle {
    border: none;
    background: none;
    color: var(--text-color-black);
    border-radius: 0.375rem;
    width: 100%;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    margin-right: 0.5rem;
    margin-left: 0.5rem;
    margin-top: 3px;
    margin-bottom: -3px;
    font-size: 1.2rem;
}

.soft-sidebar .sidebar-toggle:hover,
.soft-sidebar .sidebar-toggle:focus-visible {
    background: var(--background-color-dark-gray);
    color: var(--text-color-white);
}
.soft-sidebar.widRelated .sidebar-toggle:hover,
.soft-sidebar.widRelated .sidebar-toggle:focus-visible,
.soft-sidebar.ntsaRelated .sidebar-toggle:hover,
.soft-sidebar.ntsaRelated .sidebar-toggle:focus-visible {
    background: var(--background-color-dark-blue);
}

.soft-sidebar .sidebar-scroll {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    margin-top: 0;
    padding-bottom: 1rem;
    line-height: 1.6em !important;
}

.soft-sidebar .nav {
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.92rem;
}

.soft-sidebar .sidebar-scroll .nav-link {
    color: var(--bs-dark);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.35rem 1rem 0.35rem 0.5rem;
    border-radius: 0 1.5rem 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    margin-left: 0.1rem;
    position: relative;
    justify-content: flex-start;
}

/* Mobile view - centered when collapsed */
.soft-sidebar .sidebar-scroll .nav-link {
    justify-content: center;
    padding: 0.35rem 0.5rem;
}

/* Mobile view - left aligned when expanded */
.soft-sidebar.expanded .sidebar-scroll .nav-link {
    justify-content: flex-start;
    padding: 0.35rem 1rem 0.35rem 0.5rem;
}

/* Desktop view - left aligned when expanded */
@media (min-width: 992px) {
    .soft-sidebar .sidebar-scroll .nav-link {
        justify-content: flex-start;
        padding: 0.35rem 1rem 0.35rem 0.5rem;
    }

    .soft-sidebar.collapsed .sidebar-scroll .nav-link {
        justify-content: center;
        padding: 0.35rem 0.5rem;
    }
}

.soft-sidebar .sidebar-scroll .nav-link.active,
.soft-sidebar .sidebar-scroll .nav-link:hover {
    background: var(--background-color-dark-gray);
    color: var(--text-color-white);
    text-decoration: none;
}
.soft-sidebar.widRelated .sidebar-scroll .nav-link.active,
.soft-sidebar.widRelated .sidebar-scroll .nav-link:hover,
.soft-sidebar.ntsaRelated .sidebar-scroll .nav-link.active,
.soft-sidebar.ntsaRelated .sidebar-scroll .nav-link:hover {
    background: var(--background-color-dark-blue);
}
.soft-sidebar .sidebar-scroll .nav-link.active .bi,
.soft-sidebar .sidebar-scroll .nav-link:hover .bi {
    color: var(--text-color-white);
}

.soft-sidebar.collapsed .sidebar-scroll .nav-link span {
    display: none;
}

.soft-sidebar.collapsed .sidebar-scroll .nav-link {
    justify-content: center;
    padding: 0.35rem 0.5rem;
}

.soft-sidebar .sidebar-scroll .nav-link i,
.soft-sidebar .sidebar-scroll .nav-link .bi {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
    color: var(--primary-red);
}
.soft-sidebar.widRelated .sidebar-scroll .nav-link i,
.soft-sidebar.widRelated .sidebar-scroll .nav-link .bi,
.soft-sidebar.ntsaRelated .sidebar-scroll .nav-link i,
.soft-sidebar.ntsaRelated .sidebar-scroll .nav-link .bi {
    color: var(--primary-blue);
}
.soft-sidebar.widRelated .sidebar-scroll .nav-link:hover .bi,
.soft-sidebar.ntsaRelated .sidebar-scroll .nav-link:hover .bi,
.soft-sidebar.widRelated .sidebar-scroll .nav-link.active .bi,
.soft-sidebar.ntsaRelated .sidebar-scroll .nav-link.active .bi {
    color: var(--text-color-white) !important;
}

@media only screen and (max-width: 1200px) {
    body.menu-fixed.sidebar-collapsed .search-button {
        right: -160px;
    }
    .search-button {
        right: -160px;
    }
    body.sidebar-expanded .search-button {
        right: -330px;
    }
    body.menu-fixed.sidebar-expanded .search-button {
        right: -330px;
    }
}
@media only screen and (max-width: 420px) {
    #header-top, #footer {
        width: auto;
    }
}

/* Custom tooltip styling for collapsed sidebar */
.soft-sidebar .nav-link[data-tooltip]:hover::after,
.soft-sidebar .nav-link[data-tooltip]:focus::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 110%;
    top: 50%;
    transform: translateY(-50%);
    background: #222;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 9999;
    font-size: 0.95em;
    opacity: 1;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.soft-sidebar .nav-link[data-tooltip]::after {
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.soft-sidebar.collapsed .nav-link[data-tooltip]:hover::after,
.soft-sidebar.collapsed .nav-link[data-tooltip]:focus::after {
    opacity: 1;
}