/* Trumbowyg Dark Mode Overrides */

/* Editor box */
body.theme-dark .trumbowyg-box {
    border-color: #4b5563;
    background: #1f2937;
}

/* Button toolbar */
body.theme-dark .trumbowyg-button-pane {
    background: #1e293b;
    border-bottom-color: #4b5563;
}
body.theme-dark .trumbowyg-button-pane::after {
    background: #4b5563;
}
body.theme-dark .trumbowyg-button-pane .trumbowyg-button-group::after {
    background-color: #4b5563;
}
body.theme-dark .trumbowyg-button-pane button {
    color: #d1d5db;
}
body.theme-dark .trumbowyg-button-pane button svg {
    fill: #d1d5db;
    color: #d1d5db;
}
body.theme-dark .trumbowyg-button-pane button:hover,
body.theme-dark .trumbowyg-button-pane button:focus {
    background-color: #374151;
}
body.theme-dark .trumbowyg-button-pane button:hover svg,
body.theme-dark .trumbowyg-button-pane button:focus svg {
    fill: #fff;
    color: #fff;
}
body.theme-dark .trumbowyg-button-pane button.trumbowyg-active,
body.theme-dark .trumbowyg-button-pane button.trumbowyg-active:hover {
    background-color: #3b82f6;
}
body.theme-dark .trumbowyg-button-pane button.trumbowyg-active svg {
    fill: #fff;
}
body.theme-dark .trumbowyg-button-pane button.trumbowyg-disable svg {
    fill: #6b7280;
    opacity: 0.5;
}

/* Editor content area */
body.theme-dark .trumbowyg-editor {
    background: #111827;
    color: #e5e7eb;
    border-color: #4b5563;
}
body.theme-dark .trumbowyg-editor[contenteditable=true]:empty::before {
    color: #6b7280;
}

/* HTML view textarea */
body.theme-dark .trumbowyg-textarea {
    background: #0f172a;
    color: #93c5fd;
    border-color: #4b5563;
}

/* Links inside editor */
body.theme-dark .trumbowyg-editor a {
    color: #60a5fa;
}

/* Dropdown menus */
body.theme-dark .trumbowyg-dropdown {
    background: #1f2937;
    border-color: #4b5563;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
body.theme-dark .trumbowyg-dropdown button {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #374151;
}
body.theme-dark .trumbowyg-dropdown button:hover {
    background: #374151;
    color: #fff;
}

/* Modal overlay */
body.theme-dark .trumbowyg-overlay {
    background: rgba(0,0,0,0.6);
}

/* Modal container (appended to body) */
body.theme-dark .trumbowyg-modal {
    background: transparent;
}

/* Modal box */
body.theme-dark .trumbowyg-modal-box {
    background: #1f2937;
    border-color: #4b5563;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* Modal title */
body.theme-dark .trumbowyg-modal-title {
    color: #e5e7eb;
    background: #111827;
    border-bottom-color: #4b5563;
}

/* Modal input rows */
body.theme-dark .trumbowyg-modal-box .trumbowyg-input-row {
    border-color: #4b5563;
}

/* Modal input labels */
body.theme-dark .trumbowyg-modal-box .trumbowyg-input-infos label {
    color: #d1d5db;
}
body.theme-dark .trumbowyg-modal-box .trumbowyg-input-infos label span {
    color: #9ca3af;
    background: #111827;
    border-color: #4b5563;
}
body.theme-dark .trumbowyg-modal-box .trumbowyg-input-infos span.trumbowyg-msg-error {
    color: #f87171;
}

/* Modal inputs — all input types */
body.theme-dark .trumbowyg-modal-box input,
body.theme-dark .trumbowyg-modal-box textarea,
body.theme-dark .trumbowyg-modal-box select {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #4b5563 !important;
}
body.theme-dark .trumbowyg-modal-box input:hover,
body.theme-dark .trumbowyg-modal-box input:focus,
body.theme-dark .trumbowyg-modal-box textarea:focus,
body.theme-dark .trumbowyg-modal-box select:focus {
    border-color: #3b82f6 !important;
    outline: none;
}
body.theme-dark .trumbowyg-modal-box input::placeholder {
    color: #6b7280;
}

/* Modal input HTML wrapper */
body.theme-dark .trumbowyg-modal-box .trumbowyg-input-html {
    background: transparent;
}

/* Modal buttons */
body.theme-dark .trumbowyg-modal-box .trumbowyg-modal-button {
    color: #fff;
}
body.theme-dark .trumbowyg-modal-box .trumbowyg-modal-submit {
    background: #3b82f6;
}
body.theme-dark .trumbowyg-modal-box .trumbowyg-modal-submit:hover {
    background: #2563eb;
}
body.theme-dark .trumbowyg-modal-box .trumbowyg-modal-reset {
    background: #4b5563;
    color: #e5e7eb;
}
body.theme-dark .trumbowyg-modal-box .trumbowyg-modal-reset:hover {
    background: #6b7280;
}

/* Fullscreen mode */
body.theme-dark .trumbowyg-fullscreen .trumbowyg-box {
    background: #111827;
}

/* Color picker plugin */
body.theme-dark .trumbowyg-dropdown-foreColor,
body.theme-dark .trumbowyg-dropdown-backColor {
    background: #1f2937;
    border-color: #4b5563;
}
body.theme-dark .trumbowyg-dropdown-foreColor button,
body.theme-dark .trumbowyg-dropdown-backColor button {
    border-color: #374151;
}

/* Emoji plugin */
body.theme-dark .trumbowyg-dropdown-emoji {
    background: #1f2937;
    border-color: #4b5563;
}
body.theme-dark .trumbowyg-dropdown-emoji button:hover {
    background: #374151;
}

/* Formatting dropdown */
body.theme-dark .trumbowyg-dropdown-formatting button {
    color: #e5e7eb;
}

/* Scrollbar */
body.theme-dark .trumbowyg-editor::-webkit-scrollbar {
    width: 8px;
}
body.theme-dark .trumbowyg-editor::-webkit-scrollbar-track {
    background: #1f2937;
}
body.theme-dark .trumbowyg-editor::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}
body.theme-dark .trumbowyg-editor::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}
