/* 
Rich Text Content Display Styles
Ensures TinyMCE formatted content displays properly to users
*/

.rich-text-content,
.formatted-text, 
.article-content,
.content-display,
.rich-content {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Headings Styling */
.rich-text-content h1,
.formatted-text h1,
.article-content h1,
.content-display h1,
.rich-content h1 {
    color: #2c3e50;
    font-size: 2.2rem;
    margin: 1.5em 0 0.8em 0;
    border-bottom: 3px solid #4169E1;
    padding-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

.rich-text-content h2,
.formatted-text h2,
.article-content h2,
.content-display h2,
.rich-content h2 {
    color: #4169E1;
    font-size: 1.8rem;
    margin: 1.5em 0 0.8em 0;
    font-weight: 600;
    line-height: 1.3;
}

.rich-text-content h3,
.formatted-text h3,
.article-content h3,
.content-display h3,
.rich-content h3 {
    color: #5a67d8;
    font-size: 1.5rem;
    margin: 1.5em 0 0.8em 0;
    font-weight: 600;
    line-height: 1.3;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.rich-text-content h4,
.formatted-text h4,
.article-content h4,
.content-display h4,
.rich-content h4 {
    color: #667eea;
    font-size: 1.3rem;
    margin: 1.5em 0 0.8em 0;
    font-weight: 600;
    line-height: 1.3;
}

.rich-text-content h5,
.formatted-text h5,
.article-content h5,
.content-display h5,
.rich-content h5 {
    color: #7c3aed;
    font-size: 1.15rem;
    margin: 1.2em 0 0.6em 0;
    font-weight: 600;
    line-height: 1.3;
}

.rich-text-content h6,
.formatted-text h6,
.article-content h6,
.content-display h6,
.rich-content h6 {
    color: #8b5cf6;
    font-size: 1rem;
    margin: 1em 0 0.5em 0;
    font-weight: 600;
    line-height: 1.3;
}

/* Paragraph Styling */
.rich-text-content p,
.formatted-text p,
.article-content p,
.content-display p,
.rich-content p {
    margin-bottom: 1.2em;
    text-align: justify;
    color: #444;
    line-height: 1.7;
}

/* Text Formatting */
.rich-text-content strong,
.formatted-text strong,
.article-content strong,
.content-display strong,
.rich-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.rich-text-content em,
.formatted-text em,
.article-content em,
.content-display em,
.rich-content em {
    color: #555;
    font-style: italic;
}

.rich-text-content u,
.formatted-text u,
.article-content u,
.content-display u,
.rich-content u {
    text-decoration: underline;
}

.rich-text-content s,
.formatted-text s,
.article-content s,
.content-display s,
.rich-content s {
    text-decoration: line-through;
}

/* List Styling */
.rich-text-content ul,
.rich-text-content ol,
.formatted-text ul,
.formatted-text ol,
.article-content ul,
.article-content ol,
.content-display ul,
.content-display ol,
.rich-content ul,
.rich-content ol {
    margin: 1em 0 1.5em 0;
    padding-left: 2em;
}

.rich-text-content li,
.formatted-text li,
.article-content li,
.content-display li,
.rich-content li {
    margin-bottom: 0.5em;
    color: #444;
    line-height: 1.6;
}

.rich-text-content ul li,
.formatted-text ul li,
.article-content ul li,
.content-display ul li,
.rich-content ul li {
    list-style-type: disc;
}

.rich-text-content ol li,
.formatted-text ol li,
.article-content ol li,
.content-display ol li,
.rich-content ol li {
    list-style-type: decimal;
}

/* Link Styling */
.rich-text-content a,
.formatted-text a,
.article-content a,
.content-display a,
.rich-content a {
    color: #4169E1;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.rich-text-content a:hover,
.formatted-text a:hover,
.article-content a:hover,
.content-display a:hover,
.rich-content a:hover {
    color: #2c5aa0;
    border-bottom: 1px solid #4169E1;
}

/* Blockquote Styling */
.rich-text-content blockquote,
.formatted-text blockquote,
.article-content blockquote,
.content-display blockquote,
.rich-content blockquote {
    background: #f8f9fa;
    border-left: 4px solid #4169E1;
    margin: 1.5em 0;
    padding: 1em 1.5em;
    font-style: italic;
    border-radius: 0 8px 8px 0;
    color: #555;
}

/* Code Styling */
.rich-text-content code,
.formatted-text code,
.article-content code,
.content-display code,
.rich-content code {
    background: #f1f2f6;
    color: #e74c3c;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.rich-text-content pre,
.formatted-text pre,
.article-content pre,
.content-display pre,
.rich-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1em;
    margin: 1.5em 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Table Styling */
.rich-text-content table,
.formatted-text table,
.article-content table,
.content-display table,
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: white;
}

.rich-text-content th,
.rich-text-content td,
.formatted-text th,
.formatted-text td,
.article-content th,
.article-content td,
.content-display th,
.content-display td,
.rich-content th,
.rich-content td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: left;
}

.rich-text-content th,
.formatted-text th,
.article-content th,
.content-display th,
.rich-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* Image Styling */
.rich-text-content img,
.formatted-text img,
.article-content img,
.content-display img,
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .rich-text-content,
    .formatted-text,
    .article-content,
    .content-display,
    .rich-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .rich-text-content h1,
    .formatted-text h1,
    .article-content h1,
    .content-display h1,
    .rich-content h1 {
        font-size: 1.8rem;
    }
    
    .rich-text-content h2,
    .formatted-text h2,
    .article-content h2,
    .content-display h2,
    .rich-content h2 {
        font-size: 1.5rem;
    }
    
    .rich-text-content h3,
    .formatted-text h3,
    .article-content h3,
    .content-display h3,
    .rich-content h3 {
        font-size: 1.3rem;
    }
    
    .rich-text-content ul,
    .rich-text-content ol,
    .formatted-text ul,
    .formatted-text ol,
    .article-content ul,
    .article-content ol,
    .content-display ul,
    .content-display ol,
    .rich-content ul,
    .rich-content ol {
        padding-left: 1.5em;
    }
    
    .rich-text-content blockquote,
    .formatted-text blockquote,
    .article-content blockquote,
    .content-display blockquote,
    .rich-content blockquote {
        padding: 0.8em 1em;
        margin: 1em 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .rich-text-content,
    .formatted-text, 
    .article-content,
    .content-display,
    .rich-content {
        color: #e8e8e8;
    }

    /* Headings - lighter colors for dark mode */
    .rich-text-content h1,
    .formatted-text h1,
    .article-content h1,
    .content-display h1,
    .rich-content h1 {
        color: #f0f0f0;
        border-bottom-color: #6b8cff;
    }

    .rich-text-content h2,
    .formatted-text h2,
    .article-content h2,
    .content-display h2,
    .rich-content h2 {
        color: #8ba4ff;
    }

    .rich-text-content h3,
    .formatted-text h3,
    .article-content h3,
    .content-display h3,
    .rich-content h3 {
        color: #9db4ff;
        border-bottom-color: #6b8cff;
    }

    .rich-text-content h4,
    .formatted-text h4,
    .article-content h4,
    .content-display h4,
    .rich-content h4 {
        color: #adc5ff;
    }

    .rich-text-content h5,
    .formatted-text h5,
    .article-content h5,
    .content-display h5,
    .rich-content h5 {
        color: #b8a8ff;
    }

    .rich-text-content h6,
    .formatted-text h6,
    .article-content h6,
    .content-display h6,
    .rich-content h6 {
        color: #c4b5ff;
    }

    /* Paragraphs - light gray for readability */
    .rich-text-content p,
    .formatted-text p,
    .article-content p,
    .content-display p,
    .rich-content p {
        color: #d0d0d0;
    }

    /* Text formatting */
    .rich-text-content strong,
    .formatted-text strong,
    .article-content strong,
    .content-display strong,
    .rich-content strong {
        color: #f0f0f0;
    }

    .rich-text-content em,
    .formatted-text em,
    .article-content em,
    .content-display em,
    .rich-content em {
        color: #c0c0c0;
    }

    /* Lists - light gray */
    .rich-text-content li,
    .formatted-text li,
    .article-content li,
    .content-display li,
    .rich-content li {
        color: #d0d0d0;
    }

    /* Links - lighter blue for dark mode */
    .rich-text-content a,
    .formatted-text a,
    .article-content a,
    .content-display a,
    .rich-content a {
        color: #7aa3ff;
    }

    .rich-text-content a:hover,
    .formatted-text a:hover,
    .article-content a:hover,
    .content-display a:hover,
    .rich-content a:hover {
        color: #9db4ff;
        border-bottom-color: #7aa3ff;
    }

    /* Blockquote - dark background with light text */
    .rich-text-content blockquote,
    .formatted-text blockquote,
    .article-content blockquote,
    .content-display blockquote,
    .rich-content blockquote {
        background: #2a2a2a;
        border-left-color: #6b8cff;
        color: #c0c0c0;
    }

    /* Code - dark background with light text */
    .rich-text-content code,
    .formatted-text code,
    .article-content code,
    .content-display code,
    .rich-content code {
        background: #2a2a2a;
        color: #ff8a80;
    }

    .rich-text-content pre,
    .formatted-text pre,
    .article-content pre,
    .content-display pre,
    .rich-content pre {
        background: #2a2a2a;
        border-color: #404040;
        color: #e0e0e0;
    }

    /* Tables - dark background with light text */
    .rich-text-content table,
    .formatted-text table,
    .article-content table,
    .content-display table,
    .rich-content table {
        background: #1e1e1e;
    }

    .rich-text-content th,
    .rich-text-content td,
    .formatted-text th,
    .formatted-text td,
    .article-content th,
    .article-content td,
    .content-display th,
    .content-display td,
    .rich-content th,
    .rich-content td {
        border-color: #404040;
        color: #d0d0d0;
    }

    .rich-text-content th,
    .formatted-text th,
    .article-content th,
    .content-display th,
    .rich-content th {
        background: #2a2a2a;
        color: #f0f0f0;
    }
}

/* Bootstrap dark mode support (data-bs-theme="dark") */
[data-bs-theme="dark"] .rich-text-content,
[data-bs-theme="dark"] .formatted-text, 
[data-bs-theme="dark"] .article-content,
[data-bs-theme="dark"] .content-display,
[data-bs-theme="dark"] .rich-content {
    color: #e8e8e8 !important;
}

[data-bs-theme="dark"] .rich-text-content h1,
[data-bs-theme="dark"] .formatted-text h1,
[data-bs-theme="dark"] .article-content h1,
[data-bs-theme="dark"] .content-display h1,
[data-bs-theme="dark"] .rich-content h1 {
    color: #f0f0f0 !important;
    border-bottom-color: #6b8cff !important;
}

[data-bs-theme="dark"] .rich-text-content h2,
[data-bs-theme="dark"] .formatted-text h2,
[data-bs-theme="dark"] .article-content h2,
[data-bs-theme="dark"] .content-display h2,
[data-bs-theme="dark"] .rich-content h2 {
    color: #8ba4ff !important;
}

[data-bs-theme="dark"] .rich-text-content h3,
[data-bs-theme="dark"] .formatted-text h3,
[data-bs-theme="dark"] .article-content h3,
[data-bs-theme="dark"] .content-display h3,
[data-bs-theme="dark"] .rich-content h3 {
    color: #9db4ff !important;
    border-bottom-color: #6b8cff !important;
}

[data-bs-theme="dark"] .rich-text-content h4,
[data-bs-theme="dark"] .formatted-text h4,
[data-bs-theme="dark"] .article-content h4,
[data-bs-theme="dark"] .content-display h4,
[data-bs-theme="dark"] .rich-content h4 {
    color: #adc5ff !important;
}

[data-bs-theme="dark"] .rich-text-content h5,
[data-bs-theme="dark"] .formatted-text h5,
[data-bs-theme="dark"] .article-content h5,
[data-bs-theme="dark"] .content-display h5,
[data-bs-theme="dark"] .rich-content h5 {
    color: #b8a8ff !important;
}

[data-bs-theme="dark"] .rich-text-content h6,
[data-bs-theme="dark"] .formatted-text h6,
[data-bs-theme="dark"] .article-content h6,
[data-bs-theme="dark"] .content-display h6,
[data-bs-theme="dark"] .rich-content h6 {
    color: #c4b5ff !important;
}

[data-bs-theme="dark"] .rich-text-content p,
[data-bs-theme="dark"] .formatted-text p,
[data-bs-theme="dark"] .article-content p,
[data-bs-theme="dark"] .content-display p,
[data-bs-theme="dark"] .rich-content p {
    color: #d0d0d0 !important;
}

[data-bs-theme="dark"] .rich-text-content strong,
[data-bs-theme="dark"] .formatted-text strong,
[data-bs-theme="dark"] .article-content strong,
[data-bs-theme="dark"] .content-display strong,
[data-bs-theme="dark"] .rich-content strong {
    color: #f0f0f0 !important;
}

[data-bs-theme="dark"] .rich-text-content em,
[data-bs-theme="dark"] .formatted-text em,
[data-bs-theme="dark"] .article-content em,
[data-bs-theme="dark"] .content-display em,
[data-bs-theme="dark"] .rich-content em {
    color: #c0c0c0 !important;
}

[data-bs-theme="dark"] .rich-text-content li,
[data-bs-theme="dark"] .formatted-text li,
[data-bs-theme="dark"] .article-content li,
[data-bs-theme="dark"] .content-display li,
[data-bs-theme="dark"] .rich-content li {
    color: #d0d0d0 !important;
}

[data-bs-theme="dark"] .rich-text-content a,
[data-bs-theme="dark"] .formatted-text a,
[data-bs-theme="dark"] .article-content a,
[data-bs-theme="dark"] .content-display a,
[data-bs-theme="dark"] .rich-content a {
    color: #7aa3ff !important;
}

[data-bs-theme="dark"] .rich-text-content a:hover,
[data-bs-theme="dark"] .formatted-text a:hover,
[data-bs-theme="dark"] .article-content a:hover,
[data-bs-theme="dark"] .content-display a:hover,
[data-bs-theme="dark"] .rich-content a:hover {
    color: #9db4ff !important;
    border-bottom-color: #7aa3ff !important;
}

[data-bs-theme="dark"] .rich-text-content blockquote,
[data-bs-theme="dark"] .formatted-text blockquote,
[data-bs-theme="dark"] .article-content blockquote,
[data-bs-theme="dark"] .content-display blockquote,
[data-bs-theme="dark"] .rich-content blockquote {
    background: #2a2a2a !important;
    border-left-color: #6b8cff !important;
    color: #c0c0c0 !important;
}

[data-bs-theme="dark"] .rich-text-content code,
[data-bs-theme="dark"] .formatted-text code,
[data-bs-theme="dark"] .article-content code,
[data-bs-theme="dark"] .content-display code,
[data-bs-theme="dark"] .rich-content code {
    background: #2a2a2a !important;
    color: #ff8a80 !important;
}

[data-bs-theme="dark"] .rich-text-content pre,
[data-bs-theme="dark"] .formatted-text pre,
[data-bs-theme="dark"] .article-content pre,
[data-bs-theme="dark"] .content-display pre,
[data-bs-theme="dark"] .rich-content pre {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .rich-text-content table,
[data-bs-theme="dark"] .formatted-text table,
[data-bs-theme="dark"] .article-content table,
[data-bs-theme="dark"] .content-display table,
[data-bs-theme="dark"] .rich-content table {
    background: #1e1e1e !important;
}

[data-bs-theme="dark"] .rich-text-content th,
[data-bs-theme="dark"] .rich-text-content td,
[data-bs-theme="dark"] .formatted-text th,
[data-bs-theme="dark"] .formatted-text td,
[data-bs-theme="dark"] .article-content th,
[data-bs-theme="dark"] .article-content td,
[data-bs-theme="dark"] .content-display th,
[data-bs-theme="dark"] .content-display td,
[data-bs-theme="dark"] .rich-content th,
[data-bs-theme="dark"] .rich-content td {
    border-color: #404040 !important;
    color: #d0d0d0 !important;
}

[data-bs-theme="dark"] .rich-text-content th,
[data-bs-theme="dark"] .formatted-text th,
[data-bs-theme="dark"] .article-content th,
[data-bs-theme="dark"] .content-display th,
[data-bs-theme="dark"] .rich-content th {
    background: #2a2a2a !important;
    color: #f0f0f0 !important;
}

/* Print Styles */
@media print {
    .rich-text-content,
    .formatted-text,
    .article-content,
    .content-display,
    .rich-content {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
    }
    
    .rich-text-content a,
    .formatted-text a,
    .article-content a,
    .content-display a,
    .rich-content a {
        color: black;
        text-decoration: underline;
    }
}