/* ============================
   Editor UI Styling (Updated)
============================ */

:root {
    --editor-bg: #ffffff;
    --editor-border: #e5e7eb;
}

body.dark {
    --editor-bg: #1e1e1e;
    --editor-border: #374151;
}

.editor-container {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ============================
   TinyMCE Overrides
============================ */

/* 1. Force Light Mode Content */
.tox-tinymce, .tox-editor-header, .tox-toolbar, .tox-statusbar, .tox-edit-area, .tox-sidebar-wrap {
    background: #ffffff !important;
    color: #000 !important;
    border-color: #e5e7eb !important;
}

/* 2. Bold Menu Bar */
.tox-menubar .tox-mbtn__select-label {
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    color: #374151 !important;
}

/* 3. BRANDED AI MENU BUTTON (Purple-Blue Gradient) */
.tox-mbtn[aria-label="✨ AI Tools"],
button[aria-label="✨ AI Tools"] {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 0 10px !important;
    margin: 2px 4px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease;
}

.tox-mbtn[aria-label="✨ AI Tools"]:hover,
button[aria-label="✨ AI Tools"]:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

/* 4. POPUP UI IMPROVEMENTS (Clean & Impressive) */
/* Dialog Header */
.tox-dialog__header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.tox-dialog__title {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 1.25rem !important;
}

/* Dialog Body */
.tox-dialog__body {
    padding: 20px !important;
}

/* Labels - BOLD & CLEAN */
.tox-label {
    font-weight: 700 !important;
    color: #334155 !important;
    font-size: 0.9rem !important;
    margin-bottom: 4px !important;
}

/* Inputs - Modern Look */
.tox-textfield, .tox-listbox, .tox-textarea {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    font-size: 0.95rem !important;
    transition: border-color 0.2s;
}
.tox-textfield:focus, .tox-listbox:focus, .tox-textarea:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
}

/* Buttons */
.tox-button--secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600 !important;
}
.tox-button--primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    border: none !important;
    font-weight: 700 !important;
}

/* Hide Branding */
.tox-statusbar__branding, .tox-promotion { display: none !important; }

/* External Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.btn-secondary { background: #4b5563; color: white; }