/* css/python.css - Python în browser. Follows the site theme (light + dark), pattern-matched to specs.css. */

:root {
    --py-accent: #3776ab;
    --py-accent-2: #ffd43b;
    --py-accent-soft: #e0ecf7;
    --py-card-bg: #ffffff;
    --py-card-border: #e5e7eb;
    --py-page-bg: #f5f8fc;
    --py-muted: #6b7280;
    --py-code-bg: #0f172a;
    --py-code-fg: #e2e8f0;
    --py-good: #15803d;
    --py-bad: #dc2626;
}

body.dark-theme {
    --py-accent: #6aa7dc;
    --py-accent-soft: #172b40;
    --py-card-bg: #1f2937;
    --py-card-border: #374151;
    --py-page-bg: #111827;
    --py-muted: #9ca3af;
    --py-good: #4ade80;
    --py-bad: #f87171;
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` makes <body> a scroll
   container that never scrolls, which silently kills any position: sticky inside. */
.py-body, body.py-body#page-top {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--py-page-bg); color: var(--text-color); min-height: 100vh; overflow-x: clip;
}

.py-main { flex: 1; padding-top: 96px; padding-bottom: 48px; }
.py-muted { margin: 0; color: var(--py-muted); font-size: .84rem; line-height: 1.5; }
.py-main code { color: var(--py-accent); }

.py-hero { padding: 24px 0 6px; text-align: center; }
.py-hero-icon { font-size: 3rem; line-height: 1; margin-bottom: 10px; }
.py-hero h1 { margin: 0 0 12px; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.py-lead { max-width: 760px; margin: 0 auto; color: var(--py-muted); font-size: 1rem; line-height: 1.6; }

.py-work { padding: 18px 0 8px; }
.py-layout { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1180px; }
.py-main-col { display: grid; gap: 16px; min-width: 0; }

.py-side { position: sticky; top: 90px; }
.py-lessons { display: grid; gap: 6px; }
.py-progress { margin: 0 0 4px; font-size: .84rem; color: var(--py-muted); }
.py-lesson-btn { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--py-card-border); border-radius: 10px; background: var(--py-card-bg); color: inherit; padding: 8px 10px; font-size: .88rem; cursor: pointer; }
.py-lesson-btn span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--py-accent-soft); color: var(--py-accent); font-size: .74rem; font-weight: 700; flex: 0 0 auto; }
.py-lesson-btn:hover { border-color: var(--py-accent); }
.py-lesson-btn.is-on { border-color: var(--py-accent); box-shadow: inset 0 0 0 1px var(--py-accent); }
.py-lesson-btn.is-done span { background: var(--py-good); color: #fff; }
.py-side-note { margin-top: 10px; }
.py-side-note a { color: var(--py-accent); }

.py-card { background: var(--py-card-bg); border: 1px solid var(--py-card-border); border-radius: 16px; padding: 18px; min-width: 0; }
.py-lesson h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 750; }
.py-lesson p { margin: 0 0 8px; line-height: 1.55; }
.py-task { background: var(--py-accent-soft); border-radius: 10px; padding: 10px 12px; }
.py-lesson a { color: var(--py-accent); }

.py-editor-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.py-editor-head h2 { margin: 0; font-size: 1rem; font-weight: 750; }
.py-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.py-btn { border-radius: 999px; padding: 7px 14px; font-size: .86rem; font-weight: 650; cursor: pointer; border: 1px solid var(--py-card-border); background: var(--py-card-bg); color: inherit; }
.py-btn:disabled { opacity: .5; cursor: not-allowed; }
.py-btn-run { background: var(--py-accent); border-color: var(--py-accent); color: #fff; }
.py-btn-stop { background: var(--py-bad); border-color: var(--py-bad); color: #fff; }
.py-btn-ghost:hover:not(:disabled) { border-color: var(--py-accent); color: var(--py-accent); }

.py-editor { display: grid; grid-template-columns: auto minmax(0, 1fr); border-radius: 12px; overflow: hidden; background: var(--py-code-bg); }
.py-gutter { margin: 0; padding: 12px 8px 12px 12px; color: #64748b; text-align: right; user-select: none; overflow: hidden; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; max-height: 420px; }
#py-code { width: 100%; min-height: 260px; max-height: 420px; resize: vertical; border: 0; outline: none; background: transparent; color: var(--py-code-fg); padding: 12px; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; tab-size: 4; white-space: pre; overflow: auto; caret-color: var(--py-accent-2); }
.py-keys { margin-top: 8px; }
.py-main kbd { border: 1px solid var(--py-card-border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--py-page-bg); color: inherit; font-size: .78rem; }

.py-stdin-wrap { margin-top: 10px; }
.py-stdin-wrap summary { cursor: pointer; font-size: .88rem; color: var(--py-accent); font-weight: 650; }
#py-stdin { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--py-card-border); border-radius: 10px; background: var(--py-page-bg); color: inherit; padding: 8px 10px; font: 13px/1.5 ui-monospace, Consolas, monospace; }

.py-status { margin: 0 0 8px; font-size: .9rem; white-space: pre-line; min-height: 1.3em; }
.py-status.is-busy { color: var(--py-accent); }
.py-status.is-good { color: var(--py-good); font-weight: 650; }
.py-status.is-error { color: var(--py-bad); }
.py-out { margin: 0; min-height: 90px; max-height: 360px; overflow: auto; border-radius: 12px; background: var(--py-code-bg); color: var(--py-code-fg); padding: 12px; font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.py-out .py-err { color: #fca5a5; }

.py-note { border-radius: 12px; padding: 12px 14px; background: var(--py-accent-soft); font-size: .86rem; line-height: 1.6; }
.py-powered { margin: 18px 0 0; text-align: center; color: var(--py-muted); font-size: .82rem; }
.py-powered a { color: var(--py-accent); }

@media (max-width: 860px) {
    .py-layout { grid-template-columns: minmax(0, 1fr); }
    .py-side { position: static; }
    .py-lessons { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 575.98px) {
    .py-hero h1 { font-size: 1.7rem; }
    .py-card { padding: 14px; }
}
