/* ─── Tokens ──────────────────────────────────────────────────────────────── */
:root {
    --blue:      #3B82F6;
    --blue-dark: #1D4ED8;
    --orange:    #F59E0B;
    --green:     #10B981;
    --bg:        #F0F9FF;
    --surface:   #FFFFFF;
    --text:      #1E293B;
    --muted:     #64748B;
    --radius:    12px;
    --shadow:    0 2px 12px rgba(0,0,0,.10);
    --touch:     48px; /* min touch target */
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Header ──────────────────────────────────────────────────────────────── */
.child-header {
    background: var(--blue);
    color: #fff;
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.child-logo { font-size: 1.4rem; font-weight: 800; letter-spacing: -.5px; }
.child-nav  { display: flex; gap: .5rem; }
.child-nav a {
    color: rgba(255,255,255,.8);
    font-weight: 600;
    padding: .4rem .9rem;
    border-radius: 999px;
    min-height: var(--touch);
    display: flex;
    align-items: center;
    transition: background .15s, color .15s;
}
.child-nav a.active,
.child-nav a:hover {
    background: rgba(255,255,255,.2);
    color: #fff;
}

/* ─── Main ────────────────────────────────────────────────────────────────── */
.child-main {
    flex: 1;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ─── Video Grid ──────────────────────────────────────────────────────────── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
@media (min-width: 480px) {
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (min-width: 900px) {
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

.video-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s, box-shadow .18s;
    -webkit-tap-highlight-color: transparent;
}
.video-card:active { transform: scale(.97); }
@media (hover: hover) {
    .video-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
}

.video-thumb-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #dde;
    overflow: hidden;
}
.video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.6);
    opacity: 0;
    background: rgba(0,0,0,.25);
    transition: opacity .15s;
}
.video-card:hover .play-overlay,
.video-card:focus .play-overlay { opacity: 1; }

/* Gruppen-Dot (oben rechts) */
.group-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.8);
}
.group-dot--grow_mindset { background: #10B981; }
.group-dot--interest     { background: #F59E0B; }
.group-dot--learning     { background: #3B82F6; }

.video-title {
    padding: .6rem .75rem .75rem;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Feed-Aktionen ───────────────────────────────────────────────────────── */
.feed-actions {
    display: flex;
    justify-content: center;
    margin: 2rem 0 1rem;
}
.btn-refresh {
    background: var(--orange);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: .8rem 2rem;
    border-radius: 999px;
    min-height: var(--touch);
    display: inline-flex;
    align-items: center;
    box-shadow: var(--shadow);
}

/* ─── Empty Feed ──────────────────────────────────────────────────────────── */
.empty-feed {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}
.empty-feed-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-feed h2   { font-size: 1.4rem; margin-bottom: .5rem; color: var(--text); }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.child-footer {
    background: #e2eeff;
    color: var(--muted);
    font-size: .75rem;
    text-align: center;
    padding: .6rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PLAYER
═══════════════════════════════════════════════════════════════════════════ */
.player-page {
    background: #0f0f1a;
    color: #fff;
}

.player-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .6rem 1rem;
    background: rgba(0,0,0,.4);
    position: sticky;
    top: 0;
    z-index: 100;
}
.back-btn {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    min-height: var(--touch);
    display: flex;
    align-items: center;
    padding: 0 .5rem;
    white-space: nowrap;
}
.player-title-bar {
    font-size: .9rem;
    color: rgba(255,255,255,.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-wrap {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 0;
}
#player-container {
    aspect-ratio: 16/9;
    width: 100%;
    background: #000;
}
#yt-player,
#yt-player iframe {
    width: 100% !important;
    height: 100% !important;
}

.player-meta {
    padding: 1rem;
    max-width: 900px;
    margin: 0 auto;
}
.player-video-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Nächstes Video */
.next-up { display: flex; align-items: center; gap: .75rem; }
.next-up-label {
    font-size: .8rem;
    color: rgba(255,255,255,.5);
    white-space: nowrap;
}
.next-up-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(255,255,255,.08);
    border-radius: 8px;
    padding: .5rem .75rem;
    flex: 1;
    min-height: var(--touch);
}
.next-up-link img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}
.next-up-link span {
    font-size: .85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Countdown-Overlay (wird via JS hinzugefügt) */
.next-countdown {
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    background: rgba(0,0,0,.85);
    color: #fff;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .9rem;
    display: flex;
    gap: .5rem;
    align-items: center;
    z-index: 200;
}
.next-countdown button {
    background: var(--orange);
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: 6px;
    padding: .3rem .7rem;
    cursor: pointer;
    min-height: 36px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH
═══════════════════════════════════════════════════════════════════════════ */
.child-main--search { max-width: 800px; }

.search-hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}
.search-hero h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.search-form { width: 100%; }
.search-input-wrap {
    display: flex;
    gap: .5rem;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow);
    padding: .4rem .4rem .4rem 1.25rem;
    max-width: 560px;
    margin: 0 auto;
}
.search-input-wrap input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    min-height: var(--touch);
}
.search-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0 1.2rem;
    font-size: 1.25rem;
    min-height: var(--touch);
    min-width: var(--touch);
    cursor: pointer;
    transition: background .15s;
}
.search-btn:hover { background: var(--blue-dark); }

.search-status {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 1.1rem;
}

/* Search cards – NOT klickbar */
.video-card--search { cursor: default; pointer-events: auto; }
.video-card--search:hover { transform: none; box-shadow: var(--shadow); }
.video-card--search:active { transform: none; }

.search-no-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: rgba(255,255,255,.9);
    background: rgba(0,0,0,.45);
    text-align: center;
    padding: .5rem;
    opacity: 0;
    transition: opacity .2s;
}
.video-card--search:hover .search-no-play { opacity: 1; }

.video-channel {
    padding: 0 .75rem .5rem;
    font-size: .75rem;
    color: var(--muted);
}

.btn-request {
    display: block;
    width: calc(100% - 1.5rem);
    margin: 0 .75rem .75rem;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .65rem;
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
    min-height: var(--touch);
    transition: background .15s;
}
.btn-request:hover   { background: #D97706; }
.btn-request:disabled{ background: var(--muted); cursor: default; }

/* Bestätigungsbox */
.request-confirm {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1rem;
}
.request-confirm-inner {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.confirm-icon { font-size: 3rem; }
.request-confirm-inner h3 { font-size: 1.4rem; margin: .5rem 0; }
.request-confirm-inner p  { color: var(--muted); margin-bottom: 1.5rem; line-height: 1.5; }
.btn-primary-lg {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .8rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    min-height: var(--touch);
}
