/* CKEditor Styles */
.ck-editor__editable {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.ck.ck-editor {
    margin-bottom: 1rem;
}

.ck.ck-editor__main > .ck-editor__editable {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
}

.ck.ck-editor__top .ck-sticky-panel .ck-toolbar {
    border: 1px solid #ccc;
    border-radius: 4px 4px 0 0;
    background-color: #f8f9fa;
}

/* Wiki Pages Dropdown Styles */
.ck-wiki-pages-dropdown .ck-button {
    background-color: #007bff;
    color: white;
    border: 1px solid #0056b3;
}

.ck-wiki-pages-dropdown .ck-button:hover {
    background-color: #0056b3;
}

/* Wiki Pages Modal Styles */
.ck-wiki-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ck-wiki-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
}

.ck-wiki-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
}

.ck-wiki-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ck-wiki-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ck-wiki-modal-close:hover {
    color: #333;
}

.ck-wiki-modal-body {
    padding: 20px;
}

.ck-wiki-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.ck-wiki-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.ck-wiki-pages-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ck-wiki-page-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.ck-wiki-page-item:last-child {
    border-bottom: none;
}

.ck-wiki-page-item:hover {
    background-color: #f8f9fa;
}

.ck-wiki-page-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.ck-wiki-page-tags {
    font-size: 12px;
    color: #666;
}

.ck-editor__editable[role="textbox"] {
    /* Editing area */
    min-height: 350px;
}

/* Dark Mode Overrides for CKEditor */
[data-theme="dark"] .ck.ck-editor__main > .ck-editor__editable {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .ck.ck-toolbar {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .ck.ck-button,
[data-theme="dark"] .ck.ck-button .ck-icon {
    color: var(--text-primary) !important;
    background: transparent !important;
}

[data-theme="dark"] .ck.ck-button:hover,
[data-theme="dark"] .ck.ck-button.ck-on {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .ck.ck-dropdown .ck-dropdown__arrow,
[data-theme="dark"] .ck.ck-splitbutton .ck-splitbutton__arrow {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .ck.ck-dropdown__panel {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .ck.ck-list__item .ck-button:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .ck.ck-input {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .ck.ck-list {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .ck.ck-balloon-panel {
    background: var(--card-bg) !important;
}
