/* ============================================================
   Kamera-Portal – modernes, responsives Design (ohne Framework)
   ============================================================ */
:root {
    --bg: #0f1419;
    --panel: #1a2129;
    --panel-2: #232c36;
    --text: #e6edf3;
    --muted: #8b98a5;
    --accent: #3b82f6;
    --accent-h: #2563eb;
    --danger: #ef4444;
    --ok: #22c55e;
    --radius: 10px;
}

* { box-sizing: border-box; }

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

.container { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.5rem; margin: 0.5rem 0 1rem; }
.muted { color: var(--muted); }

/* --- Navigation --- */
.topnav {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 0.75rem 1.5rem;
    background: var(--panel);
    border-bottom: 1px solid #2d3742;
}
.topnav .brand { font-weight: 700; }
.topnav a { color: var(--text); text-decoration: none; opacity: 0.85; }
.topnav a:hover { opacity: 1; color: var(--accent); }
.topnav .spacer { flex: 1; }
.topnav .username { color: var(--muted); font-size: 0.9rem; }

/* --- Formulare --- */
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
input, select, button {
    font: inherit; color: var(--text);
    background: var(--panel-2);
    border: 1px solid #37424e;
    border-radius: var(--radius);
    padding: 0.55rem 0.75rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn { cursor: pointer; transition: background 0.15s; }
.btn:hover { background: #2d3742; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-h); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }

.alert {
    padding: 0.75rem 1rem; border-radius: var(--radius);
    background: var(--panel-2); border: 1px solid #37424e;
}
.alert.error { border-color: var(--danger); color: #fca5a5; }
.alert.success { border-color: var(--ok); color: #86efac; }

/* --- Login --- */
.login-box {
    max-width: 380px; margin: 8vh auto;
    background: var(--panel); padding: 2rem;
    border-radius: var(--radius); border: 1px solid #2d3742;
}
.login-box h1 { text-align: center; }
.login-box input { width: 100%; margin-bottom: 1rem; }
.login-box button { width: 100%; }

/* --- Filterleiste --- */
.filterbar {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: end;
    background: var(--panel); padding: 1rem;
    border-radius: var(--radius); border: 1px solid #2d3742;
    margin-bottom: 1rem;
}
.quickbtns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.quickbtns .btn { padding: 0.45rem 0.7rem; font-size: 0.85rem; }

/* --- Galerie-Grid --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.card {
    margin: 0; background: var(--panel);
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid #2d3742;
}
.card img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    display: block; cursor: pointer; transition: transform 0.2s;
}
.card img:hover { transform: scale(1.03); }
.card figcaption {
    padding: 0.4rem 0.6rem; font-size: 0.78rem; color: var(--muted);
}

/* --- Lightbox --- */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0, 0, 0, 0.92);
    display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 6px; }
.lightbox p {
    position: absolute; bottom: 1rem; left: 0; right: 0;
    text-align: center; color: var(--muted);
}
.lb-btn {
    position: absolute; background: rgba(255, 255, 255, 0.08);
    border: none; color: #fff; font-size: 1.6rem;
    width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

/* --- Tabellen (Admin, Videoliste) --- */
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 0.6rem 0.9rem; text-align: left; border-bottom: 1px solid #2d3742; font-size: 0.9rem; }
th { color: var(--muted); font-weight: 600; background: var(--panel-2); }

.badge { padding: 0.15rem 0.55rem; border-radius: 99px; font-size: 0.78rem; }
.badge.pending    { background: #78350f; color: #fcd34d; }
.badge.processing { background: #1e3a8a; color: #93c5fd; }
.badge.done       { background: #14532d; color: #86efac; }
.badge.error      { background: #7f1d1d; color: #fca5a5; }

/* --- Panels / Formular-Karten --- */
.panel {
    background: var(--panel); border: 1px solid #2d3742;
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.form-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

video { width: 100%; max-width: 900px; border-radius: var(--radius); }

@media (max-width: 640px) {
    .container { padding: 1rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .topnav { flex-wrap: wrap; gap: 0.6rem; }
}
