/* ==========================================================================
   CKEditor 5 Custom Theme - ForumREXAR (StarTimes Style)
   ========================================================================== */

.ck-editor-container {
    width: 100%;
    margin-bottom: 12px;
    direction: rtl;
    text-align: right;
}

.ck.ck-editor {
    width: 100% !important;
    position: relative;
    box-sizing: border-box;
}

/* 1. Editor Toolbar */
.ck.ck-toolbar {
    background: #f1f6fa !important;
    border: 1px solid #9abed8 !important;
    border-bottom: 1px solid #c5dcee !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 6px 8px !important;
    direction: rtl !important;
    flex-wrap: wrap !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.ck.ck-toolbar .ck-toolbar__items {
    direction: rtl !important;
    flex-wrap: wrap !important;
    gap: 2px !important;
}

.ck.ck-button {
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    color: #1e293b !important;
}

.ck.ck-button:hover:not(.ck-disabled) {
    background: #e2eef7 !important;
    color: #0284c7 !important;
}

.ck.ck-button.ck-on {
    background: #23709b !important;
    color: #ffffff !important;
}

.ck.ck-button.ck-on:hover:not(.ck-disabled) {
    background: #1a5c80 !important;
}

.ck.ck-toolbar__separator {
    background: #9abed8 !important;
    opacity: 0.6 !important;
    margin: 0 4px !important;
}

/* 2. Editable Content Area */
.ck.ck-content.ck-editor__editable {
    border: 1px solid #9abed8 !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    background: #ffffff !important;
    padding: 16px 20px !important;
    min-height: 220px;
    font-family: 'Cairo', Tahoma, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
    color: #1e293b !important;
    direction: rtl !important;
    text-align: right !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.ck.ck-content.ck-editor__editable.ck-focused {
    border-color: #23709b !important;
    box-shadow: 0 0 0 2px rgba(35, 112, 155, 0.18) !important;
    outline: none !important;
}

/* Compact version for PM replies or quick reply */
.ck-editor-compact .ck.ck-content.ck-editor__editable {
    min-height: 140px;
}

/* Content Elements Inside CKEditor */
.ck.ck-content blockquote {
    border-right: 4px solid #23709b !important;
    border-left: none !important;
    background: #f8fafc !important;
    padding: 10px 16px !important;
    margin: 12px 0 !important;
    border-radius: 4px !important;
    color: #334155 !important;
    font-style: italic !important;
}

.ck.ck-content table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 12px 0 !important;
    border: 1px solid #b5d2e7 !important;
}

.ck.ck-content table th {
    background: #23709b !important;
    color: #ffffff !important;
    border: 1px solid #9abed8 !important;
    padding: 8px 12px !important;
    text-align: right !important;
}

.ck.ck-content table td {
    border: 1px solid #b5d2e7 !important;
    padding: 8px 12px !important;
}

.ck.ck-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px !important;
    margin: 8px 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Dropdown styling */
.ck.ck-dropdown .ck-dropdown__panel {
    border-radius: 6px !important;
    border: 1px solid #9abed8 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

/* ==========================================================================
   Rendered Content Styles (for Topics, Posts, and PMs)
   ========================================================================== */
.st-rendered-content {
    line-height: 1.8;
    color: #1e293b;
    font-size: 15px;
    word-break: break-word;
    direction: rtl;
    text-align: right;
}

.st-rendered-content p {
    margin: 0 0 10px 0;
}

.st-rendered-content blockquote {
    border-right: 4px solid #23709b;
    border-left: none;
    background: #f1f6fa;
    padding: 10px 16px;
    margin: 12px 0;
    border-radius: 4px;
    color: #334155;
    font-style: normal;
}

.st-rendered-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    border: 1px solid #b5d2e7;
}

.st-rendered-content table th {
    background: #23709b;
    color: #ffffff;
    border: 1px solid #9abed8;
    padding: 8px 12px;
    text-align: right;
}

.st-rendered-content table td {
    border: 1px solid #b5d2e7;
    padding: 8px 12px;
}

.st-rendered-content figure.image {
    margin: 14px auto;
    text-align: center;
    display: block;
    max-width: 100%;
}

.st-rendered-content figure.image figcaption {
    font-size: 13px;
    color: #64748b;
    margin-top: 6px;
    text-align: center;
}

.st-rendered-content img,
.st-rendered-content figure.image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

/* 4. Disable any English or default placeholder text inside CKEditor completely */
.ck.ck-editor__editable > .ck-placeholder::before,
.ck-placeholder::before,
[data-placeholder]::before {
    display: none !important;
    content: '' !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

