﻿:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --bg: #f4f7f6;
    --card-bg: #ffffff;
    --border: #dcdde1;
    --text: #333;
    --meta-color: #9b59b6;
    --danger: #e74c3c;
    --var-color: #27ae60;
    --doc-color: #e67e22;
    --readonly-bg: #f0f2f5;
    --speed: 0.5s; /* Sikrer konsekvent langsom animation i overensstemmelse med System 2 principper */
}

.editor-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    flex-grow: 1;
    overflow: hidden;
}

.editor-left-panel {
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.1);
    transition: width var(--speed) ease, opacity var(--speed) ease, padding var(--speed) ease;
    width: 140px;
    overflow: hidden;
}

    .editor-left-panel.panel-closed {
        width: 0;
        padding-left: 0;
        padding-right: 0;
        opacity: 0;
        border-right: none;
    }

.action-zone {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.toolbox-filters {
    padding: 10px;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.filter-header {
    margin-bottom: 8px;
    opacity: 0.7;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.65rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    cursor: pointer;
}

.editor-toolbox {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    padding: 5px 8px;
    gap: 6px;
    max-height: 440px;
    overflow-x: auto;
    overflow-y: hidden;
}

.tool-icon {
    width: 110px;
    padding: 5px 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: grab;
    font-size: 0.6rem;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity var(--speed) ease;
    flex-shrink: 0;
}

    .tool-icon.hidden {
        display: none;
    }

    .tool-icon.meta {
        border-left: 4px solid var(--meta-color);
    }

    .tool-icon.variable {
        border-left: 4px solid var(--var-color);
    }

    .tool-icon.dokumentation {
        border-left: 4px solid var(--doc-color);
    }

.editor-canvas-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 600px;
    position: relative;
    overflow: hidden;
}

.canvas-header {
    font-size: 0.8em;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

    .canvas-header > span:last-child {
        margin-left: auto;
    }

.editor-canvas {
    background: white;
    flex-grow: 1;
    height: auto;
    overflow-y: auto;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px 20px 90px 20px;
    margin-bottom: 0;
}

.canvas-item {
    background: var(--bg);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    transition: border-color var(--speed);
}

    .canvas-item.active {
        border-color: var(--accent);
        border-width: 2px;
    }

.item-header {
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    transition: background var(--speed);
    cursor: pointer;
}

.canvas-item.active .editor-item-header {
    background: #ebf5fb;
}

.canvas-item .tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
}

.item-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.canvas-item.active .item-content-wrapper {
    grid-template-rows: 1fr;
}

.item-content-inner {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity var(--speed) ease-in-out;
}

.canvas-item.active .item-content-inner {
    opacity: 1;
}

.inner-padding {
    padding: 18px;
    border-top: 1px solid var(--border);
}

/* Modificeret animation af prompt-intro med indkapsling for at overholde display: table-row logik */
.meta-prompt-intro-row th,
.meta-prompt-intro-row td {
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: none;
    transition: padding var(--speed) ease-in-out;
}

.meta-prompt-intro-row .anim-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows var(--speed) cubic-bezier(0.4, 0, 0.2, 1), opacity var(--speed) ease-in-out;
}

    .meta-prompt-intro-row .anim-wrapper > div {
        overflow: hidden;
    }

.meta-prompt-intro-row.visible th,
.meta-prompt-intro-row.visible td {
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.meta-prompt-intro-row.visible .anim-wrapper {
    grid-template-rows: 1fr;
    opacity: 1;
}

.prop-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

    .prop-table th, .prop-table td {
        text-align: left;
        padding: 8px;
        border-bottom: 1px solid var(--border);
        vertical-align: top;
        font-size: 0.85rem;
    }

    .prop-table th {
        width: 25%;
        color: var(--primary);
        font-weight: 600;
    }

    .prop-table textarea, .prop-table input {
        width: 100%;
        padding: 6px;
        border: 1px solid #eee;
        background: #fdfdfd;
        font-family: inherit;
        box-sizing: border-box;
    }

    .prop-table textarea {
        height: 25vh;
    }

.editor-content-area {
    min-height: 160px;
    resize: vertical;
}

.readonly-text-display {
    background-color: var(--readonly-bg);
    color: var(--cool-gray);
    font-style: italic;
    border: 1px solid #ddd;
    padding: 6px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.85rem;
}

.crud-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
    padding: 15px 5px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
}

.trash-zone {
    height: 50px;
    flex-grow: 1;
    max-width: 80px;
    border: 2px dashed var(--danger);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--danger);
    font-size: 1.5rem;
    transition: var(--speed);
}

    .trash-zone.drag-over {
        background: var(--danger);
        color: white;
        border-style: solid;
    }

button.editor {
    padding: 10px 10px;
    border-radius: 4px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: x-small;
}

    button.editor.danger-btn {
        background: var(--danger);
        border-color: var(--danger);
    }

.btn-small {
    font-size: 0.7rem;
    padding: 6px;
    width: 100%;
}

.tag.meta {
    background: var(--meta-color);
}

.tag.variable {
    background: var(--var-color);
}

.tag.dokumentation {
    background: var(--doc-color);
}

#lo-name-display {
    font-size: 1em;
    border-style: solid;
    border-width: thin;
    border-color: darkgrey;
    display: inline-block;
    width: 250px;
    margin-left: 10px;
    outline: none;
    padding: 2px 5px;
}

#lo-id-display {
    font-size: 0.8em;
}

#select_field {
    padding: 4px;
    font-size: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
}

    #select_field option {
        padding-right: 10px;
    }

h3.canvas-header div {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

    h3.canvas-header div label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--primary);
    }

.canvas-item.fixed-item .item-header {
    cursor: pointer;
}

.canvas-item:not(.fixed-item) .item-header {
    cursor: grab;
}

    .canvas-item:not(.fixed-item) .item-header:active {
        cursor: grabbing;
    }

.side-panel.left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.prop-table tr.help-row th,
.prop-table tr.help-row td {
    border-bottom: none;
    padding-top: 10px;
    padding-bottom: 4px;
}
