/* =============================================
   DevPath Pro — Professional Learning Platform
   ============================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* --- Design Tokens --- */
:root {
    --sidebar-width: 280px;
    --header-height: 56px;

    /* Colors */
    --bg-body:        #0d1117;
    --bg-sidebar:     #161b22;
    --bg-content:     #0d1117;
    --bg-card:        #161b22;
    --bg-hover:       #1c2128;
    --bg-active:      #1f2937;
    --bg-code:        #161b22;
    --bg-callout-tip: #0d2137;
    --bg-callout-info:#16201c;

    --border-subtle:  #21262d;
    --border-strong:  #30363d;

    --text-primary:   #e6edf3;
    --text-secondary: #8b949e;
    --text-muted:     #484f58;

    --accent-blue:    #58a6ff;
    --accent-green:   #3fb950;
    --accent-orange:  #d29922;
    --accent-purple:  #bc8cff;

    --tag-html-bg:    rgba(239,68,68,0.15);
    --tag-html-text:  #f87171;
    --tag-css-bg:     rgba(99,102,241,0.15);
    --tag-css-text:   #818cf8;
    --tag-js-bg:      rgba(234,179,8,0.15);
    --tag-js-text:    #eab308;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* =============================================
   TOP HEADER
   ============================================= */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-strong);
}

.course-title-header {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-active);
    border: 1px solid var(--border-strong);
    border-radius: 50px;
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-dot {
    width: 8px; height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
}

/* =============================================
   PAGE SHELL
   ============================================= */
.page-shell {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.sidebar-section {
    padding: 1.25rem 0 0;
}

.sidebar-section-title {
    padding: 0 1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1rem;
    font-size: 0.83rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
    border-left-color: var(--accent-blue);
    font-weight: 500;
}

.sidebar-item-icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
    font-size: 0.8rem;
    text-align: center;
}

.sidebar-item.active .sidebar-item-icon { opacity: 1; }

/* Module Group */
.sidebar-module-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    margin-top: 0.5rem;
}

.module-tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.tag-html { background: var(--tag-html-bg); color: var(--tag-html-text); }
.tag-css  { background: var(--tag-css-bg);  color: var(--tag-css-text); }
.tag-js   { background: var(--tag-js-bg);   color: var(--tag-js-text); }

/* Lesson status icons */
.lesson-check {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0;
}
.sidebar-item.done .lesson-check { opacity: 1; color: var(--accent-green); }

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.content-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.lesson-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 2rem 6rem;
    width: 100%;
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: none; }
.breadcrumb-sep { color: var(--text-muted); }

/* =============================================
   LESSON HEADER
   ============================================= */
.lesson-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.lesson-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.chapter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(58,166,80,0.1);
    color: var(--accent-green);
    border: 1px solid rgba(58,166,80,0.2);
}

.read-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lesson-title {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
}

.lesson-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =============================================
   CONTENT TYPOGRAPHY
   ============================================= */
.lesson-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 0.75rem;
    letter-spacing: -0.01em;
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.lesson-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.75rem 0 0.5rem;
}

.lesson-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
    line-height: 1.75;
}

.lesson-body ul, .lesson-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.1rem;
}

.lesson-body li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.45rem;
    line-height: 1.7;
}

.lesson-body li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* =============================================
   CODE BLOCKS
   ============================================= */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.02);
}

.code-lang {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-btn {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.copy-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }

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

.code-block code {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #c9d1d9;
}

/* Inline code */
.lesson-body p code,
.lesson-body li code {
    font-family: 'Fira Code', monospace;
    font-size: 0.82em;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--accent-purple);
}

/* =============================================
   CALLOUTS
   ============================================= */
.callout {
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    border-left: 3px solid;
    font-size: 0.9rem;
}

.callout-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.callout-body { color: var(--text-secondary); line-height: 1.65; }

.callout.tip {
    background: rgba(58,166,80,0.07);
    border-color: var(--accent-green);
}
.callout.tip .callout-title { color: var(--accent-green); }

.callout.info {
    background: rgba(88,166,255,0.07);
    border-color: var(--accent-blue);
}
.callout.info .callout-title { color: var(--accent-blue); }

.callout.warning {
    background: rgba(210,153,34,0.07);
    border-color: var(--accent-orange);
}
.callout.warning .callout-title { color: var(--accent-orange); }

/* =============================================
   CONCEPT CARDS
   ============================================= */
.concept-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.concept-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
}

.concept-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.concept-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.concept-card-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
    overflow-x: auto;
    margin: 1.25rem 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th {
    background: var(--bg-card);
    text-align: left;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

td {
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* =============================================
   SECTION DIVIDERS
   ============================================= */
.section-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 2.5rem 0;
}

.phase-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2.5rem 0 1rem;
}

.phase-number {
    width: 28px; height: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-blue);
    flex-shrink: 0;
}

/* =============================================
   LESSON NAV (bottom)
   ============================================= */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.lesson-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    flex: 1;
    transition: all 0.15s ease;
    min-width: 0;
}

.lesson-nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    text-decoration: none;
    color: var(--text-primary);
}

.lesson-nav-btn.next { justify-content: flex-end; text-align: right; }

.nav-arrow { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }
.nav-text { min-width: 0; }
.nav-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 2px; }
.nav-name  { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* =============================================
   TOC (right side float for long pages)
   ============================================= */
.toc-aside {
    display: none; /* visible in wider layouts */
}

/* =============================================
   HERO / COURSE HOME
   ============================================= */
.course-hero {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2.5rem;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.85rem;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 1.75rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item { }
.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =============================================
   MODULE CARDS (on course home)
   ============================================= */
.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 4rem;
}

.modules-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.module-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
    margin-bottom: 0.5rem;
}

.module-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    text-decoration: none;
    transform: none;
}

.module-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.icon-html { background: var(--tag-html-bg); }
.icon-css  { background: var(--tag-css-bg); }
.icon-js   { background: var(--tag-js-bg); }
.icon-proj { background: rgba(59,130,246,0.12); }
.icon-wf   { background: rgba(16,185,129,0.12); }

.module-info { flex: 1; min-width: 0; }
.module-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.module-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.module-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    :root { --sidebar-width: 240px; }
}

@media (max-width: 700px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 999;
    }
    .sidebar.open { transform: translateX(0); }
    .content-area { margin-left: 0; }
    .lesson-container { padding: 1.5rem 1rem 5rem; }
    .lesson-title { font-size: 1.5rem; }
    .concept-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 1.65rem; }
    .lesson-nav { flex-direction: column; }
}

/* =============================================
   PDF EXPORT BAR
   ============================================= */
.pdf-export-bar {
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pdf-export-bar .pdf-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.pdf-export-bar .pdf-info .pdf-icon {
    font-size: 1rem;
}

.pdf-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99,102,241,0.3);
    background: rgba(99,102,241,0.12);
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.pdf-export-btn:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-1px);
    text-decoration: none;
}

.pdf-export-btn .btn-icon {
    font-size: 0.85rem;
}

/* =============================================
   INLINE PLAYGROUND — "TRY IT YOURSELF"
   ============================================= */

/* The trigger button beneath each code block */
.try-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: -0.25rem 0 1.25rem;
    padding: 0.5rem 1.1rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(139,92,246,0.10));
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: var(--radius-md);
    color: var(--accent-blue);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}
.try-btn:hover {
    background: linear-gradient(135deg, rgba(59,130,246,0.22), rgba(139,92,246,0.18));
    border-color: rgba(59,130,246,0.45);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59,130,246,0.15);
}
.try-btn .try-icon {
    font-size: 0.75rem;
    transition: transform 0.2s;
}
.try-btn:hover .try-icon {
    transform: scale(1.15);
}
.try-btn.active {
    background: linear-gradient(135deg, rgba(59,130,246,0.22), rgba(139,92,246,0.18));
    border-color: rgba(59,130,246,0.5);
}

/* The inline playground panel */
.try-editor {
    display: none;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    margin: -0.5rem 0 1.5rem;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}
.try-editor.open { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Toolbar at top of playground */
.try-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-active);
    border-bottom: 1px solid var(--border-subtle);
}

.try-tabs {
    display: flex;
    gap: 2px;
}

.try-tab {
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}
.try-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.try-tab.active {
    color: var(--text-primary);
    background: var(--bg-code);
    border-color: var(--border-strong);
}

.try-actions {
    display: flex;
    gap: 0.4rem;
}

.try-run-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.85rem;
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.try-run-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.try-reset-btn {
    padding: 0.38rem 0.7rem;
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}
.try-reset-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }

/* Editor + Output Split */
.try-split {
    display: flex;
    min-height: 220px;
    max-height: 400px;
}

.try-code-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    position: relative;
}

.try-code-pane .try-pane-content {
    display: none;
    flex: 1;
}
.try-code-pane .try-pane-content.active { display: flex; flex-direction: column; flex: 1; }

.try-textarea {
    flex: 1;
    width: 100%;
    background: var(--bg-code);
    color: #c9d1d9;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    border: none;
    padding: 0.85rem 1rem;
    resize: none;
    outline: none;
    tab-size: 4;
    -moz-tab-size: 4;
}
.try-textarea::placeholder { color: var(--text-muted); }
.try-textarea:focus {
    box-shadow: inset 0 0 0 1px rgba(59,130,246,0.3);
}

/* Output / Preview pane */
.try-output-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-width: 0;
}

.try-output-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-active);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.try-output-header .live-dot {
    width: 6px; height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.try-preview-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
}

/* Console output (for JS-only snippets) */
.try-console {
    flex: 1;
    background: var(--bg-code);
    color: #c9d1d9;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    padding: 0.85rem 1rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.try-console .log-line { margin-bottom: 0.15rem; }
.try-console .log-line.error { color: #f87171; }
.try-console .log-line.warn  { color: var(--accent-orange); }
.try-console .log-line.info  { color: var(--accent-blue); }

/* Responsive for inline playground */
@media (max-width: 700px) {
    .try-split { flex-direction: column; max-height: 500px; }
    .try-code-pane { border-right: none; border-bottom: 1px solid var(--border-subtle); min-height: 150px; }
    .try-output-pane { min-height: 150px; }
}

@media print {
    .try-btn, .try-editor { display: none !important; }
}

/* =============================================
   PRINT (defer to print.css for detailed rules)
   ============================================= */
@media print {
    .site-header, .sidebar, .lesson-nav, .copy-btn,
    .pdf-export-bar { display: none !important; }
    .content-area { margin-left: 0; }
    .lesson-container { max-width: 100%; padding: 0; }
}
