/**
 * pseudocode.css — Styles for the PseudoCodeViewer utility component.
 *
 * Extracted and generalized from inline styles in c07c_filter.html.
 * Uses CSS custom properties from tokens.css for theming.
 *
 * Class prefix: .psc- (pseudocode)
 */

/* ===== BLOCK ===== */
.psc-block {
    background: var(--bg-code, #1e1e2e);
    border-radius: 8px;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
}

.psc-title {
    padding: 8px 14px;
    background: var(--bg-code-header, #2d2d44);
    color: var(--text-code-title, #cdd6f4);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.psc-code {
    padding: 8px 0;
    overflow-y: auto;
    max-height: 400px;
}

/* ===== LINE ===== */
.psc-line {
    display: flex;
    align-items: baseline;
    padding: 2px 14px;
    transition: background 0.2s ease;
    border-left: 3px solid transparent;
}

.psc-line:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Active line highlight */
.psc-line--active {
    background: rgba(137, 180, 250, 0.12);
    border-left-color: var(--accent-blue, #89b4fa);
}

/* ===== LINE NUMBER ===== */
.psc-num {
    flex: 0 0 32px;
    text-align: right;
    padding-right: 12px;
    color: var(--text-code-linenum, #585b70);
    user-select: none;
    font-size: 0.72rem;
}

/* ===== CODE TEXT ===== */
.psc-text {
    flex: 1;
    color: var(--text-code, #cdd6f4);
    white-space: pre;
}

/* ===== SYNTAX CLASSES ===== */
.psc-text .kw {
    color: var(--code-keyword, #cba6f7);
    font-weight: 600;
}

.psc-text .fn {
    color: var(--code-function, #89b4fa);
}

.psc-text .str {
    color: var(--code-string, #a6e3a1);
}

.psc-text .cm {
    color: var(--code-comment, #6c7086);
    font-style: italic;
}

.psc-text .var {
    color: var(--code-variable, #f9e2af);
}

.psc-text .num {
    color: var(--code-number, #fab387);
}

/* ===== ANNOTATION ===== */
.psc-annotation {
    flex: 0 0 auto;
    margin-left: 16px;
    color: var(--accent-yellow, #f9e2af);
    font-size: 0.74rem;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.psc-annotation.visible {
    opacity: 1;
}

/* ===== MODE TOGGLE ===== */
.psc-mode-toggle {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
    background: var(--bg-code, #1e1e2e);
    border-radius: 6px;
    padding: 2px;
}

.psc-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-code-linenum, #585b70);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.psc-mode-btn .material-symbols-outlined {
    font-size: 14px;
}

.psc-mode-btn:hover {
    color: var(--text-code, #cdd6f4);
    background: rgba(255, 255, 255, 0.05);
}

.psc-mode-btn.active {
    background: var(--accent-blue, #89b4fa);
    color: var(--bg-code, #1e1e2e);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .psc-code {
        max-height: 300px;
    }

    .psc-line {
        padding: 2px 8px;
    }

    .psc-num {
        flex: 0 0 24px;
        font-size: 0.65rem;
    }

    .psc-text {
        font-size: 0.75rem;
    }

    .psc-mode-btn span:not(.material-symbols-outlined) {
        display: none;
    }
}
