/*
 * Summary overlay and definition popup styles for Paper Assistant.
 *
 * Styles the floating summary boxes rendered over PDF pages and the
 * hover-based definition popup that appears near the cursor.
 */

/* ── Summary Overlays ────────────────────────────────────────────────── */

.summary-overlay {
    position: absolute;
    background: var(--overlay-bg);
    border: var(--summary-border-width) solid var(--overlay-border);
    border-radius: var(--summary-corner-radius);
    padding: var(--summary-padding);
    font-size: var(--summary-font-size);
    color: var(--overlay-text);
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
    word-wrap: break-word;
    line-height: 1.3;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.summary-overlay:hover {
    box-shadow: 0 2px 8px rgba(0, 85, 170, 0.2);
}

.summary-overlay--hidden {
    display: none;
}

/* ── Debug Overlays ─────────────────────────────────────────────────── */

.debug-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.debug-overlay--paragraph {
    border: 2px solid;
    opacity: 0.3;
}

.debug-overlay--word {
    border: 1px solid;
    opacity: 0.25;
}

/* ── Definition Popup ────────────────────────────────────────────────── */

.definition-popup {
    position: absolute;
    background: var(--popup-bg);
    border: var(--popup-border-width) solid var(--overlay-border);
    border-radius: var(--popup-corner-radius);
    padding: var(--popup-padding);
    max-width: var(--popup-max-width);
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* A hovered word can belong to more than one term, so the popup may list
   several definitions. Separate them so they don't read as one block. */
.definition-popup__entry + .definition-popup__entry {
    margin-top: var(--popup-padding);
    padding-top: var(--popup-padding);
    border-top: var(--popup-border-width) solid var(--overlay-border);
}

.definition-popup__term {
    font-size: var(--popup-font-size);
    font-weight: bold;
    color: var(--popup-term-color);
    margin-bottom: var(--popup-term-def-gap);
}

.definition-popup__text {
    font-size: var(--popup-font-size);
    color: var(--popup-text);
    line-height: 1.4;
}

/* ── Error Dialog ───────────────────────────────────────────────────── */
/* Shell (backdrop/box/header/close/actions/btn) comes from modal.css;
   only the error-specific overrides live here. */

.error-dialog__box {
    min-width: 340px;
    max-width: 480px;
}

.error-dialog__header {
    background: var(--dialog-error-bg, #dc3545);
}

.error-dialog__message {
    padding: 16px;
    font-size: 13px;
    color: var(--toolbar-fg, #333);
    line-height: 1.5;
}

.error-dialog__credits {
    padding: 0 16px 12px;
    font-size: 12px;
    color: #666;
}

.error-dialog__btn--retry {
    background: var(--overlay-border, #0055AA);
    color: #ffffff;
    border-color: var(--overlay-border, #0055AA);
}

.error-dialog__btn--retry:hover {
    opacity: 0.9;
}

.error-dialog__btn--buy {
    background: #28a745;
    color: #ffffff;
    border-color: #28a745;
}

.error-dialog__btn--buy:hover {
    opacity: 0.9;
}

/* ── Quality Regenerate Confirmation ─────────────────────────────────── */
/* Shell comes from modal.css; only the regen-specific overrides live here. */

.quality-regen__box {
    min-width: 340px;
    max-width: 480px;
}

.quality-regen__header {
    background: var(--overlay-border, #0055AA);
}

.quality-regen__message {
    padding: 16px;
    font-size: 13px;
    color: var(--toolbar-fg, #333);
    line-height: 1.5;
}

.quality-regen__btn--confirm {
    background: var(--overlay-border, #0055AA);
    color: #ffffff;
    border-color: var(--overlay-border, #0055AA);
}

.quality-regen__btn--confirm:hover {
    opacity: 0.9;
}
