/* Design-Tokens
   Hintergrund:  #14171c (Slate, fast schwarz)
   Fläche:       #1c212b
   Text:         #e6e9ef
   Gedämpft:     #8892a0
   Akzent:       #45c2b8 (Teal - technisch, ruhig, kein Standard-Blau)
   Fehler:       #e8756b
   Schrift:      Systemschrift für Text, Monospace für Metadaten/Timestamps
*/

:root {
    --bg: #14171c;
    --surface: #1c212b;
    --surface-hover: #232a36;
    --text: #e6e9ef;
    --muted: #8892a0;
    --accent: #45c2b8;
    --accent-dim: #2c7c76;
    --error: #e8756b;
    --border: #2a3140;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-mark {
    color: var(--accent);
    margin-right: 6px;
}

.brand-logo {
    height: 24px;
    width: auto;
    display: block;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
}

.topnav a {
    color: var(--muted);
    text-decoration: none;
}

.topnav a:hover {
    color: var(--text);
}

.topnav-user {
    color: var(--accent);
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

.content {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 28px;
}

h1 {
    font-size: 1.6rem;
    margin: 0 0 24px;
}

h2 {
    font-size: 1.1rem;
    margin: 40px 0 16px;
    color: var(--muted);
    font-weight: 600;
}

/* Login */
.login-wrap {
    display: flex;
    justify-content: center;
    padding-top: 8vh;
}

.login-card, .card-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-card h1 {
    margin: 0 0 4px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.checkbox-label {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.checkbox-label input { width: auto; }

input[type="text"], input[type="password"], input[type="email"], textarea, select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
textarea:focus, select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.editor-form {
    margin: 0;
}

.editor-form select {
    padding: 6px 8px;
    font-size: 0.82rem;
}

.quota-row-form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quota-row-form input[type="text"] {
    flex: 1;
    min-width: 140px;
}

.quota-row-form input[type="number"] {
    width: 90px;
}

button {
    background: var(--accent);
    color: #0c1210;
    border: none;
    border-radius: 6px;
    padding: 11px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover { background: #57d2c8; }
button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.alert {
    background: rgba(232, 117, 107, 0.12);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.85rem;
    margin: 0 0 16px;
}

.alert-success {
    background: rgba(69, 194, 184, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* Empty state */
.empty-state {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 48px 24px;
    text-align: center;
}

.muted { color: var(--muted); }

/* Video grid (Teil 2) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.video-card {
    color: var(--text);
    text-decoration: none;
    display: block;
}

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.video-card:hover .video-thumb img {
    transform: scale(1.03);
}

.video-card:hover .video-thumb {
    border-color: var(--accent-dim);
}

.video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(12, 15, 20, 0.8);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.video-meta {
    padding: 10px 2px 0;
}

.video-title {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-player {
    width: 100%;
    max-height: 70vh;
    background: #000;
    border-radius: 8px;
    display: block;
}

/* Marker (Teil 2) */
.marker-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.marker-form input[type="text"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.9rem;
    flex: 1;
}

.marker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.marker-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}

.marker-list li span {
    flex: 1;
    font-size: 0.9rem;
}

.marker-list li form {
    margin: 0;
}

.marker-jump {
    background: var(--accent-dim);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
}

.marker-jump:hover { background: var(--accent); color: #0c1210; }

.marker-delete {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 6px 10px;
    font-weight: 400;
    font-size: 0.82rem;
}

/* Video-Katalog: Umbenennen */
.rename-form {
    display: flex;
    flex-direction: row;
    gap: 6px;
    margin: 0;
}

.rename-form input[type="text"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text);
    font-size: 0.82rem;
    width: 200px;
}

.rename-form button {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.marker-delete:hover { background: rgba(232, 117, 107, 0.12); color: var(--error); border-color: var(--error); }

/* Nutzer-Tabelle */
.user-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.user-table th, .user-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.user-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-table tr:last-child td { border-bottom: none; }

.mono {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    color: var(--muted);
    font-size: 0.82rem;
}

.thumb-preview {
    width: 72px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg);
    display: block;
}

.marker-drawing-preview {
    position: relative;
    width: 96px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg);
}

.marker-drawing-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.marker-drawing-preview svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.thumb-upload-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.thumb-upload-form input[type="file"] {
    font-size: 0.78rem;
    color: var(--muted);
    max-width: 160px;
}

.thumb-upload-form button {
    padding: 6px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Branding (Logo/Favicon in den Einstellungen) */
.branding-row {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.branding-row > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.branding-preview {
    max-height: 48px;
    max-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
}

.branding-preview-small {
    max-height: 32px;
    max-width: 32px;
}

/* Kommentare */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.comment-form textarea {
    resize: vertical;
}

.comment-form button {
    align-self: flex-start;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.comment-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.comment-author {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.88rem;
}

.comment-body {
    margin: 0 0 8px;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.comment-list li:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
