/* Admin-Bereich: schlicht, viel Weissraum, ruhiges Grid, siehe
   docs/prompts/02-admin-bereich.md. Kein Framework, reines CSS. */

:root {
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --accent: #2f5d50;
  --danger: #a3372a;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
}

.admin-brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.admin-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.admin-username {
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.flash {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.error {
  color: var(--danger);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.25rem 0 1rem;
}

.button,
button {
  display: inline-block;
  font: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-decoration: none;
}

button.danger,
.button.danger {
  background: var(--danger);
}

.link-button {
  background: none;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
}

.inline-form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 420px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.admin-form label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.admin-form input[type="text"],
.admin-form input[type="password"] {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-form button {
  margin-top: 1.25rem;
  align-self: flex-start;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.gallery-card .meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.gallery-card .slug {
  color: var(--muted);
  font-size: 0.8rem;
}

.card-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.upload-box,
.filter-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.filter-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.thumb-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.thumb-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.thumb-card figcaption {
  padding: 0.5rem 0.6rem 0;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.thumb-card .filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb-card .uploader {
  color: var(--muted);
}

.thumb-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem 0.75rem;
  gap: 0.5rem;
}

.thumb-actions button {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
}

/* Admin-Upload mit Warteschlange, gleiches Muster wie die Gaeste-Upload-
   Styles in public/gallery.css (dort ausfuehrlicher kommentiert). */

.upload-name-field {
  margin-bottom: 1.25rem;
  max-width: 320px;
}

.upload-name-field input[type="text"] {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  background: var(--bg-soft);
  margin-bottom: 1.25rem;
}

.dropzone p {
  margin: 0.25rem 0;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #fff;
}

.upload-summary {
  margin-bottom: 1.25rem;
}

.progress-overall {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.progress-bar {
  flex: 1;
  height: 0.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar.small {
  height: 0.4rem;
  width: 140px;
  flex: none;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

.upload-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.queue-filename {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-status {
  min-width: 90px;
  text-align: right;
}

.queue-status.ok {
  color: var(--accent);
}

.queue-status.error {
  color: var(--danger);
}

.upload-done {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.upload-failed-list {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}
