/**
 *
 * Frontend für den Inline-Editor
 * Copyright (c) 2025 netzmal GmbH
 *
 */

/* Blöcke hervorheben, sobald body.editor-active gesetzt ist
   UND das Element contentEditable="true" hat */

body.editorActive .edit:not([id]) {
    background: rgba(255, 0, 0, 0.5) !important;
}

body.editorActive [contenteditable="true"] {
    outline: 1px dashed #999;
    background: rgba(255,255,0,0.5);
    cursor: text;
}

/* Buttons */
#editorEditIcon, #editorSaveIcon, #editorCancelIcon {
    cursor: pointer;
}

#editorSaveIcon,
#editorCancelIcon {
    transition: transform 0.2s ease;
}

#editorSaveIcon:hover,
#editorCancelIcon:hover {
    transform: translateY(-4px);
}

/* Login-Overlay */
/* Übergeordnetes Overlay */
#editorModalBackground {
    position: fixed;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    transition: opacity 0.2s ease;
    opacity: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
#editorModalBackground.active {
    display: flex;
    opacity: 1;
}

/* Das tatsächliche Dialog-Fenster */
#editorLoginBox {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    width: 320px;
    max-width: 90%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: sans-serif;
    color: #333;
}

/* Dialog-Titel */
#editorLoginBox h2 {
    margin: 0;
    font-size: 1.5rem;
}

/* Beschreibungstext */
#editorLoginBox p {
    margin: 0;
    font-size: 1rem;
    color: #555;
}

/* Formular-Container für Input + Button */
#editorLoginForm {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Input-Feld */
#editorPasswordInput {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline-offset: 2px;
}

/* Button */
#editorLoginButton {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
#editorLoginButton:hover {
    background-color: #0055aa;
}

/* Optional: Close-Icon oben rechts */
#editorLoginBox .close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #888;
}
#editorLoginBox .close-btn:hover {
    color: #333;
}