/* The sidebar's hover-hold (Sidebar/Default.cshtml) and its Forms widget (forms_sidebar_tracked.js). */

/* While held: a bar fills along the bottom of the tooltip, or under the item when the sidebar's expanded. It waits a
   moment first, so passing over doesn't flash it. */
.dd-sidebar-flyout.dd-holding::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 3px;
    height: 2px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.85);
    transform-origin: left center;
    animation: dd-hold-fill 0.55s linear 0.15s both;
}

.wrapper:not(.sidebar-collapsed) .menu-item.dd-holding {
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85));
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 0 2px;
    animation: dd-hold-underline 0.55s linear 0.15s forwards;
}

@keyframes dd-hold-fill {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes dd-hold-underline {
    to {
        background-size: 100% 2px;
    }
}

/* ---- The widget ---- */
.dd-tracked {
    position: fixed;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 24px);
    /* Frosted, as an iOS material: the page shows through, blurred. */
    background: rgba(244, 249, 249, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 40, 40, 0.26), 0 2px 8px rgba(0, 40, 40, 0.1);
    color: #1f3333;
}

.dd-tracked[hidden] {
    display: none;
}

/* Points back at the item, level with it (--dd-tracked-caret, from the top). */
.dd-tracked::before {
    content: "";
    position: absolute;
    right: 100%;
    top: var(--dd-tracked-caret, 20px);
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-right-color: #0b6b6b;
}

/* The tooltip it grows out of: the same teal. */
.dd-tracked-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 14px;
    border-radius: 14px 14px 0 0;
    background: #0b6b6b;
    color: #fff;
}

/* Set as the tooltip's text is (sidebar.css .dd-sidebar-flyout), so it doesn't shift as the panel grows from it. */
.dd-tracked-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.dd-tracked-total {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: #0b6b6b;
    font-size: 11.5px;
    font-weight: 700;
}

.dd-tracked-total[hidden] {
    display: none;
}

.dd-tracked-open {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12.5px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dd-tracked-open:hover,
.dd-tracked-open:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    outline: none;
}

/* A tab per counted preset. */
.dd-tracked-tabs {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #dbe8e8;
}

.dd-tracked-tabs[hidden] {
    display: none;
}

.dd-tracked-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 6px 4px 10px;
    border: 1px solid #c9dcdc;
    border-radius: 999px;
    background: #fff;
    color: #3f5a5a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dd-tracked-tab:hover {
    border-color: #008080;
    color: #006a6a;
}

.dd-tracked-tab.is-active {
    border-color: #008080;
    background: #008080;
    color: #fff;
}

.dd-tracked-tab-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dd-tracked-tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e3f0f0;
    color: #006a6a;
    font-size: 11px;
    font-weight: 700;
}

.dd-tracked-tab.is-active .dd-tracked-tab-count {
    background: #fff;
    color: #008080;
}

.dd-tracked-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.dd-tracked-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 22px 12px;
    color: #6b7c7c;
    font-size: 13px;
}

.dd-tracked-entry {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px 7px;
    background: #fff;
    border: 1px solid #dbe8e8;
    border-radius: 8px;
}

.dd-tracked-entry-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-bottom: 3px;
}

.dd-tracked-patient {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13.5px;
    font-weight: 600;
}

.dd-tracked-when {
    flex: none;
    margin-left: auto;
    color: #7a8c8c;
    font-size: 11.5px;
}

.dd-tracked-doc {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 -6px;
    padding: 5px 6px;
    border-radius: 6px;
    color: #2f4747;
    font-size: 12.5px;
    text-decoration: none;
}

a.dd-tracked-doc:hover,
a.dd-tracked-doc:focus-visible {
    background: #eef6f6;
    color: #00585a;
    outline: none;
    text-decoration: none;
}

.dd-tracked-doc-icon {
    flex: none;
    width: 14px;
    text-align: center;
    font-size: 11.5px;
    color: #5f9c9c;
}

.dd-tracked-doc-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Where it's up to, coloured as Sent colours it. */
.dd-tracked-status {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef3f3;
    color: #557070;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.dd-tracked-status.is-opened { background: #e8f0fa; color: #2b6cb0; }
.dd-tracked-status.is-started,
.dd-tracked-status.is-practice { background: #fbf0e4; color: #b7651f; }
.dd-tracked-status.is-completed { background: #e6f4ec; color: #2f855a; }
.dd-tracked-status.is-expired,
.dd-tracked-status.is-cancelled { background: #f1f3f3; color: #8a9a9a; }
.dd-tracked-status.is-live { background: #e2f5ee; color: #0f8a66; }

/* On a hovered row's tint, the pill goes white with a fine edge so it still stands apart. */
a.dd-tracked-doc:hover .dd-tracked-status,
a.dd-tracked-doc:focus-visible .dd-tracked-status {
    background: #fff;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent);
}

/* "Filling in now": a dot with a ring pulsing out of it. */
.dd-tracked-live-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.dd-tracked-live-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: dd-tracked-pulse 1.6s ease-out infinite;
}

@keyframes dd-tracked-pulse {
    from {
        transform: scale(1);
        opacity: 0.7;
    }
    to {
        transform: scale(2.6);
        opacity: 0;
    }
}
