﻿/* Editor styles for the code editor component */
:root {
    /* Container + editor background */
    --editor-bg: var(--mud-palette-surface);
    /* Text inside editor */
    --editor-text: var(--mud-palette-text-primary);
    /* Border around editor and buttons */
    --editor-border: var(--mud-palette-divider);
    /* Button default background */
    --editor-button-bg: var(--mud-palette-background);
    /* Button hover */
    --editor-button-hover: var(--mud-palette-hover);
    /* Button active / pressed */
    --editor-button-active: var(--mud-palette-primary-dark);
}

@media (prefers-color-scheme: dark) {
    :root {
        --editor-bg: #1e1e1e;
        --editor-text: #eee;
        --editor-border: #444;
        --editor-button-bg: #333;
        --editor-button-hover: #444;
        --editor-button-active: #555;
    }
}

.editor-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--editor-bg);
    border: 1px solid var(--editor-border);
    padding: 10px;
    border-radius: 6px;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--editor-text);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

    .editor-toolbar button {
        padding: 4px 8px;
        font-size: 14px;
        background-color: var(--editor-button-bg);
        border: 1px solid var(--editor-border);
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.2s ease;
        color: inherit;
    }

        .editor-toolbar button:hover {
            background-color: var(--editor-button-hover);
        }

        .editor-toolbar button:active {
            background-color: var(--editor-button-active);
        }

#editor {
    /*min-height: 200px;*/
    flex-grow: 1;
    min-height: 250px;
    padding: 10px;
    border: 1px solid var(--editor-border);
    background-color: var(--editor-bg);
    color: var(--editor-text);
    outline: none;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 4px;
}

    #editor a {
        color: var(--mud-palette-primary);
        text-decoration: underline;
    }

    #editor.listing-preview-mode {
        background-color: white !important;
        color: black !important;
        font-family: Arial, sans-serif;
    }

        #editor.listing-preview-mode a {
            color: #0064d2 !important; /* eBay's branded blue or use black (#000) */
            text-decoration: underline;
        }

.editor-context-menu {
    position: absolute;
    z-index: 9999;
    padding: 4px;
    border: 1px solid var(--editor-border, #ccc);
    background-color: var(--editor-bg, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: none;
}

.editor-image-wrapper {
    position: relative;
    display: inline-block;
}

.delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
