/* ─────────────────────────────────────────────────────────────────────────────
   PdfEditor.css  —  Estilos GLOBAIS para overlays do editor PDF visual.
   Precisa ser global (não scoped) porque os elementos são injetados via JS
   e não recebem os atributos de escopo do Blazor.
───────────────────────────────────────────────────────────────────────────── */

/* ── Wrapper de página ───────────────────────────────────────────────────── */

.pfe-page-wrap {
    position: relative;
    margin: 0 auto 24px;
    background: #fff;
    box-shadow: 0 6px 28px rgba(0, 0, 0, .22), 0 1px 4px rgba(0, 0, 0, .1);
    border-radius: 2px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Overlay de campo ────────────────────────────────────────────────────── */
/*
   Fundo BRANCO sólido: cobre o texto {campo} original do PDF.
   Só a borda colorida indica que é um campo editável.
*/

.pfe-field {
    position: absolute;
    display: flex;
    align-items: center;
    border-radius: 2px;
    box-sizing: border-box;
    cursor: move;
    z-index: 10;
    padding: 0 4px;
    min-width: 24px;
    min-height: 12px;
    background: #ffffff;                          /* branco — apaga o {campo} do PDF */
    border: 1.5px dashed rgba(59, 130, 246, 0.55);
    transition: background 0.13s, border-color 0.13s, box-shadow 0.13s;
}

.pfe-field.custom {
    border-color: rgba(22, 163, 74, 0.55);
}

/* Hover */
.pfe-field:hover {
    background: rgba(239, 246, 255, 1);          /* azul muito claro */
    border-color: #3b82f6;
    border-style: solid;
    z-index: 15;
}

.pfe-field.custom:hover {
    background: rgba(240, 253, 244, 1);          /* verde muito claro */
    border-color: #16a34a;
}

/* Selecionado */
.pfe-field.selected {
    background: rgba(219, 234, 254, 0.98);
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
    z-index: 20;
}

.pfe-field.selected.custom {
    background: rgba(220, 252, 231, 0.98);
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

/* ── Label do campo ──────────────────────────────────────────────────────── */

.pfe-field-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    flex: 1;
    line-height: 1;
    transition: color 0.13s;
}

.pfe-field.preset .pfe-field-label { color: #3b82f6; }
.pfe-field.custom .pfe-field-label { color: #16a34a; }

.pfe-field.selected.preset .pfe-field-label { color: #1e40af; font-weight: 700; }
.pfe-field.selected.custom .pfe-field-label { color: #15803d; font-weight: 700; }

/* ── Alça de redimensionamento ───────────────────────────────────────────── */

.pfe-resize-handle {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 9px;
    height: 9px;
    background: #3b82f6;
    border: 1px solid #fff;
    border-radius: 2px;
    cursor: se-resize;
    z-index: 5;
    display: none;
    flex-shrink: 0;
}

.pfe-field.selected .pfe-resize-handle {
    display: block;
}

.pfe-field.selected.custom .pfe-resize-handle {
    background: #16a34a;
}

/* ── Toolbar flutuante ───────────────────────────────────────────────────── */

.pfe-toolbar {
    position: fixed;
    display: none;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
    padding: 5px 10px;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    z-index: 9999;
    pointer-events: all;
}

.pfe-toolbar-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pfe-name-input {
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 12px;
    width: 150px;
    outline: none;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.15s;
}

    .pfe-name-input:focus {
        border-color: #3b82f6;
        background: #fff;
    }

.pfe-del-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    line-height: 1;
    transition: background 0.13s;
}

    .pfe-del-btn:hover {
        background: #fee2e2;
    }
