/* ==========================================================================
   VRYNO LOOKUP  --  the dropdown under a reference field, and the dialog the
   footer row opens. Behaviour is in assets/js/vryno-lookup.js, which explains
   what this is for.
   ==========================================================================

   Tokens only, no literal greys and no dark-mode block: this theme inverts its
   own scale, so a rule written in tokens is already right in both. The one
   exception is the backdrop, which is black at low opacity in either theme
   because that is what a backdrop is.
   ========================================================================== */

/* -------------------------------------------------------------- the panel */

.vr-lk-panel {
    position: absolute;
    z-index: 1056;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgb(30 20 90 / 14%);
    overflow: hidden;
}

.vr-lk-body {
    max-height: 232px;
    overflow-y: auto;
}

.vr-lk-row {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.vr-lk-row:last-child {
    border-bottom: 0;
}

.vr-lk-row:hover,
.vr-lk-row:focus-visible {
    background: var(--light);
}

.vr-lk-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--heading-color);
    line-height: 1.3;
}

.vr-lk-meta {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--gray-500);
}

.vr-lk-k {
    color: var(--gray-500);
}

.vr-lk-v {
    color: var(--gray-700);
    font-weight: 500;
}

.vr-lk-empty {
    margin: 0;
    padding: 16px 14px;
    font-size: 13px;
    color: var(--gray-500);
}

/* The footer stays while the list scrolls -- "add one" is the answer when
   nothing in the list is right, which is exactly when you have scrolled to the
   bottom looking for it. */
.vr-lk-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--border-color);
    background: var(--primary-transparent);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
}

.vr-lk-add:hover {
    background: var(--primary-light);
}

.vr-lk-add i {
    font-size: 16px;
}

/* -------------------------------------------------------------- the dialog */

.vr-lk-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgb(0 0 0 / 45%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.vr-lk-modal {
    width: 100%;
    max-width: 640px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgb(16 16 48 / 28%);
    overflow: hidden;
}

.vr-lk-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.vr-lk-modal-head h5 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--heading-color);
}

.vr-lk-x {
    border: 0;
    background: transparent;
    color: var(--gray-500);
    font-size: 18px;
    line-height: 1;
}

.vr-lk-x:hover {
    color: var(--danger);
}

.vr-lk-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.vr-lk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.vr-lk-field .form-label {
    display: block;
    margin-bottom: 6px;
}

.vr-lk-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 575.98px) {
    .vr-lk-grid {
        grid-template-columns: 1fr;
    }
}
