/* Tutorial-specific styles — supplements ../styles.css */

:root {
    --tutorial-nav-width: 280px;
    --content-max-width: 860px;
}

body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

/* Wider nav for tutorial sections */
.navbar {
    width: var(--tutorial-nav-width);
    overflow-y: auto;
}

.navbar-content {
    padding: 40px 16px 40px;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section .nav-label {
    font-size: 11px;
    margin-bottom: 6px;
}

.nav-link {
    display: block;
    padding: 6px 12px;
    margin-bottom: 2px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

.nav-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    opacity: 1;
    background: rgba(127, 255, 0, 0.1);
    border-left: 2px solid var(--text-color);
    padding-left: 10px;
}

.nav-link.sub {
    padding-left: 24px;
    font-size: 12px;
}

.nav-back {
    display: block;
    padding: 8px 12px;
    margin-bottom: 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
    opacity: 0.6;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    text-align: center;
}

.nav-back:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

/* Main content area */
.tutorial-main {
    margin-left: var(--tutorial-nav-width);
    padding: 40px 40px 120px;
    max-width: calc(var(--content-max-width) + var(--tutorial-nav-width) + 80px);
}

.tutorial-section {
    margin-bottom: 80px;
    scroll-margin-top: 20px;
}

.tutorial-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-color);
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 8px;
}

.tutorial-section h3 {
    font-size: 18px;
    margin: 30px 0 12px;
    color: var(--text-color);
}

.tutorial-prose {
    line-height: 1.7;
    font-size: 15px;
    max-width: var(--content-max-width);
    margin-bottom: 16px;
    opacity: 0.85;
}

.tutorial-prose a {
    color: var(--text-color);
    text-decoration: underline;
}

.tutorial-prose code {
    background: rgba(127, 255, 0, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 14px;
}

/* Try-it live parse widget */
.try-it {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0 24px;
    max-width: var(--content-max-width);
}

body.light-mode .try-it {
    background: rgba(0, 0, 0, 0.03);
}

.try-it-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.try-it-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line-color);
    border-radius: 6px;
    color: var(--text-color);
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
}

body.light-mode .try-it-input {
    background: rgba(255, 255, 255, 0.8);
    color: #000;
}

.try-it-input::placeholder {
    opacity: 0.4;
}

.try-it-btn {
    padding: 10px 20px;
    background: rgba(127, 255, 0, 0.15);
    border: 1px solid var(--text-color);
    border-radius: 6px;
    color: var(--text-color);
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.try-it-btn:hover {
    background: rgba(127, 255, 0, 0.25);
}

.try-it-btn:disabled {
    opacity: 0.4;
    cursor: wait;
}

.try-it-tree {
    min-height: 60px;
}

.try-it-tree .tree-wrapper {
    margin: 0;
    background: transparent;
}

/* Code blocks with language tabs */
.code-example {
    max-width: var(--content-max-width);
    margin: 20px 0 24px;
    border: 1px solid var(--line-color);
    border-radius: 8px;
    overflow: hidden;
}

.code-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--line-color);
    overflow-x: auto;
}

body.light-mode .code-tabs {
    background: rgba(0, 0, 0, 0.05);
}

.code-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    cursor: pointer;
    opacity: 0.5;
    white-space: nowrap;
    transition: opacity 0.2s, background 0.2s;
    border-bottom: 2px solid transparent;
}

.code-tab:hover {
    opacity: 0.8;
}

.code-tab.active {
    opacity: 1;
    border-bottom-color: var(--text-color);
    background: rgba(127, 255, 0, 0.05);
}

.code-panel {
    display: none;
    position: relative;
}

.code-panel.active {
    display: block;
}

.code-panel pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.15);
}

body.light-mode .code-panel pre {
    background: rgba(0, 0, 0, 0.02);
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(127, 255, 0, 0.1);
    border: 1px solid var(--line-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 11px;
    cursor: pointer;
    font-family: 'Courier Prime', monospace;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

/* Legend swatches */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0 24px;
    max-width: var(--content-max-width);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Highlights for inline emphasis */
.hl-verb { color: #ff6b6b; }
.hl-noun { color: #74b9ff; }
.hl-mod { color: #ffeaa7; }
.hl-mark { color: #55efc4; }
.hl-agent { color: #e17055; }
.hl-patient { color: #87ceeb; }
.hl-theme { color: #90ee90; }
.hl-location { color: #dda0dd; }

/* Responsive */
@media (max-width: 900px) {
    .navbar {
        transform: translateX(-100%);
    }
    .navbar.visible {
        transform: translateX(0);
    }
    .tutorial-main {
        margin-left: 0;
        padding: 60px 20px 80px;
    }
    .navbar-toggle {
        display: block !important;
    }
}
