/* Load ONLY in the BS5 lane */

/* Global scale: BS5 defaults feel larger than the legacy UI */
html { font-size: 14px; }

/* Keep content width aligned with the new header/footer */
@media (min-width: 1200px) {
    body.bootstrap5 .container { max-width: 85.714rem; min-height: 35.714rem; }
}

/* Blueimp jQuery File Upload (legacy UI):
   rows use .fade.in, but BS5 hides .fade unless .show is present */
body.bootstrap5 .fade.in { opacity: 1; }

/* -----------------------------
   Desktop header (BS5 lane)
------------------------------ */

body.bootstrap5 .desktop-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

body.bootstrap5 .desktop-nav {
    max-width: 85.714rem;
    margin: 0 auto;
    padding: 1.286rem 1.429rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.429rem;
}

body.bootstrap5 .logo-section {
    display: flex;
    align-items: center;
    gap: 1.143rem;
    min-width: 22.857rem;
}

body.bootstrap5 .logo-icon img {
    width: var(--layout-logo-width); /* 5.143rem = 72px */
    height: auto;
    display: block;
}

body.bootstrap5 .logo-text h1 {
    margin: 0;
    font-size: 1.857rem;
    line-height: 1.1;
    font-weight: 700;
    color: #111827;
}

body.bootstrap5 .logo-text p {
    margin: 0.286rem 0 0;
    font-size: 1rem;
    color: #6b7280;
}

/* Main nav rendered by SimpleNavigation: <ul class="nav menu main"> ... */
body.bootstrap5 .desktop-header .nav-links > ul.nav.menu.main {
    display: flex;
    align-items: center;
    gap: 2.286rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.bootstrap5 .desktop-header .nav-links > ul.nav.menu.main > li {
    margin: 0;
    padding: 0;
}

body.bootstrap5 .desktop-header .nav-links > ul.nav.menu.main > li > a {
    color: #4b5563;
    font-weight: 600;
    text-decoration: none;
    padding: 0.429rem 0.143rem;
    display: inline-block;
}

body.bootstrap5 .desktop-header .nav-links > ul.nav.menu.main > li > a:hover {
    color: #111827;
    text-decoration: none;
}

body.bootstrap5 .desktop-header .nav-links > ul.nav.menu.main > li.active > a {
    color: #111827;
    font-weight: 700;
}

/* Header buttons (LOGIN / CREATE ACCOUNT) */
body.bootstrap5 .nav-buttons {
    display: flex;
    align-items: center;
    gap: 1.143rem;
}

body.bootstrap5 .desktop-header .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.857rem;
    padding: 0 1.286rem;
    border-radius: 0.214rem;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

body.bootstrap5 .desktop-header .btn.btn-outline {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #2563eb;
}

body.bootstrap5 .desktop-header .btn.btn-outline:hover {
    background: #f8fafc;
}

body.bootstrap5 .desktop-header .btn.btn-primary {
    background: #2b3a8f;
    border: 1px solid #2b3a8f;
    color: #fff;
}

body.bootstrap5 .desktop-header .btn.btn-primary:hover {
    background: #24327b;
    border-color: #24327b;
}

/* Signed-in dropdown trigger */
body.bootstrap5 .nav-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.571rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 0.571rem 0.857rem;
    border-radius: 0.214rem;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
}

body.bootstrap5 .nav-user-trigger:hover {
    background: #f8fafc;
}

body.bootstrap5 .nav-user-name {
    color: #334195;
    font-weight: 800;
    text-decoration: none;
}

body.bootstrap5 .nav-user-caret {
    color: #6b7280;
    font-size: 0.857rem;
}

.btn-primary {
    background-color: #334195;
    border-color: #334195;
}

.btn {
    border-radius: 0.15rem;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #2b377f;
    border-color: #2b377f;
}

.form-control:focus,
.form-check-input:focus,
.form-select:focus,
.form-control-sm:focus {
    border-color: #0b0d83;
    box-shadow: 0 0 0 0.15rem rgba(16, 16, 110, 0.25);
}

.btn-min-width {
    min-width: 7.143rem;
}

.btn-lg-min-width {
    min-width: 14.286rem;
}

/* Responsive: let links wrap under the logo/buttons on smaller screens */
@media (max-width: 992px) {
    body.bootstrap5 .desktop-nav { flex-wrap: wrap; }
    body.bootstrap5 .desktop-header .nav-links { width: 100%; order: 3; }
    body.bootstrap5 .desktop-header .nav-links > ul.nav.menu.main {
        justify-content: flex-start;
        gap: 1.286rem;
        flex-wrap: wrap;
    }
}

/* -----------------------------
   Subnav (level 2) + breadcrumb
------------------------------ */

/* Make subnav look modern (override legacy gradient bar) */
body.bootstrap5 .subnav {
    height: auto;
    min-height: 0;
    border: 2px solid #6a6d7a;
    border-radius: 0.214rem;
    padding: 0.357rem;
    margin: 1.286rem 0 0;
}

body.bootstrap5 .subnav ul.nav.nav-pills {
    display: flex;
    align-items: center;
    gap: 0.857rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* neutralize any float-based legacy rules */
body.bootstrap5 .subnav ul.nav.nav-pills > li {
    float: none;
    margin: 0;
}

body.bootstrap5 .subnav ul.nav.nav-pills > li > a {
    display: inline-block;
    padding: 0.714rem 1rem;
    border-radius: 0.643rem;
    border: 0;
    background: transparent;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

body.bootstrap5 .subnav ul.nav.nav-pills > li > a:hover {
    color: #334195;
}

body.bootstrap5 .subnav ul.nav.nav-pills > li.active > a {
    color: #111827;
}

/* Breadcrumbs are rendered inline into a <p class="breadcrumb"> ... */
body.bootstrap5 p.breadcrumb {
    margin: 0.857rem 0 0.714rem;
    color: #6b7280;
    font-size: 1rem;
}

body.bootstrap5 p.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}

body.bootstrap5 p.breadcrumb a:hover {
    text-decoration: underline;
}

/* -----------------------------
   Footer (BS5 lane)
------------------------------ */
body.bootstrap5 .site-footer {
    background: #0b0f17;
    color: #9ca3af;
    margin-top: 2.857rem;
}

body.bootstrap5 .site-footer-inner {
    max-width: 85.714rem;
    margin: 0 auto;
    padding: 1.857rem 1.429rem;
    text-align: center;
    font-weight: 500;
}

/* Trials list table */
body.bootstrap5 .trials-table .col-reg    { width: var(--layout-col-reg);     white-space: nowrap; }
body.bootstrap5 .trials-table .col-flags  { width: var(--layout-col-flags); }
body.bootstrap5 .trials-table .col-status { width: var(--layout-col-status);  white-space: nowrap; }
body.bootstrap5 .trials-table .col-actions{ width: var(--layout-col-actions); text-align: right; white-space: nowrap; }

body.bootstrap5 tr.clickable-row { cursor: pointer; }
body.bootstrap5 tr.clickable-row:hover td { background: #f8fafc; }

/* Keep title readable */
body.bootstrap5 .trials-table .col-title { min-width: 22.857rem; }

body.bootstrap5 .trials-table th { color: #334195; }

/* On small screens, keep table scrollable instead of breaking layout */
@media (max-width: 768px) {
    body.bootstrap5 .trials-table .col-title { min-width: 18.571rem; }
}

.tooltip.custom-white .tooltip-inner {
    background-color: white;
    color: black;
    border: 1px solid #ccc;
}

.tooltip.custom-white.bs-tooltip-top .tooltip-arrow::before,
.tooltip.custom-white.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip.custom-white.bs-tooltip-start .tooltip-arrow::before,
.tooltip.custom-white.bs-tooltip-end .tooltip-arrow::before {
    border-top-color: white;
    border-bottom-color: white;
    border-left-color: white;
    border-right-color: white;
}

/* Tooltip container */
.tooltip.modern-tooltip .tooltip-inner {
    background: #ffffff;
    color: #2c2c2c;
    border-radius: 0.714rem;
    border: 1px solid #e5e7eb;
    padding: 1rem 1.143rem;
    max-width: 24.286rem;
    text-align: left;
    font-size: 0.929rem;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Header */
.tooltip-header {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.714rem;
    color: #111827;
}

/* Each line */
.tooltip-item {
    display: flex;
    align-items: flex-start;
    gap: 0.571rem;
    margin-bottom: 0.429rem;
}

/* Bullet dot */
.tooltip-item .dot {
    width: 0.429rem;
    height: 0.429rem;
    background: #3b82f6;
    border-radius: 50%;
    margin-top: 0.429rem;
    flex-shrink: 0;
}

/* Arrow color */
.tooltip.modern-tooltip.bs-tooltip-end .tooltip-arrow::before,
.tooltip.modern-tooltip.bs-tooltip-start .tooltip-arrow::before,
.tooltip.modern-tooltip.bs-tooltip-top .tooltip-arrow::before,
.tooltip.modern-tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-right-color: #ffffff;
    border-left-color: #ffffff;
    border-top-color: #ffffff;
    border-bottom-color: #ffffff;
}

.badge-mdn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    color: #fff;
    border-radius: 0.15rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: default;
    text-decoration: none;
}


button.badge-mdn {
    cursor: pointer;
    border: none;
}

button.badge-mdn:focus-visible {
    outline: 2px solid var(--color-brand-navy, #3d5a8a);
    outline-offset: 2px;
}

.all-filter-mdn { background-color: #6b7a8d; border: 1px solid #4e5a6b; }

.filter-badge-active {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.25);
}

.badge-mdn-lg {
    padding: 0.4em 0.8em;
    font-size: 0.85em;
    font-weight: 700;
    width: 100%;
}

.badge-mdn-sm {
    padding: 0.2em 0.5em;
    font-size: 0.75em;
    font-weight: 600;
    min-width: 75px;
}

.badge-mdn:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-0.071rem);
}

.draft-mdn        { background-color: #fb4949; border: 1px solid #930202; }
.approved-mdn     { background-color: #1cb13e; border: 1px solid #106c11; }
.pending-mdn      { background-color: #f7c47c; border: 1px solid #ea8b07; color: #272727; }
.unapproved-mdn   { background-color: #7e7e7e; border: 1px solid #212221; }
.reviewing-mdn    { background-color: var(--color-status-reviewing-bg);   border: 1px solid var(--color-status-reviewing-border);   color: var(--color-status-reviewing-text); }
.reviewed-mdn     { background-color: var(--color-status-reviewed-bg);    border: 1px solid var(--color-status-reviewed-border);    color: var(--color-status-reviewed-text); }
.returned-mdn     { background-color: var(--color-status-returned-bg);    border: 1px solid var(--color-status-returned-border);    color: var(--color-status-returned-text); }
.resubmitted-mdn  { background-color: var(--color-status-resubmitted-bg); border: 1px solid var(--color-status-resubmitted-border); color: var(--color-status-resubmitted-text); }
