/* ==========================================================================
   CSS افزونه SEO Smart TOC - کاملاً واکنش‌گرا و سبک
========================================================================== */

/* ۱. دکمه چسبان (Floating Button) سمت راست */
#sstoc-floating-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background-color: #1a1a2e; /* رنگ تیره مشابه تصویر */
    color: #ffffff;
    border: none;
    padding: 15px 8px;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#sstoc-floating-btn:hover {
    background-color: #2a2a40;
    padding-right: 12px; /* افکت جذاب هاور */
}

/* عمودی کردن متن دکمه برای خوانایی در گوشه تصویر */
.sstoc-btn-text {
    writing-mode: vertical-rl;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* ۲. لایه تاریک پس‌زمینه (Overlay) */
#sstoc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* تاریک شدن صفحه */
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px); /* تار کردن بکگراند - بسیار مدرن */
}

/* کلاسی که با کلیک روی دکمه توسط JS اضافه می‌شود */
#sstoc-overlay.sstoc-active {
    opacity: 1;
    visibility: visible;
}

/* ۳. باکس پاپ‌آپ (Modal) */
.sstoc-modal {
    background-color: #ffffff;
    width: 90%;
    max-width: 500px;
    max-height: 80vh; /* در صورت طولانی بودن اسکرول می‌خورد */
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    direction: rtl;
}

#sstoc-overlay.sstoc-active .sstoc-modal {
    transform: translateY(0) scale(1); /* انیمیشن نرم باز شدن */
}

/* هدر پاپ‌آپ */
.sstoc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.sstoc-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

#sstoc-close-btn {
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #777;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

#sstoc-close-btn:hover {
    color: #e74c3c; /* قرمز شدن در صورت هاور */
}

/* ۴. لیست تیترها و لینک‌ها */
.sstoc-nav {
    padding: 20px;
    overflow-y: auto;
}

.sstoc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sstoc-nav li {
    margin-bottom: 15px;
    line-height: 1.6;
    position: relative;
}

.sstoc-nav a {
    text-decoration: none;
    color: #444;
    font-size: 15px;
    display: block;
    transition: color 0.2s;
}

.sstoc-nav a:hover {
    color: #0073aa; /* رنگ لینک در هاور */
}

/* سلسله مراتب تیترها (فاصله گرفتن تیترهای داخلی) */
.sstoc-item-h2 { padding-right: 0; font-weight: 600; }
.sstoc-item-h3 { padding-right: 20px; font-size: 14px; color: #555; }
.sstoc-item-h3::before { content: "-"; position: absolute; right: 8px; color: #ccc; }
.sstoc-item-h4 { padding-right: 40px; font-size: 13px; color: #777; }