
.fied-editor-root {
    position: relative;
    border: 1px solid var(--border-light, #3f4359);
    background: var(--bg-card, #282b3a);
    box-shadow: var(--shadow-card, 0 2px 8px rgba(0, 0, 0, 0.15));
    border-radius: 0px !important;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fied-editor-root:focus-within {
    border-color: var(--primary-blue, #367bf5) !important;
    box-shadow: 0 0 0 2px var(--primary-blue-glow, rgba(54, 123, 245, 0.25)) !important;
}

/* ── ARAÇ ÇUBUĞU (TOOLBAR) ── */
.fied-editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding: 0.35rem 0.45rem;
    background: var(--bg-cat-header, #1b1c26);
    border-bottom: 1px solid var(--border-light, #3f4359);
    user-select: none;
}

.fied-toolgroup {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.fied-tool-sep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: var(--border-light, #3f4359);
    margin: 0 0.25rem;
    opacity: 0.6;
    align-self: center;
}

/* Araç Çubuğu Butonları */
.fied-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 27px;
    padding: 0 4px;
    margin: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0px !important;
    color: #cbd5e1;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.12s ease;
    box-sizing: border-box;
}

.fied-btn:hover {
    background: rgba(54, 123, 245, 0.12) !important;
    border-color: rgba(54, 123, 245, 0.35) !important;
    color: var(--primary-blue, #367bf5) !important;
}

.fied-btn.is-active,
.fied-btn.active {
    background: rgba(54, 123, 245, 0.22) !important;
    border-color: var(--primary-blue, #367bf5) !important;
    color: var(--primary-blue, #367bf5) !important;
}

.fied-btn-dropdown {
    width: auto !important;
    padding: 0 6px !important;
    gap: 3px;
}

/* Dropdown Kapsayıcı ve Popover Menüleri */
.fied-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.fied-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    margin-top: 4px;
    background: var(--bg-card, #282b3a);
    border: 1px solid var(--border-light, #3f4359);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    padding: 0.4rem;
    border-radius: 0px !important;
}

.fied-popover-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.4rem 0.35rem 0.4rem;
    border-bottom: 1px solid var(--border-light, #3f4359);
    margin-bottom: 0.35rem;
}

.fied-menu-popover {
    min-width: 170px;
    padding: 0.25rem 0;
}

.fied-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    color: var(--text-primary, #f3f4f8);
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
}

.fied-menu-item:hover {
    background: rgba(54, 123, 245, 0.15);
    color: var(--primary-blue, #367bf5);
}

/* Renk Seçim Izgarası */
.fied-color-popover {
    width: 156px;
}
.fied-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px;
}
.fied-color-dot {
    width: 26px;
    height: 26px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.2);
    transition: transform 0.1s, box-shadow 0.1s;
}
.fied-color-dot:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px var(--primary-blue);
}

/* Emoji Izgarası */
.fied-emoji-popover {
    width: 248px !important;
    max-width: 248px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
.fied-emoji-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 3px !important;
    padding: 6px 4px 6px 6px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-size: 19px !important;
    box-sizing: border-box !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--border-light, #3f4359) transparent !important;
}
.fied-emoji-grid::-webkit-scrollbar {
    width: 5px !important;
}
.fied-emoji-grid::-webkit-scrollbar-track {
    background: transparent !important;
}
.fied-emoji-grid::-webkit-scrollbar-thumb {
    background: var(--border-light, #3f4359) !important;
    border-radius: 3px !important;
}
.fied-emoji-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 19px !important;
    width: 32px !important;
    height: 32px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    user-select: none !important;
    line-height: 1.2 !important;
    transition: background 0.12s, transform 0.12s !important;
}
.fied-emoji-item:hover {
    background: rgba(54, 123, 245, 0.15) !important;
    transform: scale(1.15) !important;
}

/* Taslak Bildirim Rozeti */
.fied-draft-pill {
    display: none;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--success, #22c55e);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 2px 6px;
    margin-right: 4px;
    user-select: none;
}

/* BBCode Butonu */
.fied-bbcode-toggle-btn {
    width: auto !important;
    min-width: 34px !important;
    padding: 0 6px !important;
    white-space: nowrap !important;
    font-family: var(--font-mono, monospace) !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    color: var(--text-muted, #94a3b8);
    letter-spacing: 1px;
}
.fied-bbcode-toggle-btn.is-active,
.fied-bbcode-toggle-btn.active {
    background: rgba(54, 123, 245, 0.25) !important;
    border-color: var(--primary-blue) !important;
    color: var(--primary-blue) !important;
}

/* ── TIPTAP PROSEMIRROR GÖVDE VE İÇERİK ALANI ── */
.fied-editor-body-wrap {
    position: relative;
    width: 100%;
}

.ProseMirror {
    width: 100%;
    min-height: 120px;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-primary, #f3f4f8);
    background: var(--bg-input, #12141d) !important;
    outline: none !important;
    box-sizing: border-box;
    word-break: break-word;
    overflow-y: auto;
    cursor: text;
    transition: none !important;
}

.ProseMirror:focus,
.ProseMirror.ProseMirror-focused {
    background: var(--bg-input, #12141d) !important;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: var(--text-muted, #64748b);
    opacity: 0.75;
    pointer-events: none;
    height: 0;
}

.ProseMirror p { margin: 0 0 0.65rem 0; }
.ProseMirror p:last-child { margin-bottom: 0; }

.ProseMirror blockquote {
    
    background: rgba(54, 123, 245, 0.06);
    padding: 0.65rem 1rem;
    margin: 0.65rem 0;
    font-style: italic;
    color: var(--text-secondary, #cbd5e1);
}

.ProseMirror pre {
    background: var(--bg-code, #191a24);
    border: 1px solid var(--border-light, #3f4359);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: #38bdf8;
    margin: 0.65rem 0;
    overflow-x: auto;
}

.ProseMirror code {
    background: var(--bg-code, #191a24);
    color: #38bdf8;
    padding: 0.15rem 0.35rem;
    font-size: 0.85em;
    font-family: var(--font-mono, monospace);
}

.ProseMirror img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-light, #3f4359);
    margin: 0.5rem 0;
    display: inline-block;
}

.ProseMirror a {
    color: var(--primary-blue, #367bf5);
    text-decoration: underline;
    cursor: pointer;
}

.ProseMirror hr {
    border: 0;
    border-top: 1px solid var(--border-light, #3f4359);
    margin: 1.25rem 0;
}

.ProseMirror ul, .ProseMirror ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0 0.75rem 0;
}

.ProseMirror table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    table-layout: fixed;
}
.ProseMirror th, .ProseMirror td {
    border: 1px solid var(--border-light, #3f4359);
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    box-sizing: border-box;
}
.ProseMirror th {
    background: var(--bg-cat-header, #1b1c26);
    font-weight: 500;
}

/* Ham BBCode Textarea */
.fied-editor-raw {
    width: 100%;
    padding: 1rem 1.15rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-primary, #f3f4f8);
    background: var(--bg-code, #191a24);
    border: none;
    outline: none;
    box-sizing: border-box;
    resize: vertical;
}

/* ── MODALLAR & POPUPS ── */
.fied-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.fied-modal-box {
    background: var(--bg-card, #282b3a);
    border: 1px solid var(--border-light, #3f4359);
    box-shadow: 0 12px 36px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 480px;
    border-radius: 0px !important;
    animation: fiedModalPop 0.15s ease-out;
}

@keyframes fiedModalPop {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.fied-modal-header {
    background: var(--bg-cat-header, #1b1c26);
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--border-light, #3f4359);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.92rem;
    color: var(--text-cat-header, #ffffff);
}

.fied-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.fied-modal-close:hover { color: var(--danger, #ef4444); }

.fied-modal-body {
    padding: 1.25rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fied-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.fied-modal-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary, #f3f4f8);
}
.fied-modal-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.86rem;
    background: var(--bg-input, #1e202c);
    border: 1px solid var(--border-light, #3f4359);
    color: var(--text-primary, #f3f4f8);
    box-sizing: border-box;
    outline: none;
}
.fied-modal-input:focus {
    border-color: var(--primary-blue, #367bf5);
}

.fied-modal-footer {
    padding: 0.75rem 1.15rem;
    background: var(--bg-cat-header, #1b1c26);
    border-top: 1px solid var(--border-light, #3f4359);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Sürükle Bırak Dropzone */
.fied-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.75rem 1rem;
    border: 2px dashed var(--border-light, #3f4359);
    background: rgba(54, 123, 245, 0.03);
    cursor: pointer;
    text-align: center;
    gap: 0.45rem;
    transition: all 0.15s;
}
.fied-dropzone:hover, .fied-dropzone.dragover {
    border-color: var(--primary-blue, #367bf5);
    background: rgba(54, 123, 245, 0.08);
}

.fied-tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-light, #3f4359);
    background: var(--bg-card-secondary, #2f3244);
}
.fied-tab-btn {
    flex: 1;
    padding: 0.55rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.fied-tab-btn.active {
    color: var(--primary-blue, #367bf5);
    border-bottom-color: var(--primary-blue, #367bf5);
    background: var(--bg-card, #282b3a);
}

/* Gündüz Modu TipTap İçerik ve Blok Stilleri */
html[data-theme="light"] .ProseMirror,
html.light-theme .ProseMirror,
body.light-theme .ProseMirror {
    background: #ffffff !important;
    color: #1e293b !important;
}

html[data-theme="light"] .ProseMirror blockquote,
html.light-theme .ProseMirror blockquote,
body.light-theme .ProseMirror blockquote {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    
    border-radius: 4px !important;
    color: #1e293b !important;
    font-style: normal !important;
    padding: 0.75rem 1rem !important;
    margin: 0.75rem 0 !important;
}

html[data-theme="light"] .ProseMirror blockquote p,
html.light-theme .ProseMirror blockquote p,
body.light-theme .ProseMirror blockquote p {
    color: #1e293b !important;
    margin-bottom: 0.35rem !important;
}

html[data-theme="light"] .ProseMirror pre,
html[data-theme="light"] .ProseMirror pre.fied-code-block,
html.light-theme .ProseMirror pre,
html.light-theme .ProseMirror pre.fied-code-block,
body.light-theme .ProseMirror pre,
body.light-theme .ProseMirror pre.fied-code-block {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    
    border-radius: 6px !important;
    color: #0f172a !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
    padding: 0.85rem 1.15rem !important;
    margin: 0.75rem 0 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    overflow-x: auto !important;
}

html[data-theme="light"] .ProseMirror pre code,
html.light-theme .ProseMirror pre code,
body.light-theme .ProseMirror pre code {
    background: transparent !important;
    border: none !important;
    color: #0f172a !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
}

html[data-theme="light"] .ProseMirror code:not(pre code),
html.light-theme .ProseMirror code:not(pre code),
body.light-theme .ProseMirror code:not(pre code) {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #e11d48 !important;
    border-radius: 4px !important;
    padding: 0.15rem 0.4rem !important;
    font-size: 0.86em !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

html[data-theme="light"] .ProseMirror hr,
html.light-theme .ProseMirror hr,
body.light-theme .ProseMirror hr {
    border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .ProseMirror th,
html.light-theme .ProseMirror th,
body.light-theme .ProseMirror th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .ProseMirror td,
html.light-theme .ProseMirror td,
body.light-theme .ProseMirror td {
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

/* Gündüz Modu Editör Modalları */
html[data-theme="light"] .fied-modal-box,
html.light-theme .fied-modal-box,
body.light-theme .fied-modal-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18) !important;
}

html[data-theme="light"] .fied-modal-header,
html.light-theme .fied-modal-header,
body.light-theme .fied-modal-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .fied-modal-header strong,
html.light-theme .fied-modal-header strong,
body.light-theme .fied-modal-header strong {
    color: #0f172a !important;
}

html[data-theme="light"] .fied-modal-header svg,
html.light-theme .fied-modal-header svg,
body.light-theme .fied-modal-header svg {
    stroke: #2563eb !important;
}

html[data-theme="light"] .fied-modal-close,
html.light-theme .fied-modal-close,
body.light-theme .fied-modal-close {
    color: #64748b !important;
}

html[data-theme="light"] .fied-modal-close:hover,
html.light-theme .fied-modal-close:hover,
body.light-theme .fied-modal-close:hover {
    color: #ef4444 !important;
}

html[data-theme="light"] .fied-tab-header,
html.light-theme .fied-tab-header,
body.light-theme .fied-tab-header {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .fied-tab-btn,
html.light-theme .fied-tab-btn,
body.light-theme .fied-tab-btn {
    color: #64748b !important;
    background: transparent !important;
    border-bottom: 2px solid transparent !important;
}

html[data-theme="light"] .fied-tab-btn:hover,
html.light-theme .fied-tab-btn:hover,
body.light-theme .fied-tab-btn:hover {
    color: #1e293b !important;
}

html[data-theme="light"] .fied-tab-btn.active,
html.light-theme .fied-tab-btn.active,
body.light-theme .fied-tab-btn.active {
    color: #2563eb !important;
    border-bottom-color: #2563eb !important;
    background: #ffffff !important;
}

html[data-theme="light"] .fied-modal-body,
html.light-theme .fied-modal-body,
body.light-theme .fied-modal-body {
    background: #ffffff !important;
    color: #1e293b !important;
}

html[data-theme="light"] .fied-modal-field label,
html.light-theme .fied-modal-field label,
body.light-theme .fied-modal-field label {
    color: #334155 !important;
}

html[data-theme="light"] .fied-modal-input,
html.light-theme .fied-modal-input,
body.light-theme .fied-modal-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .fied-modal-input:focus,
html.light-theme .fied-modal-input:focus,
body.light-theme .fied-modal-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

html[data-theme="light"] .fied-dropzone,
html.light-theme .fied-dropzone,
body.light-theme .fied-dropzone {
    background: #f8fafc !important;
    border: 2px dashed #cbd5e1 !important;
}

html[data-theme="light"] .fied-dropzone:hover,
html.light-theme .fied-dropzone:hover,
body.light-theme .fied-dropzone:hover {
    border-color: #2563eb !important;
    background: #eff6ff !important;
}

html[data-theme="light"] .fied-dropzone-content span,
html.light-theme .fied-dropzone-content span,
body.light-theme .fied-dropzone-content span {
    color: #334155 !important;
}

html[data-theme="light"] .fied-modal-footer,
html.light-theme .fied-modal-footer,
body.light-theme .fied-modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .fied-modal-footer .btn-action-outline,
html.light-theme .fied-modal-footer .btn-action-outline,
body.light-theme .fied-modal-footer .btn-action-outline {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

html[data-theme="light"] .fied-modal-footer .btn-action-outline:hover,
html.light-theme .fied-modal-footer .btn-action-outline:hover,
body.light-theme .fied-modal-footer .btn-action-outline:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .fied-modal-footer .btn-action-primary,
html.light-theme .fied-modal-footer .btn-action-primary,
body.light-theme .fied-modal-footer .btn-action-primary {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}
