/* Flappy Bird Lernstrecke - Hacker School Style */

:root {
    --hs-blue: #6dcff6;
    --hs-blue-dark: #2c8db8;
    --hs-navy: #2c3e50;
    --hs-navy-dark: #1f2d3a;
    --hs-pink: #e94e77;
    --hs-yellow: #ffd23f;
    --hs-green: #6abf69;
    --hs-bg: #f4f7fa;
    --hs-card: #ffffff;
    --hs-border: #d8e1ea;
    --hs-text: #2c3e50;
    --hs-text-muted: #6b7c8c;
    --hs-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
    --hs-shadow-lg: 0 8px 28px rgba(44, 62, 80, 0.16);
    --hs-radius: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
    background: var(--hs-bg);
    color: var(--hs-text);
    line-height: 1.55;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--hs-navy);
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.topbar-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
}

.topbar-title .accent { color: var(--hs-blue); }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
}

.topbar-user .code {
    background: rgba(109, 207, 246, 0.18);
    color: var(--hs-blue);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: "JetBrains Mono", "Consolas", monospace;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.btn-link {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-link:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
}

/* Layout */
.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 20px 120px;
}

/* Login screen */
.login-wrap {
    max-width: 540px;
    margin: 60px auto;
    padding: 0 20px;
}

.login-card {
    background: var(--hs-card);
    border-radius: var(--hs-radius);
    padding: 40px 36px;
    box-shadow: var(--hs-shadow-lg);
    text-align: center;
}

.login-logo {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    color: var(--hs-navy);
}

.login-card p.lead {
    color: var(--hs-text-muted);
    margin: 0 0 28px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid var(--hs-border);
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--hs-text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    font-family: inherit;
}

.tab.active {
    color: var(--hs-blue-dark);
    border-bottom-color: var(--hs-blue);
}

.field {
    text-align: left;
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--hs-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.field input:focus {
    outline: none;
    border-color: var(--hs-blue);
}

.field .hint {
    font-size: 0.85rem;
    color: var(--hs-text-muted);
    margin-top: 6px;
}

.btn {
    background: var(--hs-blue);
    color: white;
    border: none;
    padding: 13px 26px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: inline-block;
}

.btn:hover { background: var(--hs-blue-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--hs-navy);
    color: white;
}
.btn-primary:hover { background: var(--hs-navy-dark); }

.btn-block { width: 100%; }

.error-msg {
    background: #fde9ec;
    color: #b32b3e;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.92rem;
}

.success-msg {
    background: #e8f5e8;
    color: #2d7a2d;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.92rem;
}

.code-display {
    background: linear-gradient(135deg, var(--hs-blue), var(--hs-blue-dark));
    color: white;
    padding: 28px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
}

.code-display .label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.code-display .code {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: "JetBrains Mono", "Consolas", monospace;
}

/* Lesson page */
.lesson-header {
    margin-bottom: 24px;
}

.step-pill {
    display: inline-block;
    background: var(--hs-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.lesson-header h1 {
    font-size: 2rem;
    margin: 4px 0 6px;
    color: var(--hs-navy);
}

.lesson-header .subtitle {
    color: var(--hs-text-muted);
    font-size: 1.05rem;
    margin: 0;
}

.card {
    background: var(--hs-card);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--hs-shadow);
}

.card h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    color: var(--hs-navy);
}

.card h3 {
    margin: 18px 0 8px;
    font-size: 1.05rem;
    color: var(--hs-navy);
}

.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }

/* Info box variants */
.info-box {
    border-radius: 10px;
    padding: 16px 18px;
    margin: 16px 0;
    border-left: 4px solid;
}

.info-box.tip {
    background: #eaf6fd;
    border-color: var(--hs-blue);
}

.info-box.action {
    background: #fff8e1;
    border-color: var(--hs-yellow);
}

.info-box.check {
    background: #ecf7ec;
    border-color: var(--hs-green);
}

.info-box.heft {
    background: #fdeef1;
    border-color: var(--hs-pink);
}

.info-box .title {
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box.heft .title::before {
    content: "📓";
    font-size: 1.2rem;
}

.info-box.tip .title::before {
    content: "💡";
    font-size: 1.2rem;
}

.info-box.action .title::before {
    content: "👉";
    font-size: 1.2rem;
}

.info-box.check .title::before {
    content: "✅";
    font-size: 1.2rem;
}

/* Aufgabenliste mit Checkboxen */
.task-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.task-list li {
    background: #fafbfc;
    border: 1px solid var(--hs-border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.task-list li:hover { background: #f0f4f7; }

.task-list li.checked {
    background: #ecf7ec;
    border-color: var(--hs-green);
}

.task-list li.checked .task-text { text-decoration: line-through; opacity: 0.7; }

.task-list input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--hs-green);
    cursor: pointer;
}

.task-text { flex: 1; }

/* Screenshot */
.screenshot {
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--hs-border);
    background: white;
    box-shadow: var(--hs-shadow);
}

.screenshot img { width: 100%; }

.screenshot .caption {
    background: #f5f8fa;
    padding: 8px 14px;
    font-size: 0.88rem;
    color: var(--hs-text-muted);
    border-top: 1px solid var(--hs-border);
}

.screenshot.small {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* Hefter Notiz Eingabe */
.heft-note {
    width: 100%;
    min-height: 90px;
    padding: 12px;
    border: 2px dashed var(--hs-pink);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    margin-top: 8px;
}

.heft-note:focus {
    outline: none;
    border-style: solid;
}

/* Navigation */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--hs-border);
    padding: 14px 20px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 40;
}

.nav-inner {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-nav {
    background: var(--hs-navy);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-nav:hover:not(:disabled) { background: var(--hs-navy-dark); }
.btn-nav:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-nav.next { background: var(--hs-blue); }
.btn-nav.next:hover:not(:disabled) { background: var(--hs-blue-dark); }

.progress-info {
    flex: 1;
    text-align: center;
    color: var(--hs-text-muted);
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    max-width: 240px;
    height: 6px;
    background: var(--hs-border);
    border-radius: 3px;
    margin: 4px auto 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--hs-blue);
    transition: width 0.3s ease;
}

/* MakeCode Link Box */
.makecode-box {
    background: linear-gradient(135deg, #ffffff, #f0f7fc);
    border: 2px solid var(--hs-blue);
    border-radius: var(--hs-radius);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.makecode-box h3 {
    margin: 0 0 8px;
    color: var(--hs-blue-dark);
}

.makecode-box .btn {
    margin-top: 8px;
}

.makecode-box .url {
    font-family: "JetBrains Mono", "Consolas", monospace;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--hs-border);
    display: inline-block;
    margin: 8px 0;
    font-size: 0.9rem;
}

/* Save indicator */
.save-indicator {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--hs-green);
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.save-indicator.error { background: var(--hs-pink); }

/* Tab Hinweis */
.tab-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8e1;
    border: 1px solid #ffd23f;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.tab-hint .icon {
    font-size: 1.5rem;
}

/* Steckbrief / Übersicht */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.overview-grid .item {
    background: #f5f8fa;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--hs-border);
}

.overview-grid .item .num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--hs-blue-dark);
    display: block;
}

/* Code Hilfe (kleine Boxen die Programmierblöcke beschreiben) */
.block-hint {
    display: inline-block;
    background: #f0f4f7;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.92em;
    font-family: "JetBrains Mono", "Consolas", monospace;
    color: var(--hs-navy);
}

/* Responsive */
@media (max-width: 640px) {
    .container { padding: 18px 14px 130px; }
    .lesson-header h1 { font-size: 1.5rem; }
    .card { padding: 18px; }
    .login-card { padding: 28px 22px; }
    .btn-nav { padding: 10px 16px; font-size: 0.95rem; }
    .topbar { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .topbar-title { font-size: 1rem; }
}

/* Print: Hefter Druckansicht */
@media print {
    .topbar, .nav-bar, .save-indicator { display: none !important; }
    .container { padding: 0; max-width: 100%; }
    .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
}
