/* ─────────────────────────────────────────────────────────
   Atlas Sport Club — Mediathek Stylesheet
   Farbschema angelehnt an Vereins-Branding
   ───────────────────────────────────────────────────────── */

:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --border: #e3e3df;
    --border-strong: #cfcfc9;
    --text: #1a1a1a;
    --text-muted: #6b6b66;
    --primary: #c41e1e;          /* Atlas-Rot — anpassbar */
    --primary-dark: #9b1717;
    --accent: #1a1a1a;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --radius: 10px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 18px; }
.subtitle { margin: 0; font-size: 12px; color: var(--text-muted); }

.logo-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-circle.small { width: 36px; height: 36px; font-size: 12px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; color: var(--text-muted); }
.badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-admin { background: #fef3c7; color: #92400e; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary, .btn-ghost {
    border: none;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    font-family: inherit;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-ghost:hover { background: var(--bg); border-color: var(--border-strong); }

/* ── Container & Toolbar ────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ── Video-Grid ─────────────────────────────────────────── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.video-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f0f0eb;
    overflow: hidden;
}
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-overlay {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.play-overlay:hover { background: rgba(0,0,0,0.35); }

.play-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: var(--primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
}

.cat-pill {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    backdrop-filter: blur(4px);
}
.cat-karate    { background: rgba(254, 243, 199, 0.95); color: #854d0e; }
.cat-kickboxen { background: rgba(254, 226, 226, 0.95); color: #9b1c1c; }
.cat-yoga      { background: rgba(220, 252, 231, 0.95); color: #166534; }

.card-body { padding: 14px 16px 12px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 15px; margin-bottom: 4px; line-height: 1.3; }
.desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Admin-Aktionen ─────────────────────────────────────── */
.card-actions {
    display: flex;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.action-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.action-btn:hover {
    background: var(--bg);
    color: var(--text);
}
.action-btn.danger { margin-left: auto; }
.action-btn.danger:hover { background: #fef2f2; color: #b91c1c; }

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ── Login-Seite ───────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header .logo-circle { margin: 0 auto 14px; }
.login-header h1 { font-size: 22px; }

.login-box label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin: 16px 0 6px;
    font-weight: 500;
}
.login-box input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: border-color 0.15s;
}
.login-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 30, 0.1);
}
.login-box button { margin-top: 24px; }
.login-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Modal ─────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}
.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; }

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.modal-editor .modal-close {
    background: transparent;
    color: var(--text);
    top: 14px;
    right: 14px;
}
.modal-close:hover { background: rgba(0,0,0,0.8); color: white; }

/* Player */
.modal-player { max-width: 880px; padding: 0; overflow: hidden; }
.player-wrap {
    aspect-ratio: 16 / 9;
    background: #000;
}
.player-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-meta { padding: 20px 24px; }
.player-meta h2 { font-size: 18px; margin-bottom: 6px; }
.player-meta p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* Editor-Form */
.modal-editor { max-width: 520px; padding: 0; }
.modal-editor form { padding: 20px 24px 24px; }
.modal-editor label {
    display: block;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    margin: 14px 0 5px;
}
.modal-editor input[type="text"],
.modal-editor input[type="file"],
.modal-editor textarea,
.modal-editor select {
    width: 100%;
    padding: 9px 11px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: border-color 0.15s;
}
.modal-editor input:focus,
.modal-editor textarea:focus,
.modal-editor select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 30, 0.1);
}
.modal-editor textarea { resize: vertical; min-height: 70px; }
.modal-editor .hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .topbar-inner { padding: 12px 16px; }
    .container { padding: 20px 16px 40px; }
    .video-grid { grid-template-columns: 1fr; gap: 16px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .btn-primary { width: 100%; }
    .login-box { padding: 28px 24px; }
}
