/* =====================================================
   SplidIt User Manual - Custom Styles
   ===================================================== */

/* ── Google Font ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables ────────────────────────────────────── */
:root {
    --orange:       #EE480C;
    --orange-dark:  #c73b09;
    --orange-light: #fff5f2;
    --sidebar-w:    280px;
    --topbar-h:     60px;
    --radius:       12px;
    --shadow:       0 4px 24px rgba(0,0,0,.08);
    --border:       #e5e7eb;
    --text:         #111827;
    --text-muted:   #6b7280;
    --surface:      #ffffff;
    --surface-alt:  #f9fafb;
    --transition:   .22s cubic-bezier(.4,0,.2,1);
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--surface-alt);
    margin: 0;
    padding-top: var(--topbar-h);
}

/* ── Top Navigation Bar ───────────────────────────────── */
#topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    z-index: 1000;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

#topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--orange);
    flex-shrink: 0;
}
#topbar .brand img { width: 30px; height: 30px; }
#topbar .brand span { color: var(--text); }
#topbar .brand b { color: var(--orange); }

#topbar .manual-badge {
    background: var(--orange-light);
    color: var(--orange);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid rgba(238,72,12,.2);
}

/* Search Bar */
#topbar .search-wrap {
    flex: 1;
    max-width: 460px;
    margin-left: auto;
    position: relative;
}
#topbar .search-wrap input {
    width: 100%;
    padding: 9px 44px 9px 16px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: var(--surface-alt);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
#topbar .search-wrap input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(238,72,12,.12);
    background: white;
}
#topbar .search-wrap .search-icon {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
#topbar .search-wrap .search-clear {
    position: absolute;
    right: 36px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    border: none;
    background: none;
    font-size: 16px;
    padding: 0 4px;
}
#topbar .search-wrap input:not(:placeholder-shown) ~ .search-clear { display: block; }

/* Hamburger (mobile) */
#sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition);
    flex-shrink: 0;
}
#sidebar-toggle:hover { background: var(--surface-alt); }
#sidebar-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    margin: 5px 0;
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* ── Layout ───────────────────────────────────────────── */
#layout {
    display: flex;
    min-height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar ──────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 900;
    transition: transform var(--transition), box-shadow var(--transition);
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
    padding-bottom: 32px;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* Category group */
.sidebar-category { border-bottom: 1px solid var(--border); }

.sidebar-category-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    text-align: left;
    transition: color var(--transition), background var(--transition);
}
.sidebar-category-toggle:hover { color: var(--text); background: var(--surface-alt); }
.sidebar-category-toggle .cat-icon { font-size: 16px; }
.sidebar-category-toggle .cat-chevron {
    margin-left: auto;
    transition: transform var(--transition);
    color: var(--text-muted);
    font-size: 12px;
}
.sidebar-category.open .cat-chevron { transform: rotate(180deg); }

/* Sidebar links */
.sidebar-links {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.4,0,.2,1);
}
.sidebar-category.open .sidebar-links { max-height: 1000px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 44px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    border-radius: 0 6px 6px 0;
}
.sidebar-link:hover {
    color: var(--orange);
    background: var(--orange-light);
    border-left-color: rgba(238,72,12,.3);
}
.sidebar-link.active {
    color: var(--orange);
    background: var(--orange-light);
    border-left-color: var(--orange);
    font-weight: 700;
}
.sidebar-link .link-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}

/* Sidebar overlay (mobile) */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 899;
    backdrop-filter: blur(2px);
}

/* ── Main Content ──────────────────────────────────────── */
#main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    padding: 40px 48px;
    max-width: calc(100% - var(--sidebar-w));
}

/* ── Article Styles ────────────────────────────────────── */
.manual-article {
    max-width: 860px;
    animation: fadeUp .3s ease both;
}
@keyframes fadeUp {
    from { opacity:0; transform:translateY(12px); }
    to   { opacity:1; transform:none; }
}

.manual-article h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    margin: 0 0 8px;
    line-height: 1.2;
}
.manual-article .article-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0 0 32px;
    line-height: 1.5;
}
.manual-article h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    margin: 40px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.manual-article h2 .h2-icon { color: var(--orange); }

.manual-article h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 10px;
}
.manual-article p, .manual-article li {
    color: #374151;
    line-height: 1.75;
}
.manual-article ul, .manual-article ol {
    padding-left: 22px;
    margin: 12px 0;
}
.manual-article li { margin-bottom: 6px; }
.manual-article strong { color: var(--text); }
.manual-article code {
    background: #f3f4f6;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: .88em;
    font-family: 'JetBrains Mono', monospace;
    color: var(--orange-dark);
}

/* ── Callout Boxes ─────────────────────────────────────── */
.callout {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 20px 0;
    border: 1.5px solid;
}
.callout-icon { font-size: 20px; flex-shrink: 0; line-height: 1.5; }
.callout-body { flex: 1; font-size: 14px; line-height: 1.65; }
.callout-body > strong:first-child { display: block; margin-bottom: 4px; font-size: 14px; }

.callout-info   { background: #eff6ff; border-color: #bfdbfe; }
.callout-info   .callout-icon { color: #2563eb; }
.callout-info   .callout-body strong { color: #1d4ed8; }

.callout-tip    { background: #f0fdf4; border-color: #bbf7d0; }
.callout-tip    .callout-icon { color: #16a34a; }
.callout-tip    .callout-body strong { color: #15803d; }

.callout-warn   { background: #fffbeb; border-color: #fde68a; }
.callout-warn   .callout-icon { color: #d97706; }
.callout-warn   .callout-body strong { color: #b45309; }

.callout-orange { background: var(--orange-light); border-color: rgba(238,72,12,.25); }
.callout-orange .callout-icon { color: var(--orange); }
.callout-orange .callout-body strong { color: var(--orange-dark); }

/* ── Tier Badges ──────────────────────────────────────── */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .04em;
    vertical-align: middle;
    white-space: nowrap;
}
.tier-free        { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.tier-advanced    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.tier-pro         { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.tier-ultimate    { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.tier-enterprise  { background: #0f172a; color: #e2e8f0; border: 1px solid #334155; }
.tier-soon        { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.tier-admin       { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.tier-advanced::before    { content: '⚡'; font-size: 10px; }
.tier-pro::before         { content: '🚀'; font-size: 10px; }
.tier-ultimate::before    { content: '💎'; font-size: 10px; }
.tier-enterprise::before  { content: '⚖️'; font-size: 10px; }

/* ── Screenshot Placeholder ───────────────────────────── */
.screenshot-placeholder {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2.5px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 32px 24px;
    margin: 24px 0;
    text-align: center;
    position: relative;
}
.screenshot-placeholder::before {
    content: attr(data-screenshot-id);
    position: absolute;
    top: 10px; left: 14px;
    font-size: 10px;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--orange-light);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(238,72,12,.25);
}
.screenshot-placeholder .screenshot-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
    opacity: .4;
}
.screenshot-placeholder .screenshot-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 14px;
    display: block;
    margin-bottom: 6px;
}
.screenshot-placeholder .screenshot-desc {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
    display: block;
}

/* ── Real Screenshot Images ───────────────────────────── */
.manual-screenshot {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    margin: 24px 0;
}

/* ── Tables ───────────────────────────────────────────── */
.manual-table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); border: 1px solid var(--border); }
.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    white-space: nowrap;
}
.manual-table th {
    background: var(--surface-alt);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.manual-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: normal;
}
.manual-table tr:last-child td { border-bottom: none; }
.manual-table tr:hover td { background: var(--surface-alt); }
.manual-table .check  { color: #16a34a; font-size: 16px; }
.manual-table .cross  { color: #dc2626; font-size: 16px; }
.manual-table .soon   { color: #9ca3af; font-size: 13px; font-style: italic; }

/* ── Step Cards ───────────────────────────────────────── */
.steps { counter-reset: steps; list-style: none; padding: 0; margin: 20px 0; }
.steps li {
    counter-increment: steps;
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    align-items: flex-start;
}
.steps li::before {
    content: counter(steps);
    flex-shrink: 0;
    width: 30px; height: 30px;
    background: var(--orange);
    color: white;
    font-weight: 800;
    font-size: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.steps li .step-body { flex: 1; }
.steps li .step-body strong { display: block; margin-bottom: 3px; }

/* ── Feature Grid ─────────────────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.feature-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow); border-color: rgba(238,72,12,.3); }
.feature-card .fc-icon { font-size: 1.6rem; margin-bottom: 10px; }
.feature-card .fc-title { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.feature-card .fc-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ── Warning Banner Preview ────────────────────────────── */
.warning-state {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin: 10px 0;
    border: 2px solid;
    align-items: flex-start;
}
.warning-state .ws-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.warning-state .ws-body { flex: 1; }
.warning-state .ws-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.warning-state .ws-msg   { font-size: 13px; line-height: 1.5; }

.ws-yellow { background: rgba(245,158,11,.1); border-color: #fbbf24; }
.ws-yellow .ws-icon, .ws-yellow .ws-title { color: #b45309; }
.ws-yellow .ws-msg { color: #92400e; }

.ws-red { background: rgba(239,68,68,.1); border-color: #f87171; }
.ws-red .ws-icon, .ws-red .ws-title { color: #dc2626; }
.ws-red .ws-msg { color: #991b1b; }

.ws-blue { background: rgba(59,130,246,.1); border-color: #93c5fd; }
.ws-blue .ws-icon, .ws-blue .ws-title { color: #2563eb; }
.ws-blue .ws-msg { color: #1e40af; }

.ws-purple { background: rgba(139,92,246,.1); border-color: #c4b5fd; }
.ws-purple .ws-icon, .ws-purple .ws-title { color: #7c3aed; }
.ws-purple .ws-msg { color: #5b21b6; }

/* ── Search Results ────────────────────────────────────── */
.search-results-wrap { margin-top: 8px; }
.search-result-item {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow var(--transition), border-color var(--transition);
    text-decoration: none;
    display: block;
    color: inherit;
}
.search-result-item:hover {
    box-shadow: var(--shadow);
    border-color: rgba(238,72,12,.3);
}
.search-result-item .sri-page { font-size: 11px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.search-result-item .sri-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 6px; }
.search-result-item .sri-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.search-result-item mark { background: rgba(238,72,12,.15); color: var(--orange-dark); border-radius: 3px; padding: 0 2px; }

.no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.no-results .no-results-icon { font-size: 3rem; margin-bottom: 12px; }

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--orange); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #d1d5db; }

/* ── Page Footer ───────────────────────────────────────── */
.manual-article .article-footer {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: gap;
    gap: 16px;
}
.article-footer a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1.5px solid rgba(238,72,12,.3);
    transition: background var(--transition);
}
.article-footer a:hover { background: var(--orange-light); }
.article-footer .prev::before { content: '← '; }
.article-footer .next::after  { content: ' →'; }

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 900px) {
    #sidebar-toggle { display: block; }

    #sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    #sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }
    #sidebar-overlay.show { display: block; }

    #main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 24px 20px;
    }

    .manual-article h1 { font-size: 1.5rem; }

    #topbar .search-wrap { max-width: 100%; }
}

@media (max-width: 560px) {
    #topbar { padding: 0 14px; gap: 10px; }
    #topbar .brand span { display: none; }
    .feature-grid { grid-template-columns: 1fr; }
}

/* ── Sidebar Header & Footer ──────────────────────────────── */
.sidebar-header {
    padding: 16px 20px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--border);
}

.sidebar-footer {
    padding: 20px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-footer-link {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-decoration: none;
    transition: color var(--transition);
}
.sidebar-footer-link:first-child { color: var(--orange); }
.sidebar-footer-link:hover { color: var(--text); }

/* ── Page Loading Spinner ─────────────────────────────────── */
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Manual Home Button ───────────────────────────────────────── */
.manual-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    margin-left: -2px;
}
.manual-home-btn:hover {
    background: var(--hover-bg);
    color: var(--orange);
}



/* ── FAQ Accordion ────────────────────────────────── */
.faq-item {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin: 12px 0;
    background: var(--surface);
    overflow: hidden;
    transition: border-color var(--transition);
}
.faq-item[open] { border-color: var(--orange); }
.faq-item > summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    transition: background var(--transition);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before {
    content: '›';
    font-size: 18px;
    color: var(--orange);
    width: 16px;
    flex-shrink: 0;
    transition: transform .2s;
    display: inline-block;
}
.faq-item[open] > summary::before { transform: rotate(90deg); }
.faq-item > summary:hover { background: var(--hover-bg); }
.faq-body {
    padding: 4px 18px 18px 44px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.faq-body ul, .faq-body ol { margin: 8px 0 8px 20px; }
.faq-body .manual-screenshot { margin: 12px 0; }
