/* ===== PyAcademy Shared Styles ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --blue: #0071e3;
    --blue-hover: #0077ED;
    --blue-light: #147CE5;
    --gray-100: #f5f5f7;
    --gray-200: #e8e8ed;
    --gray-300: #d2d2d7;
    --gray-400: #86868b;
    --gray-500: #6e6e73;
    --dark: #1d1d1f;
    --white: #ffffff;
    --python-blue: #306998;
    --python-yellow: #FFD43B;
    --green: #34C759;
    --orange: #FF9500;
    --purple: #AF52DE;
    --pink: #FF2D55;
    --red: #FF3B30;
    --teal: #5AC8FA;
    --indigo: #5856D6;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    color: var(--dark);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ===== NAV ===== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    height: 48px;
    display: flex; align-items: center; justify-content: center;
}
.nav-inner {
    max-width: 1200px; width: 100%; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-size: 18px; font-weight: 700; color: var(--dark);
    text-decoration: none; display: flex; align-items: center; gap: 8px;
    letter-spacing: -0.03em;
}
.nav-logo-icon {
    width: 26px; height: 26px;
    background: linear-gradient(135deg, var(--python-blue) 50%, var(--python-yellow) 50%);
    border-radius: 7px; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px; font-weight: 800;
}
.nav-links { display: flex; gap: 24px; list-style: none; align-items: center; }
.nav-links a {
    font-size: 13px; color: var(--dark); text-decoration: none;
    opacity: 0.7; transition: opacity 0.2s; font-weight: 500;
}
.nav-links a:hover { opacity: 1; }
.nav-cta {
    background: var(--blue) !important; color: white !important;
    padding: 5px 14px; border-radius: 980px; opacity: 1 !important;
    font-size: 12px !important; transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--blue-hover) !important; }
.back-link {
    font-size: 13px; color: var(--gray-400) !important; display: flex; align-items: center; gap: 4px;
}
.back-link::before { content: '←'; }

/* ===== HERO ===== */
.course-hero {
    min-height: 60vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 120px 24px 80px; position: relative; overflow: hidden;
}
.course-hero::before {
    content: ''; position: absolute; inset: 0;
    opacity: 0.06; pointer-events: none;
}
.course-hero .badge {
    font-size: 11px; font-weight: 600; padding: 4px 12px;
    border-radius: 980px; margin-bottom: 16px;
    display: inline-block;
}
.course-hero h1 {
    font-size: clamp(36px, 6vw, 64px); font-weight: 800;
    letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 16px;
}
.course-hero .subtitle {
    font-size: 18px; color: var(--gray-400); max-width: 600px;
    line-height: 1.5; margin-bottom: 32px;
}
.course-hero .meta-row {
    display: flex; gap: 24px; flex-wrap: wrap; justify-content: center;
    font-size: 14px; color: var(--gray-500);
}
.course-hero .meta-row span {
    display: flex; align-items: center; gap: 6px;
}

/* ===== CHAPTERS ===== */
.chapters-section {
    padding: 80px 24px; max-width: 900px; margin: 0 auto;
}
.chapters-section .sec-header {
    text-align: center; margin-bottom: 48px;
}
.chapters-section .sec-eyebrow {
    font-size: 14px; font-weight: 600; color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px;
}
.chapters-section .sec-title {
    font-size: clamp(28px, 4vw, 44px); font-weight: 800;
    letter-spacing: -0.03em;
}
.chapter-list { display: flex; flex-direction: column; gap: 2px; }
.chapter-item {
    display: flex; align-items: center; gap: 20px;
    padding: 20px 24px; border-radius: 12px;
    transition: all 0.2s; cursor: default;
}
.chapter-item:hover { background: var(--gray-100); }
.chapter-num {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: white; flex-shrink: 0;
}
.chapter-info { flex: 1; }
.chapter-info h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.chapter-info p { font-size: 13px; color: var(--gray-400); margin-top: 2px; }
.chapter-duration {
    font-size: 13px; color: var(--gray-400); flex-shrink: 0;
}

/* ===== PLAYGROUND ===== */
.playground-section {
    padding: 80px 24px; background: var(--gray-100);
}
.playground-inner { max-width: 1200px; margin: 0 auto; }
.playground-inner .sec-header { text-align: center; margin-bottom: 40px; }
.playground-inner .sec-eyebrow {
    font-size: 14px; font-weight: 600; color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px;
}
.playground-inner .sec-title {
    font-size: clamp(28px, 4vw, 44px); font-weight: 800;
    letter-spacing: -0.03em;
}
.play-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.editor-panel {
    background: #1d1d1f; border-radius: 16px; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.editor-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.editor-bar .code-dots { display: flex; gap: 7px; }
.editor-bar .code-dots span { width: 11px; height: 11px; border-radius: 50%; }
.editor-bar .code-dots span:nth-child(1) { background: #ff5f57; }
.editor-bar .code-dots span:nth-child(2) { background: #febc2e; }
.editor-bar .code-dots span:nth-child(3) { background: #28c840; }
.editor-bar-title { font-size: 12px; color: rgba(255,255,255,0.35); font-weight: 500; }
.run-btn {
    background: var(--blue); color: white; border: none;
    padding: 5px 14px; border-radius: 980px; font-size: 12px;
    font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.run-btn:hover { background: var(--blue-hover); }
.run-btn:active { transform: scale(0.96); }
.code-editor {
    width: 100%; min-height: 340px; background: transparent; border: none;
    color: #e8e8ed; font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
    font-size: 13px; line-height: 1.65; padding: 16px;
    resize: vertical; outline: none; tab-size: 4;
}
.output-panel {
    background: white; border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.06); overflow: hidden;
    display: flex; flex-direction: column;
}
.output-bar {
    padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 12px; font-weight: 600; color: var(--gray-400);
    display: flex; align-items: center; gap: 8px;
}
.output-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.output-content {
    flex: 1; padding: 16px;
    font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
    font-size: 13px; line-height: 1.65; color: var(--dark);
    white-space: pre-wrap; min-height: 340px; overflow-y: auto;
}
.output-content .err { color: var(--red); }
.output-content .ok { color: var(--green); }

/* ===== CTA ===== */
.cta-section {
    padding: 80px 24px; text-align: center;
    background: linear-gradient(180deg, var(--gray-100) 0%, #e8e8ed 100%);
}
.cta-section h2 {
    font-size: clamp(28px, 4vw, 44px); font-weight: 800;
    letter-spacing: -0.03em; margin-bottom: 12px;
}
.cta-section p { font-size: 16px; color: var(--gray-400); margin-bottom: 28px; }
.btn-p {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--blue); color: white; padding: 12px 28px;
    border-radius: 980px; font-size: 16px; font-weight: 500;
    text-decoration: none; transition: all 0.2s; border: none; cursor: pointer;
    font-family: inherit;
}
.btn-p:hover { background: var(--blue-hover); transform: scale(1.02); }
.btn-s {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; color: var(--blue); padding: 12px 28px;
    border-radius: 980px; font-size: 16px; font-weight: 500;
    text-decoration: none; transition: all 0.2s; border: none; cursor: pointer;
    font-family: inherit;
}
.btn-s:hover { text-decoration: underline; }

/* ===== FOOTER ===== */
.footer {
    padding: 32px 24px; background: var(--gray-100);
    border-top: 1px solid rgba(0,0,0,0.06);
    text-align: center;
}
.footer span { font-size: 13px; color: var(--gray-400); }

/* ===== SCROLL ANIMATIONS ===== */
.fade-up {
    opacity: 0; transform: translateY(24px);
    transition: all 0.7s cubic-bezier(0.16,1,0.3,1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    position: fixed; top: 48px; left: 0; height: 2px;
    background: linear-gradient(90deg, var(--python-blue), var(--python-yellow));
    z-index: 999; transition: width 0.1s; width: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .play-grid { grid-template-columns: 1fr; }
    .chapter-item { flex-direction: column; text-align: center; gap: 8px; }
    .chapter-duration { display: none; }
}
