/* ============================================================
   PublicHealthLabView page styles
   ============================================================ */

/* ── Public Health Lab ordering guidance window ─────────────── */

/* Responsive sizing: half-ish width on desktop, full width on mobile */
.phl-window.k-window {
    width: clamp(320px, 50vw, 640px) !important;
    max-height: 80vh !important;
}

.phl-window .k-window-content {
    overflow-y: auto;
}

@media (max-width: 600px) {
    .phl-window.k-window {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        top: 0 !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }
}

/* Title bar: site green header to match the rest of the site */
.phl-window .k-window-titlebar {
    background-color: #4d7f71;
    color: #ffffff;
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.phl-window .k-window-titlebar .k-button {
    color: #ffffff;
    opacity: 0.85;
}

.phl-window .k-window-titlebar .k-button:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}

.phl-window-empty {
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    color: #5c6670;
    padding: 16px 0;
    margin: 0;
}

/* ── Entry card: one per clinical state ─────────────────────── */

.phl-entry {
    border: 1px solid #d1e0da;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    font-family: "Roboto", sans-serif;
}

.phl-entry:last-child {
    margin-bottom: 0;
}

/* Clinical state heading bar */
.phl-clinical-state {
    background-color: #f0f4f2;
    border-bottom: 1px solid #c5d9d2;
    color: #24323a;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
}

/* One row per test link */
.phl-link-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    border-bottom: 1px solid #edf3f0;
}

.phl-link-row:last-child {
    border-bottom: none;
}

.phl-link-row:nth-child(even) {
    background-color: #f9fafb;
}

/* Procedure / LAB meta pill */
.phl-link-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    min-width: 0;
}

.phl-meta-label {
    font-size: 11px;
    font-weight: 600;
    color: #5c7a72;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.phl-meta-value {
    font-size: 13px;
    color: #24323a;
}

/* Button */
.phl-view-btn {
    background-color: #2563a8 !important;
    border-color: #2563a8 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.phl-view-btn:hover {
    background-color: #1a4a85 !important;
    border-color: #1a4a85 !important;
}

/* ── Shared structural styles (mirrors apcytoview-page.css) ── */

.back-link-section {
    background-color: #F9FAFB;
    padding: 12px 0;
}

.back-link-container {
    margin: 0 32px;
}

.back-link {
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    color: #4D7F71;
    text-decoration: underline;
    cursor: pointer;
}

.back-link:hover {
    text-decoration: none;
}

.summary-shell {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f9fafb;
    padding-bottom: 16px;
}

.test-info-section {
    background-color: #4d7f71;
    border-radius: 6px;
    padding: 24px;
    color: #FFFFFF;
    margin-bottom: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.test-info-title {
    font-family: "Roboto", sans-serif;
    font-size: 32px;
    font-weight: 500;
    color: #FFFFFF;
    margin: 0 0 4px 0;
}

.test-info-synonym {
    font-family: "Roboto", sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 16px 0;
}

.summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
    font-family: "Roboto", sans-serif;
    font-size: 13px;
    font-weight: 500;
}

.summary-chip strong {
    font-weight: 700;
}

.alert-banner {
    background-color: #FFF4B9;
    border: 1px solid #E5C94A;
    border-radius: 8px;
    padding: 14px 16px;
    color: #4A3B00;
    font-family: "Roboto", sans-serif;
    margin-bottom: 16px;
}

.alert-banner-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.alert-banner-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-line;
}

.content-container {
    margin: 0 32px;
}

.main-content-section {
    background-color: #f9fafb;
    padding: 3px 0 0 0;
}

.tabstrip-host {
    padding-top: 16px;
    padding-bottom: 40px;
}

.test-tabstrip {
    margin-top: 8px;
}

/* ── Tab button styling ─────────────────────────────────────────── */
.test-tabstrip .k-tabstrip-items-wrapper {
    border-bottom: 2px solid #4d7f71;
}

.test-tabstrip .k-tabstrip-items .k-item {
    background-color: rgba(77, 127, 113, 0.10);
    border: 1px solid #c5c79b;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    margin-right: 4px;
    color: #4d7f71;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.test-tabstrip .k-tabstrip-items .k-item:hover:not(.k-active) {
    background-color: rgba(197, 199, 155, 0.35);
    color: #4d7f71;
}

.test-tabstrip .k-tabstrip-items .k-item.k-active,
.test-tabstrip .k-tabstrip-items .k-item.k-active:focus,
.test-tabstrip .k-tabstrip-items .k-item.k-selected {
    background-color: #4d7f71 !important;
    border-color: #4d7f71 !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: none !important;
}

.test-tabstrip .k-tabstrip-items .k-item.k-active .k-link,
.test-tabstrip .k-tabstrip-items .k-item.k-selected .k-link {
    color: #ffffff !important;
}

.test-tabstrip .k-tabstrip-items .k-item .k-link {
    color: inherit;
    padding: 8px 16px;
}

.test-tabstrip .k-tabstrip-items .k-item .k-link > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-content {
    padding-top: 16px;
}

.section-box {
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.section-process    { background-color: #c5c79b; color: #24323A; }
.section-shipping   { background-color: #898f65; color: #24323A; }
.section-references { background-color: #00adbb; color: #24323A; }

.section-box-title {
    font-family: "Roboto", sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: inherit;
    margin: 0 0 20px 0;
}

.section-row {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0 8px;
    border-bottom: 1px solid rgba(36, 50, 58, 0.18);
    align-items: start;
    padding: 8px 0;
}

.section-row:last-child {
    border-bottom: none;
}

.section-row-label {
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    opacity: 0.85;
}

.section-row-value {
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: inherit;
    opacity: 0.95;
    white-space: pre-line;
}

.section-empty {
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    color: inherit;
    opacity: 0.8;
    margin: 0;
}

.performing-locations-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    color: #FFFFFF;
}

.performing-locations-label {
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.performing-locations-value {
    font-weight: 400;
    line-height: 1.6;
}

/* ── Public Health Lab – procedure code link in summary chip ── */
.phl-proc-link {
    color: #FFFFFF;
    text-decoration: underline;
    font-weight: 700;
}

.phl-proc-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

.phl-proc-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

/* ── Linked Tests tab ─────────────────────────────────────── */
.phl-linked-intro {
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    color: inherit;
    margin: 0 0 16px 0;
}

.phl-linked-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    color: inherit;
}

.phl-linked-table th {
    text-align: left;
    font-weight: 700;
    padding: 8px 12px;
    border-bottom: 2px solid rgba(36, 50, 58, 0.25);
    white-space: nowrap;
}

.phl-linked-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(36, 50, 58, 0.12);
    vertical-align: middle;
}

.phl-linked-table tr:last-child td {
    border-bottom: none;
}

.phl-linked-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.25);
}

.phl-view-link {
    display: inline-block;
    color: #24323A;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

.phl-view-link:hover {
    opacity: 0.75;
    text-decoration: none;
}

/* ── Linked Tests – View Test button ─────────────────────── */
.phl-view-btn.k-button {
    background-color: #006977;
    border-color: #005a66;
    color: #ffffff;
    font-weight: 600;
    white-space: nowrap;
}

.phl-view-btn.k-button:hover {
    background-color: #005a66;
    border-color: #004d57;
    color: #ffffff;
}

/* ── Print button ─────────────────────────────────────────── */
.print-button-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    color: #4D7F71;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.print-button-link:hover {
    color: #3a5f57;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .back-link-container,
    .content-container {
        margin: 0 16px;
    }

    .test-info-section,
    .section-box {
        padding: 20px 16px;
    }

    .test-info-title {
        font-size: 26px;
        line-height: 1.2;
    }

    .summary-meta {
        flex-direction: column;
    }

    .section-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .tabstrip-host {
        padding-top: 12px;
        padding-bottom: 24px;
    }

    .section-box-title {
        font-size: 22px;
    }

    .phl-linked-table th,
    .phl-linked-table td {
        padding: 6px 8px;
    }
}
