/*
 * On-site suggestions, docked to the right as a sidebar so the page stays
 * visible while the user explains (and points at) what to change.
 *
 * z-index sits above the page-help and walkthrough panels (both 2000).
 */

.penra-suggest-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    pointer-events: none;
}

.penra-suggest-backdrop[hidden] {
    display: none;
}

.penra-suggest-panel {
    pointer-events: auto;
    width: min(420px, 94vw);
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bs-body-bg, #1b1f24);
    color: var(--bs-body-color, #e6eef6);
    border-left: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.14));
    box-shadow: -0.75rem 0 2rem rgba(0, 0, 0, 0.45);
}

/* Reserve room for the docked sidebar so page content is not covered. */
@media (min-width: 992px) {
    body.penra-suggest-open {
        padding-right: 420px;
        transition: padding-right 0.2s ease-in-out;
    }
}

/* On small screens dock to the bottom as a sheet instead of covering the page. */
@media (max-width: 991.98px) {
    .penra-suggest-backdrop {
        align-items: flex-end;
        justify-content: center;
    }

    .penra-suggest-panel {
        width: 100%;
        height: auto;
        max-height: 75vh;
        border-left: 0;
        border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.14));
        border-bottom: 0;
        border-radius: 0.75rem 0.75rem 0 0;
        box-shadow: 0 -0.75rem 2rem rgba(0, 0, 0, 0.45);
    }
}

.penra-suggest-panel .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.penra-suggest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.12));
}

.penra-suggest-title {
    font-weight: 600;
}

.penra-suggest-body {
    overflow-y: auto;
    padding: 1rem;
}

.penra-suggest-context {
    display: inline-block;
    margin-bottom: 0.6rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--bs-body-color, #e6eef6);
    background: var(--bs-tertiary-bg, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.15));
}

.penra-suggest-intro {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, rgba(255, 255, 255, 0.7));
}

.penra-suggest-status {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.penra-suggest-status[hidden] {
    display: none;
}

.penra-suggest-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.12));
}

/* ---- Element picker -------------------------------------------------- */

.penra-suggest-element {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
    border: 1px solid var(--bs-info, #0dcaf0);
    border-radius: 0.4rem;
    background: rgba(13, 202, 240, 0.08);
}

.penra-suggest-element[hidden] {
    display: none;
}

.penra-suggest-element code {
    color: var(--bs-info, #0dcaf0);
    word-break: break-all;
}

.penra-suggest-element-clear {
    margin-left: auto;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    line-height: 1;
}

.penra-pick-mode,
.penra-pick-mode * {
    cursor: crosshair !important;
}

.penra-pick-highlight {
    /* Use an outline and a subtle ring rather than an opaque background so the
       highlighted element keeps its own colour scheme (a solid button/badge
       would otherwise be repainted by this class while picking). */
    outline: 2px solid var(--bs-warning, #ffc107) !important;
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.35) !important;
}

.penra-pick-label {
    position: fixed;
    z-index: 2600;
    pointer-events: none;
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 0.25rem;
}
