/* ============================================
   Sitly Documentation — Shared Styles
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --docs-primary: #f97316;
    --docs-primary-dark: #ea580c;
    --docs-bg: #0a0c10;
    --docs-bg-soft: #11151e;
    --docs-bg-softer: #1a1f2a;
    --docs-border: #252c3a;
    --docs-border-soft: #2d3748;
    --docs-text: #eef2ff;
    --docs-text-muted: #9ca3af;
    --docs-text-dim: #6b7280;
    --docs-green: #22c55e;
    --docs-red: #ef4444;
    --docs-yellow: #eab308;
    --docs-blue: #3b82f6;
    --docs-sidebar-width: 280px;
    --docs-toc-width: 220px;
    --docs-header-height: 60px;
    --docs-radius: 12px;
    --docs-font: 'Vazirmatn', 'Segoe UI', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--docs-font);
    background: var(--docs-bg);
    color: var(--docs-text);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.docs-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--docs-border);
    height: var(--docs-header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
}

.docs-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--docs-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    white-space: nowrap;
}

.docs-header-brand span:last-child {
    font-size: 0.7rem;
    color: var(--docs-text-muted);
    font-weight: 400;
    -webkit-text-fill-color: var(--docs-text-muted);
}

.docs-header-nav {
    display: flex;
    gap: 6px;
    flex: 1;
    align-items: center;
}

.docs-header-nav a {
    padding: 8px 14px;
    border-radius: 40px;
    font-size: 0.85rem;
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.docs-header-nav a:hover,
.docs-header-nav a.active {
    color: var(--docs-primary);
    background: rgba(249, 115, 22, 0.1);
}

.docs-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.docs-header-actions a {
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-docs-primary {
    background: linear-gradient(135deg, var(--docs-primary), var(--docs-primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.btn-docs-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.4);
}

.btn-docs-ghost {
    color: var(--docs-text-muted);
    border: 1px solid var(--docs-border);
}

.btn-docs-ghost:hover {
    color: var(--docs-text);
    border-color: var(--docs-border-soft);
}

/* ============================================
   Layout
   ============================================ */
.docs-layout {
    display: grid;
    grid-template-columns: var(--docs-sidebar-width) 1fr;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0;
    align-items: start;
}

/* ============================================
   Sidebar
   ============================================ */
.docs-sidebar {
    position: sticky;
    top: var(--docs-header-height);
    height: calc(100vh - var(--docs-header-height));
    overflow-y: auto;
    padding: 24px 16px 40px;
    border-left: 1px solid var(--docs-border);
    background: var(--docs-bg-soft);
}

.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}
.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--docs-border);
    border-radius: 10px;
}

.docs-sidebar-section {
    margin-bottom: 24px;
}

.docs-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--docs-text-dim);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.docs-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--docs-text-muted);
    text-decoration: none;
    font-size: 0.87rem;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.docs-sidebar-link:hover {
    color: var(--docs-text);
    background: rgba(255, 255, 255, 0.04);
}

.docs-sidebar-link.active {
    color: var(--docs-primary);
    background: rgba(249, 115, 22, 0.1);
    font-weight: 600;
}

.docs-sidebar-link i {
    width: 18px;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.7;
}

.docs-sidebar-link.active i {
    opacity: 1;
}

/* ============================================
   Main Content
   ============================================ */
.docs-main {
    padding: 40px 48px 80px;
    max-width: 900px;
    width: 100%;
}

.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--docs-text-dim);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.docs-breadcrumb a {
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.docs-breadcrumb a:hover {
    color: var(--docs-primary);
}

.docs-breadcrumb span.sep {
    opacity: 0.4;
}

.docs-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--docs-primary);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.docs-main h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
    color: #fff;
}

.docs-lead {
    font-size: 1.05rem;
    color: var(--docs-text-muted);
    line-height: 1.8;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--docs-border);
}

.docs-main h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--docs-border);
    color: #fff;
    scroll-margin-top: calc(var(--docs-header-height) + 20px);
}

.docs-main h2:first-of-type {
    margin-top: 32px;
}

.docs-main h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 12px;
    color: #fff;
    scroll-margin-top: calc(var(--docs-header-height) + 20px);
}

.docs-main p {
    color: var(--docs-text-muted);
    margin-bottom: 14px;
    line-height: 1.8;
}

.docs-main strong {
    color: var(--docs-text);
    font-weight: 600;
}

.docs-main a {
    color: var(--docs-primary);
    text-decoration: none;
    transition: opacity 0.15s;
}

.docs-main a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.docs-main ul,
.docs-main ol {
    margin: 0 0 16px 0;
    padding-right: 22px;
    color: var(--docs-text-muted);
}

.docs-main li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.docs-main li strong {
    color: var(--docs-text);
}

.docs-main code {
    background: var(--docs-bg-softer);
    color: var(--docs-primary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: 'Courier New', monospace;
    direction: ltr;
    display: inline-block;
    border: 1px solid var(--docs-border);
}

.docs-main pre {
    background: var(--docs-bg-soft);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 20px;
    direction: ltr;
    text-align: left;
}

.docs-main pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--docs-text);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ============================================
   Screenshot Placeholder
   ============================================ */
.docs-screenshot {
    margin: 24px 0 32px;
    border-radius: var(--docs-radius);
    overflow: hidden;
    border: 1px solid var(--docs-border);
    background: var(--docs-bg-soft);
    position: relative;
}

.docs-screenshot img {
    display: block;
    width: 100%;
    height: auto;
}

.docs-screenshot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 80px 24px;
    background:
        repeating-linear-gradient(
            45deg,
            var(--docs-bg-soft),
            var(--docs-bg-soft) 10px,
            var(--docs-bg-softer) 10px,
            var(--docs-bg-softer) 20px
        );
    color: var(--docs-text-dim);
    text-align: center;
    border: 2px dashed var(--docs-border-soft);
    border-radius: var(--docs-radius);
}

.docs-screenshot-empty i {
    font-size: 2.5rem;
    color: var(--docs-primary);
    opacity: 0.6;
}

.docs-screenshot-empty .shot-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--docs-text-muted);
}

.docs-screenshot-empty .shot-hint {
    font-size: 0.78rem;
    color: var(--docs-text-dim);
    font-family: 'Courier New', monospace;
    direction: ltr;
    background: rgba(0,0,0,0.3);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--docs-border);
}

.docs-screenshot-caption {
    font-size: 0.8rem;
    color: var(--docs-text-dim);
    text-align: center;
    padding: 10px 16px;
    background: var(--docs-bg-soft);
    border-top: 1px solid var(--docs-border);
    font-style: italic;
}

/* ============================================
   Tables
   ============================================ */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    border-radius: var(--docs-radius);
    overflow: hidden;
    border: 1px solid var(--docs-border);
    font-size: 0.88rem;
}

.docs-table thead {
    background: var(--docs-bg-softer);
}

.docs-table th {
    padding: 12px 16px;
    text-align: right;
    font-weight: 700;
    color: var(--docs-primary);
    font-size: 0.82rem;
    border-bottom: 1px solid var(--docs-border);
}

.docs-table td {
    padding: 12px 16px;
    color: var(--docs-text-muted);
    border-bottom: 1px solid var(--docs-border);
    vertical-align: top;
}

.docs-table tbody tr:last-child td {
    border-bottom: 0;
}

.docs-table tbody tr:hover {
    background: rgba(249, 115, 22, 0.04);
}

.docs-table code {
    font-size: 0.8rem;
}

/* ============================================
   Callouts
   ============================================ */
.docs-callout {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--docs-radius);
    margin: 20px 0;
    border: 1px solid;
    align-items: flex-start;
}

.docs-callout-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    margin-top: 2px;
}

.docs-callout-content {
    flex: 1;
}

.docs-callout-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.92rem;
}

.docs-callout-content p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.7;
}

.docs-callout.info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}
.docs-callout.info .docs-callout-icon { color: var(--docs-blue); }
.docs-callout.info strong { color: var(--docs-blue); }

.docs-callout.tip {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
}
.docs-callout.tip .docs-callout-icon { color: var(--docs-green); }
.docs-callout.tip strong { color: var(--docs-green); }

.docs-callout.warning {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.3);
}
.docs-callout.warning .docs-callout-icon { color: var(--docs-yellow); }
.docs-callout.warning strong { color: var(--docs-yellow); }

.docs-callout.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}
.docs-callout.danger .docs-callout-icon { color: var(--docs-red); }
.docs-callout.danger strong { color: var(--docs-red); }

/* ============================================
   Steps
   ============================================ */
.docs-steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 20px 0 28px;
}

.docs-steps li {
    position: relative;
    padding: 0 56px 24px 0;
    counter-increment: step;
    margin: 0;
    border-right: 2px solid var(--docs-border);
}

.docs-steps li:last-child {
    border-right-color: transparent;
    padding-bottom: 0;
}

.docs-steps li::before {
    content: counter(step);
    position: absolute;
    right: -18px;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--docs-primary), var(--docs-primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

.docs-steps li strong {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-size: 0.95rem;
}

.docs-steps li p {
    margin: 0;
    font-size: 0.87rem;
}

/* ============================================
   Pager
   ============================================ */
.docs-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--docs-border);
}

.docs-pager a {
    display: block;
    padding: 16px 20px;
    border-radius: var(--docs-radius);
    border: 1px solid var(--docs-border);
    background: var(--docs-bg-soft);
    text-decoration: none;
    color: var(--docs-text);
    transition: all 0.2s;
}

.docs-pager a:hover {
    border-color: var(--docs-primary);
    background: rgba(249, 115, 22, 0.05);
    text-decoration: none;
}

.docs-pager .label {
    display: block;
    font-size: 0.72rem;
    color: var(--docs-text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-pager .title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--docs-primary);
}

.docs-pager .next {
    text-align: left;
}

.docs-pager .next .label::after { content: ''; }

/* ============================================
   Footer
   ============================================ */
.docs-footer {
    border-top: 1px solid var(--docs-border);
    background: var(--docs-bg-soft);
    padding: 32px 24px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--docs-text-dim);
    margin-top: 60px;
}

.docs-footer a {
    color: var(--docs-text-muted);
    text-decoration: none;
    margin: 0 12px;
}

.docs-footer a:hover {
    color: var(--docs-primary);
}

/* ============================================
   Search
   ============================================ */
.docs-search-wrap {
    position: relative;
    flex: 0 0 260px;
}

.docs-search-wrap input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    background: var(--docs-bg-soft);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    color: var(--docs-text);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.docs-search-wrap input:focus {
    border-color: var(--docs-primary);
    background: var(--docs-bg-softer);
}

.docs-search-wrap input::placeholder {
    color: var(--docs-text-dim);
}

.docs-search-wrap .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--docs-text-dim);
    font-size: 0.85rem;
    pointer-events: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    .docs-sidebar {
        position: static;
        height: auto;
        border-left: 0;
        border-bottom: 1px solid var(--docs-border);
    }
    .docs-main {
        padding: 32px 24px 60px;
    }
}

@media (max-width: 768px) {
    .docs-header {
        padding: 0 14px;
        gap: 12px;
    }
    .docs-header-nav {
        display: none;
    }
    .docs-header-actions .btn-docs-ghost {
        display: none;
    }
    .docs-main h1 {
        font-size: 1.6rem;
    }
    .docs-main h2 {
        font-size: 1.25rem;
        margin-top: 36px;
    }
    .docs-main {
        padding: 24px 16px 48px;
    }
    .docs-pager {
        grid-template-columns: 1fr;
    }
    .docs-search-wrap {
        flex: 1;
    }
}

/* ============================================
   Scroll to Top
   ============================================ */
.docs-scroll-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--docs-primary), var(--docs-primary-dark));
    color: #fff;
    border: 0;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    z-index: 200;
}

.docs-scroll-top.show {
    display: flex;
}

.docs-scroll-top:hover {
    transform: translateY(-2px);
}