/* ============================================
   ZYNQOR User Guide Styles
   ============================================ */

/* Guide Layout */
.guide-layout {
    display: block;
    max-width: 1400px;
    margin: 0 auto;
    padding: 88px 24px 60px;
    padding-left: 380px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Table of Contents Sidebar */
.guide-toc {
    position: fixed;
    top: 88px;
    left: 0;
    width: 340px;
    height: calc(100vh - 88px);
    overflow-y: auto;
    padding-left: 40px;
    padding-right: 32px;
    border-right: 1px solid var(--glass-border);
    z-index: 50;
}

.guide-toc::-webkit-scrollbar {
    width: 4px;
}

.guide-toc::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.toc-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    position: sticky;
    top: 0;
    background: var(--bg-primary, #0a0e17);
    padding: 6px 0;
    z-index: 2;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 2px;
}

.toc-list a {
    display: block;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc-list a:hover {
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.08);
    border-left-color: rgba(0, 212, 255, 0.4);
}

.toc-list a.active {
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.06);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.toc-list .toc-sub {
    font-size: 14px;
}

/* Guide Content Area */
.guide-content {
    padding-left: 32px;
    max-width: 820px;
    position: relative;
}

/* Guide Header */
.guide-hero {
    margin-bottom: 48px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--glass-border);
}

.guide-hero h1 {
    font-family: 'Inter', sans-serif !important;
    font-size: 42px;
    font-weight: 700 !important;
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.guide-hero h1 .guide-accent {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, #a855f7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guide-hero p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
}

.guide-meta {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.guide-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Chapter Sections */
.guide-chapter {
    margin-bottom: 64px;
    scroll-margin-top: 100px;
    /* Override styles.css section:not(.hero) { opacity:0 } — guide has no script.js reveal */
    opacity: 1 !important;
    transform: none !important;
}

.guide-chapter h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.guide-chapter h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.guide-chapter h4 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--accent-primary);
}

.guide-chapter p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.guide-chapter ul,
.guide-chapter ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.guide-chapter li {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.guide-chapter strong {
    color: var(--text-primary);
}

/* Reference Tables */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0 32px;
    font-size: 14px;
    border-radius: 12px;
    overflow: hidden;
}

.guide-table thead {
    background: rgba(0, 212, 255, 0.08);
}

.guide-table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
}

.guide-table td {
    padding: 12px 18px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.guide-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.guide-table code {
    background: rgba(0, 212, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent-primary);
}

/* Info/Tip/Warning Boxes */
.guide-box {
    padding: 20px 24px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.7;
}

.guide-box.tip {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    color: var(--text-secondary);
}

.guide-box.tip::before {
    content: '💡 Tip';
    display: block;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 6px;
}

.guide-box.warning {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: var(--text-secondary);
}

.guide-box.warning::before {
    content: '⚠️ Important';
    display: block;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 6px;
}

.guide-box.info {
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.15);
    color: var(--text-secondary);
}

.guide-box.info::before {
    content: 'ℹ️ Note';
    display: block;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

/* Step-by-Step */
.guide-steps {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.guide-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 48px;
    margin-bottom: 24px;
    min-height: 36px;
}

.guide-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Screenshot Placeholders */
.guide-screenshot {
    width: 100%;
    margin: 20px 0;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.guide-screenshot img {
    width: 100%;
    display: block;
}

.guide-screenshot-placeholder {
    width: 100%;
    height: 300px;
    background: rgba(0, 212, 255, 0.03);
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    margin: 20px 0;
}

/* Back to Top */
.guide-back-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

.guide-back-top.visible {
    opacity: 1;
    visibility: visible;
}

.guide-back-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .guide-layout {
        padding-top: 80px;
        padding-left: 24px;
    }

    .guide-toc {
        position: relative;
        top: 0;
        width: 100%;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 24px;
        margin-bottom: 32px;
        padding-left: 16px;
        padding-right: 0;
    }

    .guide-content {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .guide-hero h1 {
        font-size: 28px;
    }

    .guide-chapter h2 {
        font-size: 22px;
    }

    .guide-actions {
        flex-direction: column;
    }

    .guide-meta {
        flex-direction: column;
        gap: 8px;
    }

    .guide-table {
        font-size: 12px;
    }

    .guide-table th,
    .guide-table td {
        padding: 8px 12px;
    }
}

/* Print Styles for PDF Download */
@media print {

    .navbar,
    .guide-toc,
    .guide-back-top,
    .guide-actions,
    .footer {
        display: none !important;
    }

    .guide-layout {
        display: block;
        padding: 0;
    }

    .guide-content {
        padding: 0;
        max-width: 100%;
    }

    .guide-hero {
        page-break-after: always;
    }

    .guide-hero h1 {
        font-size: 36px;
        color: #000;
    }

    .guide-chapter {
        page-break-inside: avoid;
    }

    .guide-chapter h2 {
        page-break-after: avoid;
        color: #000;
    }

    body {
        background: white;
        color: #333;
    }

    .guide-chapter p,
    .guide-chapter li {
        color: #333;
    }

    .guide-table th {
        color: #0078d4;
    }

    .guide-table td {
        color: #333;
        border-bottom-color: #ddd;
    }

    .guide-box {
        border-width: 2px;
    }

    .guide-screenshot-placeholder {
        height: 200px;
        border-color: #ccc;
        color: #999;
    }
}
/* ═══════════════════════════════════════
   Mobile overflow fixes (2026-07-04)
   Long code strings and wide tables were
   pushing the page wider than the screen.
   ═══════════════════════════════════════ */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    code {
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: pre-wrap;
    }

    .guide-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
