/**
 * YouTube Interactive Blog Single Post Stylesheet
 * نظام تنسيقات وتفاعلات تدوينات تفريغ اليوتيوب التفاعلية
 */

:root {
    --yt-brand: #ff0033;
    --yt-brand-soft: rgba(255, 0, 51, 0.1);
    --primary: #0284c7;
    --primary-light: #38bdf8;
    --success: #10b981;
    --warning: #f59e0b;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --code-bg: #0f172a;
}

body.dark, body.dark-mode {
    --bg-page: #0b1120;
    --bg-card: #1e293b;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-heading: #f8fafc;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --code-bg: #030712;
}

/* Reading Progress Bar */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff0033, #f59e0b, #0284c7);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
}

.yt-post-wrapper {
    background-color: var(--bg-page);
    color: var(--text-body);
    font-family: 'Cairo', sans-serif;
    padding-top: 25px;
    padding-bottom: 70px;
    line-height: 1.85;
}

.yt-post-container {
    max-width: 1420px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Breadcrumb Navigation */
.yt-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.yt-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.yt-breadcrumb a:hover {
    color: #0369a1;
    text-decoration: underline;
}

/* Hero Header */
.yt-post-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 35px 30px;
    margin-bottom: 35px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
    position: relative;
    overflow: hidden;
}

.yt-post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff0033, var(--primary), #8b5cf6);
}

.yt-header-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.yt-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

.yt-tag-pill.channel {
    background: rgba(255, 0, 51, 0.1);
    color: #e11d48;
    border: 1px solid rgba(255, 0, 51, 0.2);
}

.yt-tag-pill.cat {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.2);
}

.yt-post-title {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--text-heading);
    line-height: 1.4;
    margin-bottom: 18px;
}

.yt-post-meta-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.yt-post-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* Video Box */
.yt-video-embed-box {
    margin: 25px 0 10px;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
}

.yt-video-embed-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Post Layout (TOC + Main Content) */
.yt-post-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 992px) {
    .yt-post-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Sticky Table of Contents */
.yt-sidebar-toc {
    position: sticky;
    top: 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.03);
}

.yt-toc-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.yt-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.yt-toc-link {
    display: block;
    padding: 7px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.yt-toc-link:hover {
    color: var(--primary);
    background: rgba(2, 132, 199, 0.06);
}

.yt-toc-link.active {
    color: var(--primary);
    background: rgba(2, 132, 199, 0.1);
    font-weight: 800;
    border-right-color: var(--primary);
}

/* Quick Tools in Sidebar */
.yt-sidebar-tools {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yt-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-page);
    color: var(--text-heading);
    transition: all 0.2s ease;
    text-decoration: none;
}

.yt-sidebar-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Main Article Content Styling */
.yt-main-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 45px 50px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.03);
}

.yt-main-article h2 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-top: 35px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(2, 132, 199, 0.15);
}

.yt-main-article h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-top: 25px;
    margin-bottom: 12px;
}

.yt-main-article p {
    font-size: 1.02rem;
    margin-bottom: 18px;
}

/* Executive Summary Box (زبدة الحلقة) */
.yt-summary-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(2, 132, 199, 0.06) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    padding: 25px 22px;
    margin-bottom: 35px;
    position: relative;
}

.yt-summary-badge {
    position: absolute;
    top: -12px;
    right: 25px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.yt-summary-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #d97706;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark .yt-summary-title, body.dark-mode .yt-summary-title {
    color: #fbbf24;
}

.yt-summary-list {
    margin: 0;
    padding-right: 20px;
}

.yt-summary-list li {
    font-size: 0.96rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Copyable Prompt / Code Box */
.yt-code-box {
    background: var(--code-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin: 22px 0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.yt-code-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.yt-code-label {
    color: #38bdf8;
    font-size: 0.84rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.yt-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.yt-copy-btn:hover {
    background: #0284c7;
    color: #fff;
}

.yt-copy-btn.copied {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

.yt-code-content {
    padding: 18px;
    color: #f1f5f9;
    font-family: 'Courier New', Courier, monospace, 'Cairo';
    font-size: 0.92rem;
    line-height: 1.7;
    white-space: pre-wrap;
    direction: ltr;
    text-align: left;
    overflow-x: auto;
}

/* Callouts / Pro Tips & Warnings */
.yt-callout {
    border-radius: 16px;
    padding: 18px 20px;
    margin: 22px 0;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.yt-callout.tip {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #065f46;
}

body.dark .yt-callout.tip, body.dark-mode .yt-callout.tip {
    color: #6ee7b7;
}

.yt-callout.warning {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #991b1b;
}

body.dark .yt-callout.warning, body.dark-mode .yt-callout.warning {
    color: #fca5a5;
}

.yt-callout-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.yt-callout-text {
    font-size: 0.94rem;
    line-height: 1.65;
}

.yt-callout-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

/* Interactive Checklist (Checklist with Progress) */
.yt-checklist-box {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    margin: 25px 0;
}

.yt-checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.yt-checklist-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.yt-progress-container {
    background: var(--border-color);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.yt-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0284c7, #10b981);
    transition: width 0.3s ease;
}

.yt-checklist-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yt-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.yt-check-item:hover {
    border-color: var(--primary);
}

.yt-check-item.completed {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    text-decoration: line-through;
    color: var(--text-muted);
}

.yt-check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #10b981;
}

/* Post Share & Footer Actions */
.yt-post-footer-actions {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.yt-share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.yt-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.2s;
}

.yt-share-btn:hover {
    transform: translateY(-3px);
}

.yt-share-btn.whatsapp { background: #25d366; }
.yt-share-btn.twitter { background: #1da1f2; }
.yt-share-btn.telegram { background: #0088cc; }
.yt-share-btn.copy { background: #64748b; cursor: pointer; border: none; }

/* Responsive adjustments */
@media (max-width: 600px) {
    .yt-post-title {
        font-size: 1.55rem;
    }
    .yt-post-header {
        padding: 22px 18px;
    }
    .yt-main-article {
        padding: 24px 18px;
    }
}
