/* NormCode Documentation - Shared Styles */
/* Aesthetic: Clean, technical, inspired by IDE documentation */

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

:root {
    --accent: #4DA3FF;
    --accent-hover: #3B8FE8;
    --accent-soft: rgba(77, 163, 255, 0.1);
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --bg-page: #fafafa;
    --bg-white: #ffffff;
    --border: #e5e7eb;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --code-comment: #6a9955;
    --code-keyword: #569cd6;
    --code-string: #ce9178;
    --code-function: #dcdcaa;
    --code-variable: #9cdcfe;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0.75rem 2rem;
    backdrop-filter: blur(8px);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

nav .logo-small {
    height: 28px;
}

nav .company-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

nav .nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Docs dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.925rem;
    transition: color 0.15s ease;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
    color: var(--accent);
}

.nav-dropdown-trigger svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.nav-dropdown-menu a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.2s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.925rem;
    transition: color 0.15s ease;
}

nav a:hover, nav a.active {
    color: var(--accent);
}

.lang-switcher {
    display: flex;
    gap: 0.25rem;
    margin-left: 1.5rem;
}

.lang-btn {
    padding: 0.35rem 0.7rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.lang-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.lang-btn.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* Page Header */
.page-header {
    margin-top: 56px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

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

.breadcrumb span {
    color: var(--text-muted);
}

/* Main Content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

main.docs-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    max-width: 1200px;
    align-items: start;
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 80px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.docs-sidebar h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.docs-sidebar ul {
    list-style: none;
}

.docs-sidebar li {
    margin-bottom: 0.35rem;
}

.docs-sidebar a {
    display: block;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.docs-sidebar a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.docs-sidebar a.active {
    background: var(--accent);
    color: white;
}

/* Content Area */
.docs-content {
    min-width: 0;
}

section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
}

h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.4rem;
}

/* Code Examples */
.code-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-example {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
    font-family: 'IBM Plex Mono', 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-example code {
    color: var(--code-variable);
}

/* Syntax highlighting helpers */
.code-example .comment {
    color: var(--code-comment);
}

.code-example .keyword {
    color: var(--code-keyword);
}

.code-example .string {
    color: var(--code-string);
}

.code-example .function {
    color: var(--code-function);
}

.inline-code {
    background: var(--bg-page);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

/* Tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    font-size: 0.925rem;
}

th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-page);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:last-child td {
    border-bottom: none;
}

td strong {
    font-weight: 600;
}

/* Pipeline Flow Diagram */
.pipeline-diagram {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    margin: 2rem 0;
    position: relative;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.pipeline-step:last-child {
    margin-bottom: 0;
}

.pipeline-step::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 1.5rem;
    background: linear-gradient(to bottom, var(--accent), rgba(77, 163, 255, 0.3));
}

.pipeline-step:last-child::after {
    display: none;
}

.pipeline-step-label {
    background: var(--bg-page);
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    text-align: center;
    min-width: 200px;
    position: relative;
    z-index: 1;
}

.pipeline-step-label.phase {
    background: linear-gradient(135deg, var(--accent-soft), rgba(77, 163, 255, 0.05));
    border-color: var(--accent);
    color: var(--accent);
}

.pipeline-step-label.input {
    background: var(--bg-white);
    border-color: var(--border);
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
}

.pipeline-step-label.output {
    background: var(--bg-white);
    border-color: var(--success);
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
}

.pipeline-step-label.output .file-ext {
    color: var(--success);
    font-weight: 600;
}

.pipeline-step-label.output .comment {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
}

.pipeline-step-label.final {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border-color: var(--success);
    color: var(--success);
    font-weight: 600;
}

.pipeline-step-comment {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Responsive pipeline */
@media (max-width: 768px) {
    .pipeline-diagram {
        padding: 1.5rem;
    }
    
    .pipeline-step-label {
        min-width: auto;
        width: 100%;
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
}

/* Info/Note Boxes */
.info-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.info-box p {
    margin: 0;
    color: var(--text-secondary);
}

.info-box.warning {
    border-left-color: var(--warning);
}

.info-box.success {
    border-left-color: var(--success);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.card h3 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 0.925rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Link Cards */
.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.link-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.link-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 8px;
    color: var(--accent);
    flex-shrink: 0;
}

.link-card-content h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.link-card-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.925rem;
    margin-top: 2rem;
    transition: color 0.15s ease;
}

.back-link:hover {
    color: var(--accent-hover);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-page);
    padding: 0.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Footer */
footer {
    background: var(--text-primary);
    padding: 3rem 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer strong {
    color: white;
}

footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 900px) {
    main.docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
    }

    .menu-toggle {
        display: flex;
    }

    nav .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 280px;
        height: 100vh;
        background: var(--bg-white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        padding: 2rem;
        transition: right 0.2s ease;
        border-left: 1px solid var(--border);
    }

    nav .nav-links.active {
        right: 0;
    }
    
    .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-top: 0.5rem;
        background: transparent;
    }

    .lang-switcher {
        margin-left: 0;
        margin-top: 1rem;
    }

    .page-header {
        padding: 2rem 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 2rem 1.5rem;
    }

    .code-example {
        padding: 1.25rem;
        font-size: 0.8rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}

html {
    scroll-behavior: smooth;
}

