/*
 * DEV-1.14D-2-1 | Final Controls Cascade Fix
 *
 * MUST load last.
 *
 * Reason:
 * DEV-1.14D-2 component styles were correct in the isolated check page,
 * but v2-shell-home-theme.css loaded later in the formal application and
 * overrode Search / Back buttons back to white.
 *
 * This file is the final visual owner for these GLOBAL controls.
 */

/* ============================================================
   01 | Global Header Search button
   ============================================================ */

.v2-theme #global-patient-search-form {
    position: relative;
}

.v2-theme #global-patient-search-input.global-header__search-input {
    padding-right: 100px;

    border: 1px solid var(--v2-color-border);
    border-radius: var(--v2-radius-lg);

    background: var(--v2-color-surface);
}

.v2-theme #global-search-shortcut.global-header__search-submit {
    position: absolute;
    top: 50%;
    right: 6px;
    z-index: 20;

    width: 82px;
    min-width: 82px;
    height: 42px;
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    padding: 0 16px;

    border: 1px solid var(--v2-color-brand-800);
    border-radius: var(--v2-radius-md);

    background:
        linear-gradient(
            180deg,
            var(--v2-color-brand-700) 0%,
            var(--v2-color-brand-900) 100%
        );

    color: #fff;

    box-shadow:
        0 5px 12px
        rgba(2, 74, 89, 0.22);

    font-family: var(--v2-font-sans);
    font-size: var(--v2-font-size-13);
    font-weight: var(--v2-font-weight-bold);
    line-height: 1;

    cursor: pointer;
}

.v2-theme #global-search-shortcut.global-header__search-submit:hover {
    border-color: var(--v2-color-brand-950);

    background:
        linear-gradient(
            180deg,
            var(--v2-color-brand-800) 0%,
            var(--v2-color-brand-950) 100%
        );

    color: #fff;

    box-shadow:
        0 7px 16px
        rgba(2, 74, 89, 0.27);
}

.v2-theme #global-search-shortcut.global-header__search-submit:focus-visible {
    outline: var(--v2-focus-outline);
    outline-offset: 2px;
}

.v2-theme #global-search-shortcut.global-header__search-submit:disabled {
    opacity: 0.74;
    color: #fff;
    cursor: wait;
}


/* ============================================================
   02 | Shared Workspace Back button
   ============================================================ */

.v2-theme .v2-back-button,
.v2-theme #standard-list-back.v2-back-button {
    min-width: 126px;
    min-height: 56px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 0 18px;

    border: 1px solid var(--v2-color-brand-800);
    border-radius: var(--v2-radius-md);

    background:
        linear-gradient(
            180deg,
            var(--v2-color-brand-700) 0%,
            var(--v2-color-brand-900) 100%
        );

    color: #fff;

    box-shadow:
        0 7px 16px
        rgba(2, 74, 89, 0.23);

    font-family: var(--v2-font-sans);
    font-size: var(--v2-font-size-16);
    font-weight: var(--v2-font-weight-bold);
    line-height: 1;

    cursor: pointer;
}

.v2-theme .v2-back-button:hover,
.v2-theme #standard-list-back.v2-back-button:hover {
    transform: translateY(-1px);

    border-color: var(--v2-color-brand-950);

    background:
        linear-gradient(
            180deg,
            var(--v2-color-brand-800) 0%,
            var(--v2-color-brand-950) 100%
        );

    color: #fff;

    box-shadow:
        0 9px 20px
        rgba(2, 74, 89, 0.28);
}

.v2-theme .v2-back-button:focus-visible,
.v2-theme #standard-list-back.v2-back-button:focus-visible {
    outline: var(--v2-focus-outline);
    outline-offset: 3px;
}

.v2-theme .v2-back-button__arrow {
    color: currentColor;

    font-size: 22px;
    font-weight: var(--v2-font-weight-regular);
    line-height: 1;
}


/* ============================================================
   03 | Small desktop safeguard
   ============================================================ */

@media (max-width: 980px) {
    .v2-theme #global-search-shortcut.global-header__search-submit {
        width: 72px;
        min-width: 72px;

        padding: 0 12px;
    }

    .v2-theme #global-patient-search-input.global-header__search-input {
        padding-right: 88px;
    }

    .v2-theme .v2-back-button,
    .v2-theme #standard-list-back.v2-back-button {
        min-width: 110px;
        min-height: 48px;

        padding: 0 14px;

        font-size: var(--v2-font-size-14);
    }
}
