/* Article Styles (Dark Crimson Theme) */

/* Critical: Dark background for entire page */
html { background: #020204 !important; }
body, .docs-body { 
    background: radial-gradient(ellipse at 30% 20%, #0a0812 0%, #050508 40%, #020204 100%) !important;
    background-attachment: fixed !important;
    margin: 0 !important;
    padding: 0 !important;
}

:root {
    --article-bg: #0a0a0f;
    --article-card: #0d0d14;
    --article-primary: #ff0033;
    --article-primary-dim: rgba(255,0,51,0.15);
    --article-secondary: #ff4466;
    --article-text: #d8d8e8;
    --article-muted: #888;
    --article-border: rgba(255,0,51,0.2);
    --article-success: #00ff88;
    --article-warning: #ffaa00;
    --article-info: #00b4ff;
}

/* Main content wrapper - dark throughout */
.docs-main {
    background: transparent !important;
}

.docs-article-wrapper {
    background: rgba(10, 10, 15, 0.9) !important;
    border: 1px solid rgba(255, 0, 51, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), 0 0 80px rgba(255, 0, 51, 0.08) !important;
}

.article-content {
    max-width: 880px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
    background: transparent;
    color: var(--article-text);
    line-height: 1.8;
}

.article-content h1 {
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--article-primary), var(--article-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.article-content h2 {
    color: var(--article-primary);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--article-border);
}

.article-content h3 {
    color: var(--article-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.article-content h4 {
    color: var(--article-text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.article-content p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-content a {
    color: var(--article-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.article-content a:hover {
    border-bottom-color: var(--article-primary);
}

.article-content strong {
    color: #fff;
    font-weight: 600;
}

.article-content code {
    background: var(--article-primary-dim);
    color: var(--article-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--article-card);
    border: 1px solid var(--article-border);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.article-content blockquote {
    border-left: 4px solid var(--article-primary);
    background: var(--article-primary-dim);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--article-card);
    border-radius: 8px;
    overflow: hidden;
}

.article-content th,
.article-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--article-border);
}

.article-content th {
    background: var(--article-primary-dim);
    color: var(--article-primary);
    font-weight: 600;
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--article-border);
    margin: 2rem 0;
}

/* Meta info at top of article */
.article-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--article-border);
    font-size: 0.85rem;
    color: var(--article-muted);
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Alert boxes */
.alert-box {
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.alert-box h4,
.alert-box strong:first-child {
    margin-bottom: 0.5rem;
    display: block;
}

.alert-info {
    background: rgba(0,180,255,0.1);
    border: 1px solid var(--article-info);
}
.alert-info h4 { color: var(--article-info); }

.alert-warning {
    background: rgba(255,170,0,0.1);
    border: 1px solid var(--article-warning);
}
.alert-warning h4 { color: var(--article-warning); }

.alert-danger {
    background: var(--article-primary-dim);
    border: 1px solid var(--article-primary);
}
.alert-danger h4 { color: var(--article-primary); }

.alert-success {
    background: rgba(0,255,136,0.1);
    border: 1px solid var(--article-success);
}
.alert-success h4 { color: var(--article-success); }

/* Call to action */
.article-cta {
    background: linear-gradient(135deg, var(--article-primary-dim), rgba(255,0,51,0.05));
    border: 2px solid var(--article-primary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
    text-align: center;
}

.article-cta h3 {
    color: var(--article-primary);
    margin: 0 0 0.75rem;
    border: none;
    padding: 0;
}

.article-cta p {
    margin-bottom: 1.25rem;
}

.article-cta .btn {
    display: inline-block;
    background: var(--article-primary);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
}

.article-cta .btn:hover {
    background: #cc0029;
    transform: translateY(-2px);
}

/* Keywords/tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.article-tag {
    background: var(--article-primary-dim);
    color: var(--article-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Related articles */
.related-articles {
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255,0,51,0.15);
    border-radius: 0;
    padding: 1.5rem 0 0.5rem;
    margin: 2.5rem 0 1rem;
}

.related-articles h4 {
    color: #707088;
    margin: 0 0 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.related-articles ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.related-articles li {
    margin-bottom: 0;
    padding-left: 0;
    border-left: none;
}

.related-articles li a {
    color: #ff4466;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.25s ease;
    display: inline-block;
    background: rgba(255,0,51,0.06);
    border: 1px solid transparent;
}

.related-articles li a:hover {
    background: rgba(255,0,51,0.12);
    border-color: rgba(255,0,51,0.25);
    color: #ff6680;
}

.related-articles li:hover {
    border-left-color: transparent;
}

/* ====== TTS Player ====== */
.tts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,0,51,0.12);
    border: 1px solid rgba(255,0,51,0.35);
    color: #ff4466;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    letter-spacing: 0.3px;
}
.tts-btn:hover {
    background: rgba(255,0,51,0.22);
    border-color: #ff0033;
    box-shadow: 0 0 15px rgba(255,0,51,0.2);
    transform: translateY(-1px);
}
.tts-btn.tts-playing {
    background: rgba(255,0,51,0.25);
    border-color: #ff0033;
    animation: tts-pulse 1.5s ease-in-out infinite;
}
.tts-btn.tts-paused {
    background: rgba(255,170,0,0.15);
    border-color: rgba(255,170,0,0.4);
    color: #ffaa00;
}
@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255,0,51,0.2); }
    50% { box-shadow: 0 0 20px rgba(255,0,51,0.45); }
}
.tts-icon { font-size: 1rem; }

.tts-controls {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}
.tts-controls.tts-visible { display: inline-flex; }

.tts-speed {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,0,51,0.2);
    color: #d8d8e8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    min-width: 42px;
    text-align: center;
}
.tts-speed:hover { border-color: #ff0033; }

.tts-stop {
    background: none;
    border: 1px solid rgba(255,0,51,0.3);
    color: #ff4466;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}
.tts-stop:hover { background: rgba(255,0,51,0.2); }

/* Responsive */
@media (max-width: 768px) {
    .article-content {
        padding: 1.5rem 1rem;
    }
    .article-content h1 {
        font-size: 1.8rem;
    }
    .article-content h2 {
        font-size: 1.4rem;
    }
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
