/* ============================================================
   Inline Editor — template-agnostic UI styles
   Drop-in companion to editor.js. Nothing here references a
   specific template; all classes are namespaced with "ie-".
   ============================================================ */

/* Floating edit / done button (sticky, bottom-right) */
.ie-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: #1A2D7A;
    color: #fff;
    font: 600 15px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ie-fab:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.34); }
.ie-fab:active { transform: translateY(0); }
.ie-fab .ie-fab-icon { width: 16px; height: 16px; }

/* When editing, the button turns into a "Done" state */
body.ie-editing .ie-fab { background: #1f9d55; }

/* Secondary actions appear above the FAB while editing */
.ie-toolbar {
    position: fixed;
    right: 20px;
    bottom: 74px;
    z-index: 2147483000;
    display: none;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}
body.ie-editing .ie-toolbar { display: flex; }

.ie-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    background: #fff;
    color: #1A2D7A;
    font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.12s ease, background 0.15s ease;
}
.ie-toolbar button:hover { transform: translateY(-1px); background: #f4f6ff; }
.ie-toolbar .ie-reset { color: #b42318; }

/* Hover affordance for editable elements while in edit mode */
body.ie-editing [data-ie-editable] {
    outline: 1.5px dashed rgba(26, 45, 122, 0.45);
    outline-offset: 3px;
    cursor: text;
    transition: outline-color 0.12s ease, background 0.12s ease;
    border-radius: 2px;
}
body.ie-editing [data-ie-editable]:hover {
    outline-color: rgba(26, 45, 122, 0.9);
    outline-style: solid;
    background: rgba(26, 45, 122, 0.06);
}
body.ie-editing [data-ie-editable][data-ie-type="image"] { cursor: pointer; }

/* Element currently being edited */
body.ie-editing [data-ie-editable][contenteditable="true"] {
    outline: 2px solid #1A2D7A;
    background: rgba(26, 45, 122, 0.04);
    cursor: text;
}

/* Small "edited" dot marker so the owner can see what changed */
body.ie-editing [data-ie-dirty="true"] {
    outline-color: #1f9d55 !important;
}

/* Image edit hint badge */
body.ie-editing [data-ie-type="image"] {
    position: relative;
}
body.ie-editing [data-ie-type="image"]::after {
    content: "Click to replace";
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(26, 45, 122, 0.92);
    color: #fff;
    font: 600 11px/1 system-ui, sans-serif;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
}
body.ie-editing [data-ie-type="image"]:hover::after { opacity: 1; }

/* Toast notifications */
.ie-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    z-index: 2147483600;
    max-width: min(90vw, 420px);
    padding: 11px 18px;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font: 500 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    text-align: center;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.ie-toast.ie-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Hidden file input used for image replacement */
.ie-file-input { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -9999px; }

@media (prefers-reduced-motion: reduce) {
    .ie-fab, .ie-toolbar button, .ie-toast { transition: none; }
}
