/**
 * Article Content Styles for Knowledge Base
 * Styles for displaying rich content created with custom editor
 */

/* =================================================================
   ARTICLE CONTENT CONTAINER
   ================================================================= */
.article-content {
    line-height: 1.7;
    font-size: 16px;
    color: #374151;
    max-width: none;
}

.dark .article-content {
    color: #e5e7eb;
}

/* =================================================================
   TYPOGRAPHY
   ================================================================= */

/* Headings */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
}

.dark .article-content h1,
.dark .article-content h2,
.dark .article-content h3,
.dark .article-content h4,
.dark .article-content h5,
.dark .article-content h6 {
    color: #f9fafb;
}

.article-content h1 {
    font-size: 2.25rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.article-content h2 {
    font-size: 1.875rem;
}

.article-content h3 {
    font-size: 1.5rem;
}

.article-content h4 {
    font-size: 1.25rem;
}

.article-content h5 {
    font-size: 1.125rem;
}

.article-content h6 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .article-content h1 {
    border-bottom-color: #4b5563;
}

/* Paragraphs */
.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-content p:last-child {
    margin-bottom: 0;
}

/* =================================================================
   LISTS
   ================================================================= */
.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

.article-content li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
    margin: 0.5rem 0;
}

.article-content ul ul {
    list-style-type: circle;
}

.article-content ul ul ul {
    list-style-type: square;
}

/* =================================================================
   TEXT FORMATTING
   ================================================================= */
.article-content strong,
.article-content b {
    font-weight: 600;
    color: #111827;
}

.dark .article-content strong,
.dark .article-content b {
    color: #f9fafb;
}

.article-content em,
.article-content i {
    font-style: italic;
}

.article-content u {
    text-decoration: underline;
}

.article-content s,
.article-content strike {
    text-decoration: line-through;
}

/* Text alignment */



/* =================================================================
   LINKS
   ================================================================= */
.article-content a {
    color: #3b82f6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.dark .article-content a {
    color: #60a5fa;
}

.dark .article-content a:hover {
    color: #93c5fd;
}

/* =================================================================
   IMAGES
   ================================================================= */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark .article-content img {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark .article-content img:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Image with caption */
.article-content figure {
    margin: 2rem 0;
    text-align: center;
}

.article-content figure img {
    margin: 0 auto 1rem;
}

.article-content figcaption {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    margin-top: 0.5rem;
}

.dark .article-content figcaption {
    color: #9ca3af;
}

/* =================================================================
   NOTIFICATION BLOCKS
   ================================================================= */
.article-content .notification-block {
    border-radius: 0.75rem;
    margin: 2rem 0;
    padding: 1.5rem;
    border-left: 4px solid;
    position: relative;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Info notification */
.article-content .notification-block[data-type="info"] {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.dark .article-content .notification-block[data-type="info"] {
    background-color: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
}

/* Warning notification */
.article-content .notification-block[data-type="warning"] {
    background-color: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.dark .article-content .notification-block[data-type="warning"] {
    background-color: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

/* Error notification */
.article-content .notification-block[data-type="error"] {
    background-color: #fef2f2;
    border-left-color: #ef4444;
    color: #dc2626;
}

.dark .article-content .notification-block[data-type="error"] {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* Success notification */
.article-content .notification-block[data-type="success"] {
    background-color: #f0fdf4;
    border-left-color: #10b981;
    color: #047857;
}

.dark .article-content .notification-block[data-type="success"] {
    background-color: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

/* Notification content styling */
.article-content .notification-block .font-semibold {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.article-content .notification-block .font-semibold::before {
    content: "";
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.article-content .notification-block[data-type="info"] .font-semibold::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.article-content .notification-block[data-type="warning"] .font-semibold::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f59e0b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z'/%3E%3C/svg%3E");
}

.article-content .notification-block[data-type="error"] .font-semibold::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.article-content .notification-block[data-type="success"] .font-semibold::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310b981'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

/* =================================================================
   BLOCKQUOTES
   ================================================================= */
.article-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: #f9fafb;
    font-style: italic;
    color: #6b7280;
    border-radius: 0 0.5rem 0.5rem 0;
    position: relative;
}

.dark .article-content blockquote {
    border-left-color: #4b5563;
    background: #1f2937;
    color: #9ca3af;
}

.article-content blockquote::before {
    content: """;
    font-size: 4rem;
    color: #d1d5db;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-family: serif;
}

.dark .article-content blockquote::before {
    color: #4b5563;
}

.article-content blockquote p {
    margin: 0;
}

.article-content blockquote cite {
    display: block;
    text-align: right;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-style: normal;
    color: #9ca3af;
}

.dark .article-content blockquote cite {
    color: #6b7280;
}

/* =================================================================
   CODE BLOCKS
   ================================================================= */
.article-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    border: 1px solid #374151;
}

.dark .article-content pre {
    background: #111827;
    border-color: #1f2937;
}

.article-content code {
    background: #f3f4f6;
    color: #e11d48;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    border: 1px solid #e5e7eb;
}

.dark .article-content code {
    background: #374151;
    color: #fbbf24;
    border-color: #4b5563;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* =================================================================
   TABLES
   ================================================================= */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.article-content th,
.article-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.article-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.dark .article-content table {
    background: #1f2937;
}

.dark .article-content th {
    background: #374151;
    color: #f9fafb;
}

.dark .article-content th,
.dark .article-content td {
    border-bottom-color: #4b5563;
}

.article-content tbody tr:hover {
    background: #f9fafb;
}

.dark .article-content tbody tr:hover {
    background: #374151;
}

/* =================================================================
   VIDEOS
   ================================================================= */
.article-content iframe {
    max-width: 100%;
    border-radius: 0.75rem;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* =================================================================
   HORIZONTAL RULES
   ================================================================= */
.article-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 3rem 0;
}

.dark .article-content hr {
    background: linear-gradient(to right, transparent, #4b5563, transparent);
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */
@media (max-width: 768px) {
    .article-content {
        font-size: 14px;
    }
    
    .article-content h1 {
        font-size: 1.875rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
    }
    
    .article-content .notification-block {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .article-content img {
        margin: 1.5rem auto;
    }
    
    .article-content pre {
        padding: 1rem;
        font-size: 0.75rem;
    }
    
    .article-content table {
        font-size: 0.875rem;
    }
    
    .article-content th,
    .article-content td {
        padding: 0.75rem;
    }
}

/* =================================================================
   PRINT STYLES
   ================================================================= */
@media print {
    .article-content {
        color: #000;
        background: #fff;
    }
    
    .article-content .notification-block {
        border: 2px solid #000;
        background: #fff !important;
        color: #000 !important;
        break-inside: avoid;
    }
    
    .article-content img {
        max-height: 500px;
        break-inside: avoid;
    }
    
    .article-content pre {
        background: #f5f5f5;
        color: #000;
        border: 1px solid #ccc;
    }
    
    .article-content a {
        color: #000;
        text-decoration: underline;
    }
    
    .article-content blockquote {
        background: #f5f5f5;
        color: #000;
        border-left-color: #ccc;
    }
}