/* Build It Guide Styles */
/* MoreSalamander StudioLabs */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2d3748;
    --secondary: #4a5568;
    --accent: #3182ce;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --success: #38a169;
    --warning: #d69e2e;
    --code-bg: #1a202c;
    --code-text: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--primary);
    line-height: 1.6;
}

/* Header */
.site-header {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.brand a {
    color: white;
    text-decoration: none;
}

.brand span {
    color: var(--accent);
}

.breadcrumb {
    font-size: 0.875rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Guide Header */
.guide-header {
    background: linear-gradient(135deg, var(--accent), #2c5282);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.guide-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.guide-header .subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

.guide-meta {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.875rem;
}

.guide-meta span {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

/* Progress Bar */
.progress-container {
    background: var(--border);
    height: 4px;
    position: sticky;
    top: 56px;
    z-index: 99;
}

.progress-bar {
    background: var(--accent);
    height: 100%;
    width: 0%;
    transition: width 0.1s;
}

/* Main Content */
.guide-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Section */
.page-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    overflow: hidden;
    scroll-margin-top: 80px;
}

.page-header {
    background: var(--primary);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-number {
    background: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.page-body {
    padding: 1.5rem;
}

/* Section Styles */
.page-section h2 {
    color: var(--primary);
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.page-section h2:first-child {
    margin-top: 0;
}

.page-section p {
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.page-section ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.page-section li {
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

/* Where This Fits Box */
.where-fits {
    background: #f0f4f8;
    border-left: 4px solid var(--accent);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.where-fits p {
    margin-bottom: 0.25rem;
}

.where-fits strong {
    color: var(--primary);
}

/* Code Block */
.code-block {
    background: var(--code-bg);
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.code-header {
    background: #2d3748;
    color: #a0aec0;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-family: monospace;
}

.code-block pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    color: var(--code-text);
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Inline code */
code {
    background: #edf2f7;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875em;
    color: var(--accent);
}

.code-block code {
    background: none;
    padding: 0;
    color: var(--code-text);
}

/* Checkpoint Box */
.checkpoint {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.checkpoint h3 {
    color: var(--success);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.checkpoint label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    color: var(--secondary);
}

.checkpoint input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: var(--success);
}

/* Troubleshooting Box */
.troubleshooting {
    background: #fffaf0;
    border: 1px solid #f6ad55;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.troubleshooting h3 {
    color: var(--warning);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Visual Placeholder */
.visual-placeholder {
    background: #edf2f7;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--secondary);
    margin: 1rem 0;
}

.visual-placeholder::before {
    content: "🔲";
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Next Page Link */
.next-page {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.next-page a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.next-page a:hover {
    text-decoration: underline;
}

/* Table of Contents Toggle */
.toc-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 1.25rem;
    z-index: 50;
}

.toc-toggle:hover {
    background: #2c5282;
}

/* TOC Panel */
.toc-panel {
    position: fixed;
    right: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s;
    z-index: 200;
    overflow-y: auto;
}

.toc-panel.open {
    right: 0;
}

.toc-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
}

.toc-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.toc-list {
    list-style: none;
    padding: 1rem;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
}

.toc-list a:hover {
    background: var(--bg);
    color: var(--accent);
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.site-footer a {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .guide-header h1 {
        font-size: 1.75rem;
    }

    .guide-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .guide-content {
        padding: 1rem;
    }

    .toc-panel {
        width: 100%;
        right: -100%;
    }
}
