/*
 * spielformen.css - gemeinsames Stylesheet fuer den Bereich Spielformen & Übungen
 * (interaktive Sammlungen mit Spielfeld-Diagrammen + Info-Module). Familienfarbe:
 * Indigo, passend zur bereits vorhandenen Koordinations-Sammlung.
 */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;
    --secondary: #818cf8;
    --accent: #f59e0b;          /* einheitliche CTA-Farbe ueber alle Module */
    --team-a: #4f46e5;
    --team-b: #f59e0b;
    --text: #1f2937;
    --text-soft: #6b7280;
    --bg: #f8fafc;
    --border: #e5e7eb;
    --ok: #16a34a;
    --warn: #dc2626;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }

/* Kopf / Toolbar */
.editor-header {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; padding: 1rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.editor-header h1 { font-family: 'Poppins', sans-serif; font-size: 1.35rem; font-weight: 600; }
.editor-header .sub { font-size: 0.85rem; opacity: 0.9; font-weight: 300; }
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn {
    border: none; border-radius: 50px; padding: 0.6rem 1.2rem;
    font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; text-decoration: none; display: inline-block;
}
.btn-pdf { background: var(--accent); color: #fff; }
.btn-pdf:hover { background: #e88100; transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.5); }
.btn-ghost:hover { background: rgba(255,255,255,0.28); }
body.embed .editor-header { display: none; }

.ueb-hero img { display: block; width: 100%; height: 180px; object-fit: cover; }
@media (max-width: 600px) { .ueb-hero img { height: 120px; } }

.wrap { max-width: 980px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.intro { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 1.25rem; }

/* Altersfilter */
.filterbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.filterbar .flabel { font-weight: 600; font-size: 0.9rem; margin-right: 0.25rem; }
.age-pill {
    border: 1.5px solid var(--border); background: #fff; color: var(--text-soft);
    border-radius: 50px; padding: 0.35rem 0.9rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease;
}
.age-pill:hover { border-color: var(--primary); }
.age-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.result-note { font-size: 0.85rem; color: var(--text-soft); margin: 0.5rem 0 1.25rem; }

/* Legende */
.legend { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; font-size: 0.8rem; color: var(--text-soft); margin: 0.25rem 0 1rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend .dotA, .legend .dotB { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend .dotA { background: var(--team-a); }
.legend .dotB { background: var(--team-b); }

/* Übungs-Karte */
.ueb-card {
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    padding: 1.5rem 1.75rem; margin-bottom: 1.25rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
    position: relative; overflow: hidden;
}
.ueb-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.ueb-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.ueb-title { font-family: 'Poppins', sans-serif; font-size: 1.25rem; color: var(--primary); margin-bottom: 0.25rem; }
.ueb-tags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.35rem 0 0.5rem; }
.ueb-tag { background: var(--primary-soft); color: var(--primary-dark); border-radius: 50px; padding: 0.1rem 0.6rem; font-size: 0.72rem; font-weight: 600; }
.ueb-select { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.ueb-select input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }

/* Diagramm + Schritte */
.steps-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; margin: 1rem 0 1.25rem; }
@media (max-width: 620px) { .steps-grid { grid-template-columns: 1fr; } }
.step { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.step-img { background: #f1f5f9; display: flex; justify-content: center; padding: 0.5rem; }
.step-img svg { width: 100%; height: auto; max-height: 240px; }
.step-cap { padding: 0.55rem 0.7rem; }
.step-no { display: inline-block; background: var(--primary); color: #fff; border-radius: 50px; width: 1.4rem; height: 1.4rem; line-height: 1.4rem; text-align: center; font-size: 0.8rem; font-weight: 700; margin-right: 0.4rem; }
.step-t { font-weight: 600; font-size: 0.85rem; }
.step-d { font-size: 0.8rem; color: var(--text-soft); margin-top: 0.2rem; }

/* Beschreibung */
.ueb-desc { border-top: 1px solid var(--border); padding-top: 1rem; }
.ueb-desc h4 { font-family: 'Poppins', sans-serif; font-size: 0.95rem; color: var(--text); margin-bottom: 0.2rem; }
.ueb-desc p { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 0.7rem; }
.ueb-meta { font-size: 0.85rem; color: var(--text-soft); }
.ueb-meta strong { color: var(--text); }

/* ===== Info-Modul-Helfer (fuer Aufwaermen, Athletik) ===== */
.spf-h1 { font-family: 'Poppins', sans-serif; font-size: clamp(1.5rem, 4vw, 2rem); color: var(--primary-dark); margin-bottom: 0.6rem; }
.spf-lead { font-size: 1.02rem; color: var(--text-soft); margin-bottom: 1.5rem; max-width: 70ch; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem 1.75rem; margin-bottom: 1.25rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07); position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.card h2 { font-family: 'Poppins', sans-serif; font-size: 1.2rem; color: var(--primary-dark); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.card p { color: var(--text-soft); margin-bottom: 0.6rem; }
.card p:last-child { margin-bottom: 0; }
.spf-list { list-style: none; margin: 0.4rem 0 0.6rem; }
.spf-list li { position: relative; padding-left: 1.7rem; margin-bottom: 0.5rem; color: var(--text-soft); }
.spf-list li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.spf-list.dot li::before { content: '\2022'; color: var(--primary); font-size: 1.2rem; line-height: 1.2; }
.spf-list.check li::before { content: '\2713'; color: var(--ok); }
.spf-list.cross li::before { content: '\2715'; color: var(--warn); }
.spf-list strong { color: var(--text); }
.spf-callout { border-radius: 12px; padding: 1rem 1.25rem; margin: 1rem 0; border: 1px solid; }
.spf-callout-title { font-family: 'Poppins', sans-serif; font-weight: 600; display: block; margin-bottom: 0.3rem; }
.spf-callout p { margin: 0; font-size: 0.95rem; }
.spf-callout.is-info { background: var(--primary-soft); border-color: #c7d2fe; color: var(--primary-dark); }
.spf-callout.is-info p { color: #3730a3; }
.spf-callout.is-tip { background: #fffbeb; border-color: #fde68a; }
.spf-callout.is-tip p, .spf-callout.is-tip .spf-callout-title { color: #92400e; }
.spf-callout.is-alert { background: #fef2f2; border-color: #fecaca; }
.spf-callout.is-alert p, .spf-callout.is-alert .spf-callout-title { color: #991b1b; }
.spf-source { font-size: 0.8rem; color: var(--text-soft); margin-top: 0.75rem; }
.spf-source a { color: var(--primary-dark); }

@media print {
    @page { margin: 12mm; }
    body { background: #fff; }
    .editor-header, .toolbar, .filterbar, .result-note, .intro, .legend, .ueb-select, .no-print { display: none !important; }
    .wrap { max-width: none; padding: 0; }
    .ueb-card, .card { box-shadow: none; border: 1px solid #d1d5db; break-inside: avoid; page-break-inside: avoid; margin-bottom: 14px; }
    .ueb-card::before, .card::before { display: none; }
    .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .step-img svg { max-height: 200px; }
    .print-title { display: block !important; }
    .spf-callout { box-shadow: none; border: 1px solid #d1d5db; }
}
.print-title { display: none; }
body.printview { background: #fff; }

/* Embed-Modus */
body.embed { background: #fff; }
.embed-toolbar {
    position: sticky; top: 0; z-index: 6;
    display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
    padding: 0.75rem 1rem; background: #f8fafc; border-bottom: 1px solid var(--border);
}
.embed-toolbar .btn-ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--border); }
.embed-toolbar .btn-ghost:hover { border-color: var(--primary); background: var(--primary-soft); }
.embed-toolbar .btn-pdf { background: var(--accent); color: #fff; }
.embed-toolbar .btn-pdf:hover { background: #e88100; }
.embed-toolbar .sel-count { font-size: 0.85rem; color: var(--text-soft); font-weight: 600; }
