/* ============================================= */
/* STYLES FOR THE VISUAL EDITOR UI         */
/* ============================================= */

/* --- The 'Back' Button (New) --- */
.editor-back-button {
    position: fixed;
    top: 25px;
    left: 25px;
    width: 44px;
    height: 44px;
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10000;
    transition: all 0.2s ease-out;
}
.editor-back-button:hover {
    transform: scale(1.1);
    border-color: #3B82F6;
}
.editor-back-button svg {
    width: 24px;
    height: 24px;
    color: #374151;
}


/* --- The 'Edit' Icon Button (Updated) --- */
.edit-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    background-color: #3B82F6; /* brand-primary color */
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    opacity: 1; /* Always visible */
    transform: scale(1);
    transition: all 0.2s ease-out;
}
.edit-btn:hover {
    transform: scale(1.15); /* Add a hover effect */
}
.edit-btn svg {
    width: 16px;
    height: 16px;
}

/* --- Style for Editable Text --- */
[contenteditable="true"] {
    outline: 2px dashed #3B82F6;
    background-color: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    cursor: text;
}
[data-editable] {
    position: relative;
    /* Add a subtle border on hover to show the entire editable area */
    border: 1px dashed transparent;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}
[data-editable]:hover {
    border-color: rgba(59, 130, 246, 0.3);
}


/* --- Floating Save Button (Unchanged) --- */
.fab-save-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background-color: #3B82F6;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.fab-save-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
}
.fab-save-button svg {
    width: 28px;
    height: 28px;
    transition: all 0.2s ease;
}
.fab-save-button.is-loading svg.save-icon { display: none; }
.fab-save-button .spinner {
    display: none;
    width: 28px;
    height: 28px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.fab-save-button.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }