/* CKEditor Custom Styles */

/* Increase the editor height */
.ck-editor__editable {
    min-height: 350px !important;
    max-height: 600px !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    padding: 1rem !important;
}

/* Improve toolbar appearance */
.ck-toolbar {
    border-radius: 8px 8px 0 0 !important;
    background-color: #1e293b !important;
    border-color: #475569 !important;
    padding: 0.5rem 0.25rem !important;
}

/* Editor main container styling */
.ck-editor__main {
    border-radius: 0 0 8px 8px !important;
    border: 1px solid #475569 !important;
    border-top: none !important;
}

/* Improve content area appearance */
.ck-content {
    border-radius: 0 0 8px 8px !important;
    border-color: #475569 !important;
    border-top-color: transparent !important;
}

/* Improve dropdown menus */
.ck-dropdown__panel {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

/* Improve button appearance */
.ck-button {
    color: #e2e8f0 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

/* Improve button hover states */
.ck-button:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* Active button state */
.ck-button.ck-on {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* Focus states */
.ck-button:focus, .ck-button.ck-focused {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
}

/* Improve dropdown button appearance */
.ck-dropdown__button {
    border-radius: 6px !important;
}

/* Improve dropdown button hover state */
.ck-dropdown__button:hover {
    background-color: #334155 !important;
}

/* Improve dropdown panel items */
.ck-list__item {
    border-radius: 4px !important;
}

/* Improve dropdown panel item hover state */
.ck-list__item:hover {
    background-color: #334155 !important;
}

/* Improve dropdown panel item active state */
.ck-list__item_active {
    background-color: #3b82f6 !important;
}

/* Improve table appearance */
.ck-content table,
.content-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    border-radius: 8px;
    overflow: hidden;
    color: #ffffff;
}

.ck-content table td, 
.ck-content table th,
.content-body table td,
.content-body table th {
    border: 1px solid #475569;
    padding: 10px;
}

.ck-content table th,
.content-body table th {
    background-color: #1e293b;
    font-weight: 600;
}

.ck-content table tr:nth-child(even),
.content-body table tr:nth-child(even) {
    background-color: #111827;
}

/* Improve blockquote appearance */
.ck-content blockquote,
.content-body blockquote {
    border-left: 5px solid #3b82f6;
    padding: 1em 1.5em;
    margin: 1.5em 0;
    background-color: #1e293b;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #e2e8f0;
}

/* Improve list appearance */
.ck-content ul, 
.ck-content ol,
.content-body ul,
.content-body ol {
    padding-left: 2em;
    margin: 1em 0;
}

.ck-content ul li,
.ck-content ol li,
.content-body ul li,
.content-body ol li {
    margin-bottom: 0.5em;
}

/* Improve heading appearance */
.ck-content h1, 
.ck-content h2, 
.ck-content h3, 
.ck-content h4, 
.ck-content h5, 
.ck-content h6,
.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 700;
    color: #ffffff;
}

.ck-content h1,
.content-body h1 {
    font-size: 2em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.25em;
}

.ck-content h2,
.content-body h2 {
    font-size: 1.75em;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25em;
}

.ck-content h3,
.content-body h3 {
    font-size: 1.5em;
}

.ck-content h4,
.content-body h4 {
    font-size: 1.25em;
}

/* Improve link appearance */
.ck-content a,
.content-body a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px dotted #60a5fa;
    transition: all 0.2s ease;
}

.ck-content a:hover,
.content-body a:hover {
    color: #93c5fd;
    border-bottom: 1px solid #93c5fd;
}

/* Improve image appearance */
.ck-content img,
.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

/* Improve figure image appearance */
.ck-content figure.image,
.content-body figure.image {
    width: 100%;
    margin: 1em 0;
    text-align: center;
}

.ck-content figure.image img,
.content-body figure.image img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.ck-content figure.image figcaption,
.content-body figure.image figcaption {
    font-size: 0.85em;
    color: #9ca3af;
    margin-top: 0.5em;
}

/* Table cell figure image - full width without max-width constraint */
.ck-content table td figure.image,
.content-body table td figure.image {
    width: 100% !important;
    margin: 0 !important;
}

.ck-content table td figure.image img,
.content-body table td figure.image img {
    width: 100% !important;
    max-width: none !important;
    height: auto;
    display: block;
    margin: 0 !important;
}

/* Table cell with image - transparent background and no border */
.ck-content table td:has(figure.image),
.content-body table td:has(figure.image) {
    background-color: transparent !important;
    border: none !important;
    padding: 5px !important;
}

/* Improve code appearance */
.ck-content code,
.content-body code {
    background-color: #1e293b;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #60a5fa;
}

/* Improve pre appearance */
.ck-content pre,
.content-body pre {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}

/* Content edit page specific styles */
.content-edit-container {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    margin-top: 1rem;
}

.content-edit-form label {
    color: #f8fafc;
    font-weight: 500;
}

.content-edit-form input,
.content-edit-form select,
.content-edit-form textarea {
    background-color: #f8fafc;
    border-color: #475569;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.content-edit-form input:focus,
.content-edit-form select:focus,
.content-edit-form textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #475569;
    color: white;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background-color: #334155;
    transform: translateY(-2px);
}
