/* ==============================================
   SongVote – Theme (dark, purple accent)
   Shared by all app pages
   ============================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --surface3: #1e1e2a;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text: #f0eeff;
  --text-muted: rgba(240,238,255,0.45);
  --accent: #7c6eff;
  --accent-glow:      rgba(124,110,255,0.25);
  --accent-dim:       rgba(124,110,255,0.12);
  --accent-border:    rgba(124,110,255,0.25);
  --accent-shimmer:   rgba(124,110,255,0.13);
  --accent-shimmer-2: rgba(80,60,200,0.08);
  --accent-focus:     rgba(124,110,255,0.05);
  --ok: #4ade80;
  --ok-bg: rgba(74,222,128,0.08);
  --ok-border: rgba(74,222,128,0.2);
  --err: #f87171;
  --err-bg: rgba(248,113,113,0.08);
  --err-border: rgba(248,113,113,0.2);
  --warn: #facc15;
  --warn-bg: rgba(250,204,21,0.08);
  --warn-border: rgba(250,204,21,0.25);
  --radius: 14px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 5%, var(--accent-shimmer) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 70%, var(--accent-shimmer-2) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  animation: fadeUp 0.4s ease both;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}

.logo-text {
  height: 14px;
  width: auto;
  display: block;
}

header h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

header h1 span { color: var(--accent); }

.header-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Badge (status) ── */
.badge {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Pill (info chip) ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pill.accent {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ── Status chips ── */
.status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.s-new      { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.s-approved { background: var(--ok-bg);            color: var(--ok); border: 1px solid var(--ok-border); }
.s-played   { background: rgba(167,139,250,0.1);   color: #a78bfa; border: 1px solid rgba(167,139,250,0.25); }
.s-rejected { background: var(--err-bg);           color: var(--err); border: 1px solid var(--err-border); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.card + .card { margin-top: 14px; }

/* ── Panel (centered narrow card) ── */
.panel {
  max-width: 680px;
  margin: 0 auto;
}

/* ── Lead text ── */
.lead {
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 65ch;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* ── Forms ── */
label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  margin-top: 1.1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input:not([type]),
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.25);
}

/* Option elements – Chromium (Edge/Chrome) supports direct styling */
option {
  background-color: var(--surface2);
  color: var(--text);
}

/* Custom dropdown arrow for select */
select {
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(240,238,255,0.35)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover,
input:not([type]):hover,
select:hover,
textarea:hover {
  border-color: var(--border-hover);
  background: var(--surface3);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--accent-focus);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 3px rgba(0,0,0,0.2);
}

textarea { resize: vertical; min-height: 88px; }

input::placeholder,
textarea::placeholder { color: rgba(240,238,255,0.28); }

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

input[readonly] { opacity: 0.55; cursor: default; }

.field { margin-bottom: 1.25rem; }

.hint {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Toolbar ── */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.select { width: auto; min-width: 200px; max-width: 100%; }
.search { width: auto; min-width: 260px; max-width: 100%; }

/* ── Messages ── */
.msg {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.msg.ok   { background: var(--ok-bg);   border: 1px solid var(--ok-border);   color: var(--ok); }
.msg.err  { background: var(--err-bg);  border: 1px solid var(--err-border);  color: var(--err); }
.msg.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn); }

/* ── Buttons ── */
.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.82rem; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #9287ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active  { transform: translateY(0); box-shadow: none; }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(248,113,113,0.08);
  color: var(--err);
  border: 1px solid rgba(248,113,113,0.25);
}

.btn-danger:hover {
  background: rgba(248,113,113,0.16);
  border-color: rgba(248,113,113,0.45);
}

/* ── Actions rows ── */
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
}

.bigActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
}

.bigActions a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── List ── */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Item (list card) ── */
.item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: border-color 0.2s;
}

.item:hover { border-color: var(--border-hover); }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  word-break: break-word;
  overflow-wrap: break-word;
}

.artist {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-word;
  overflow-wrap: break-word;
}

.comment {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.idpill { opacity: 0.6; }

/* ── Grid (2-col layout) ── */
.grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 700px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

/* ── Footer ── */
.foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

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

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

.beta-pill {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
}

/* ── Divider (login) ── */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 0.15rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Login page layout ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.5s ease both;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header .logo-mark {
  display: flex;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0 auto 1.25rem;
  object-fit: cover;
}

.login-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.login-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn-full { width: 100%; }

.login-hint {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Utilities ── */
.mono  { font-family: var(--font-mono); font-size: 0.82em; }
.small { font-size: 0.78rem; }
.muted { color: var(--text-muted); font-size: 0.85rem; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Spinner ── */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.spinner::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state .empty-icon {
  font-size: 2.25rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.empty-state .empty-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.empty-state .empty-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Mobile ── */
@media (max-width: 620px) {
  .wrap {
    padding: 1.25rem 1rem 3rem;
  }

  header {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }

  header h1 { font-size: 1.25rem; }

  .card { padding: 1.25rem; }

  .login-card { padding: 1.5rem; }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-right { justify-content: flex-start; }

  .select,
  .search {
    width: 100%;
    min-width: unset;
    font-size: 16px; /* iOS: verhindert auto-zoom bei focus */
  }

  .btn-sm {
    padding: 0.6rem 1rem;
    min-height: 44px; /* iOS: empfohlene Mindest-Tappgröße */
  }

  .item {
    padding: 0.875rem;
  }

  .row {
    align-items: flex-start;
  }

  .tiles {
    grid-template-columns: 1fr !important;
  }

  .actions {
    flex-wrap: wrap;
  }

  .meta {
    gap: 6px;
  }
}

@media (max-width: 440px) {
  .login-header h1 { font-size: 1.5rem; }
  .login-card { padding: 1.25rem; }
}
