/* ============================================================
   tiptap-flowdesk.css — TipTap Dark Theme für FlowDesk
   Wiederverwendbar: E-Mail, Dokumente, Denkraum
   ============================================================ */

/* === Editor Wrapper === */
.tiptap-editor {
    display: flex;
    flex-direction: column;
    flex: 1;
    border: 1px solid var(--fd-border, #2a3a54);
    border-radius: var(--fd-radius, 8px);
    overflow: hidden;
}

/* === Toolbar === */
.tiptap-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    background: var(--fd-bg-alt, #1a2436);
    border-bottom: 1px solid var(--fd-border, #2a3a54);
}

.tt-group {
    display: flex;
    gap: 0.125rem;
    padding-right: 0.375rem;
    border-right: 1px solid var(--fd-border, #2a3a54);
}
.tt-group:last-child { border-right: none; padding-right: 0; }

/* Buttons */
.tt-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--fd-text-secondary, #94a3b8);
    border-radius: 4px;
    width: 1.75rem;
    height: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.1s;
}
.tt-btn:hover {
    background: var(--fd-hover, #2a3a54);
    color: var(--fd-text, #e2e8f0);
    border-color: var(--fd-border, #2a3a54);
}

.tt-btn.active {
    background: var(--fd-primary, #5fa8d3);
    color: #fff;
    border-color: var(--fd-primary, #5fa8d3);
}

/* Selects */
.tt-select {
    background: var(--fd-bg-alt, #1a2436);
    border: 1px solid var(--fd-border, #2a3a54);
    color: var(--fd-text-secondary, #94a3b8);
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 0.2rem 0.25rem;
    cursor: pointer;
    height: 1.75rem;
}
.tt-select:hover { border-color: var(--fd-primary, #5fa8d3); }
.tt-select:focus { outline: none; border-color: var(--fd-primary, #5fa8d3); }
.tt-select option { background: var(--fd-surface, #1a2436); color: var(--fd-text, #e2e8f0); }
.tt-font { width: 7rem; }
.tt-size { width: 3.5rem; }
.tt-heading { width: 7rem; }

/* Color Inputs */
.tt-color, .tt-color-bg {
    width: 1.75rem; height: 1.75rem;
    border: 1px solid var(--fd-border, #2a3a54);
    border-radius: 4px; cursor: pointer;
    padding: 0; background: none;
}

/* === Editor-Inhalt === */
.tiptap-content {
    flex: 1;
    overflow-y: auto;
    background: var(--fd-input-bg, #1a2436);
}
.tiptap-content .tiptap {
    padding: 0.75rem;
    min-height: 100%;
    color: var(--fd-text, #e2e8f0);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    outline: none;
}

/* Placeholder */
.tiptap-content .tiptap p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    color: var(--fd-text-tertiary, #64748b);
    float: left;
    pointer-events: none;
    height: 0;
    font-style: italic;
}

/* Überschriften */
.tiptap-content .tiptap h1 { font-size: 1.5rem; font-weight: 700; margin: 0.5rem 0; }
.tiptap-content .tiptap h2 { font-size: 1.25rem; font-weight: 700; margin: 0.4rem 0; }
.tiptap-content .tiptap h3 { font-size: 1.1rem; font-weight: 600; margin: 0.3rem 0; }

/* Listen */
.tiptap-content .tiptap ul { list-style: disc; padding-left: 1.5rem; margin: 0.3rem 0; }
.tiptap-content .tiptap ol { list-style: decimal; padding-left: 1.5rem; margin: 0.3rem 0; }
.tiptap-content .tiptap li { margin: 0.1rem 0; }

/* Links */
.tiptap-content .tiptap a,
.tiptap-content .tiptap .tiptap-link {
    color: var(--fd-primary, #5fa8d3);
    text-decoration: underline;
    cursor: pointer;
}

/* Absätze */
.tiptap-content .tiptap p { margin: 0.25rem 0; }

/* Focus-Ring auf Editor-Wrapper */
.tiptap-editor:focus-within {
    border-color: var(--fd-primary, #5fa8d3);
    box-shadow: 0 0 0 2px rgba(95,168,211,0.2);
}

/* === Helle Themes === */
[data-design="premium"].light-mode .tiptap-toolbar,
[data-design="government"].light-mode .tiptap-toolbar {
    background: var(--fd-bg-alt);
}
[data-design="premium"].light-mode .tiptap-content,
[data-design="government"].light-mode .tiptap-content {
    background: var(--fd-input-bg, #fff);
}
