/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0e0e10;
  --surface:    #1a1a1e;
  --surface-2:  #242428;
  --border:     #2e2e34;
  --text:       #f0f0f2;
  --text-muted: #888892;
  --accent:     #3b82f6;
  --accent-dim: #2563eb;
  --radius:     12px;
  --header-h:   60px;
  --filter-h:   52px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(14, 14, 16, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.btn-admin {
  margin-left: auto;
  flex-shrink: 0;
  padding: 7px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.btn-admin:hover { color: var(--text); border-color: var(--accent); }

/* ── Filter Bar ─────────────────────────────────────────────────────────── */
.filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  height: var(--filter-h);
  background: rgba(14, 14, 16, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.filter-bar-inner {
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.filter-pills-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.filter-pills-wrap::-webkit-scrollbar { display: none; }
.filter-search-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  transition: border-color 0.15s;
}
.filter-search-wrap:focus-within { border-color: var(--accent); }
.filter-search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.filter-search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  width: 160px;
}
.filter-search-wrap input::placeholder { color: var(--text-muted); }

.filter-pill {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-pill:hover { color: var(--text); border-color: #4a4a54; }
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── New Section ────────────────────────────────────────────────────────── */
.new-section {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 24px 24px;
}

.new-hero {
  position: relative;
  height: 210px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
}
.new-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.new-hero:hover .new-hero-bg { transform: scale(1.04); }

.new-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.55) 50%,
    rgba(0,0,0,0.15) 100%
  );
}
.new-hero-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 36px;
}
.new-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.new-hero-label {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.new-badge {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 100px;
}
.new-hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 20px;
}
.new-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: #fff;
  color: #0e0e10;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
  transition: background 0.15s, transform 0.1s;
}
.new-hero-btn:hover { background: rgba(255,255,255,0.88); transform: translateY(-1px); }


/* ── Gallery ────────────────────────────────────────────────────────────── */
.gallery {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border-color: #3e3e46;
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 5;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}
.card:hover .card-img { transform: scale(1.04); }

/* New badge */
.card-new-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
  z-index: 2;
  pointer-events: none;
}

/* Hover overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover .card-overlay { opacity: 1; }

.overlay-prompt {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255,255,255,0.85);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.overlay-copy-hint {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Card body */
.card-body { padding: 12px 14px; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.card-category {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  background: rgba(59,130,246,0.12);
  padding: 2px 8px;
  border-radius: 100px;
}
.card-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 100px;
}

/* Copied flash */
.card.copied { border-color: var(--accent) !important; }
.card.copied::after {
  content: '✓ Kopiert';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  animation: fadeInDown 0.2s ease;
}

/* Text-only card */
.card-no-img .card-body { padding: 16px; }
.card-no-img .card-prompt-preview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 50vh;
  color: var(--text-muted);
  text-align: center;
}
.empty-state p { font-size: 15px; }
.btn-add-first {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.btn-add-first:hover { text-decoration: underline; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.toast svg { color: #4ade80; }
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.2s;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.modal-backdrop.open .modal { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--border); }

.modal-prompt {
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  overflow-y: auto;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }

.btn-copy-modal {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-copy-modal:hover  { background: var(--accent-dim); }
.btn-copy-modal:active { transform: scale(0.97); }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeIn 0.3s ease backwards; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); padding: 16px 12px 60px; }
  .new-section { padding: 16px 12px 16px; }
  .new-hero { height: 170px; }
  .new-hero-content { padding: 0 24px; }
  .new-hero-label { font-size: 20px; }
  .header-inner { padding: 0 16px; }
  .filter-bar-inner { padding: 0 16px; }
  .filter-search-wrap input { width: 120px; }
}
@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .filter-search-wrap { display: none; }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-footer a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer a:hover { color: var(--text); }
.site-footer span { color: var(--border); font-size: 13px; }

/* ── Page Header (Neue Vorlagen) ─────────────────────────────────────────── */
.page-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  position: sticky;
  top: var(--header-h);
  z-index: 9;
}
.page-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.page-back:hover { color: var(--text); }
.page-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}
