/* =====================================================================
   DaJan Music – Wunschbox
   Gemeinsames Stylesheet fuer oeffentliche Seite und Admin.
   Dunkles, ruhiges Premium-Design ohne Framework.
   ===================================================================== */

:root {
  --bg:            #08080d;
  --bg-soft:       #0e0e17;
  --surface:       rgba(255, 255, 255, 0.032);
  --surface-2:     rgba(255, 255, 255, 0.055);
  --line:          rgba(255, 255, 255, 0.09);
  --line-strong:   rgba(255, 255, 255, 0.16);

  --text:          #eceaf5;
  --text-soft:     #a5a2b8;
  --text-dim:      #6f6c85;

  --accent:        #8b6cff;
  --accent-soft:   #b39bff;
  --accent-2:      #ff5fa2;

  --ok:            #43d6a0;
  --warn:          #f5b544;
  --err:           #ff6b7d;

  --radius:        18px;
  --radius-sm:     12px;
  --shadow:        0 24px 60px -28px rgba(0, 0, 0, 0.9);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(900px 480px at 50% -12%, rgba(139, 108, 255, 0.16), transparent 70%),
    radial-gradient(700px 420px at 92% 8%, rgba(255, 95, 162, 0.09), transparent 72%);
  background-attachment: fixed;
}

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(560px 320px at 50% 100%, rgba(139, 108, 255, 0.07), transparent 70%);
  z-index: 0;
}

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

/* ---------------------------------------------------------------- */
/* Layout                                                            */
/* ---------------------------------------------------------------- */

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.wrap-wide { max-width: 1180px; padding-top: 26px; }

/* ---------------------------------------------------------------- */
/* Hero (oeffentliche Seite)                                         */
/* ---------------------------------------------------------------- */

.hero { text-align: center; margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 12vw, 3.4rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.hero-title .accent {
  background: linear-gradient(100deg, var(--accent-soft) 5%, var(--accent) 45%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text {
  margin: 0 auto;
  max-width: 42ch;
  color: var(--text-soft);
  font-size: 1rem;
}

/* ---------------------------------------------------------------- */
/* Cards                                                             */
/* ---------------------------------------------------------------- */

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  margin-bottom: 18px;
}

.card-title {
  margin: 0 0 16px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* ---------------------------------------------------------------- */
/* Formular                                                          */
/* ---------------------------------------------------------------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

input::placeholder { color: var(--text-dim); }

input:focus {
  outline: none;
  border-color: rgba(139, 108, 255, 0.7);
  background: rgba(0, 0, 0, 0.5);
}

.form-hint {
  margin: 4px 0 18px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  color: #fff;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(100deg, var(--accent) 0%, #6f4ff0 55%, var(--accent-2) 190%);
  border-color: transparent;
  box-shadow: 0 12px 30px -14px rgba(139, 108, 255, 0.9);
}

.feedback {
  margin: 16px 0 0;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.feedback.is-ok    { border-color: rgba(67, 214, 160, 0.45); color: #b9f2dd; }
.feedback.is-warn  { border-color: rgba(245, 181, 68, 0.45); color: #ffe1ab; }
.feedback.is-error { border-color: rgba(255, 107, 125, 0.45); color: #ffc2ca; }

/* ---------------------------------------------------------------- */
/* Eigene Wuensche                                                   */
/* ---------------------------------------------------------------- */

.mine-list { list-style: none; margin: 0; padding: 0; }

.mine-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.mine-item:first-child { border-top: none; }

.mine-pos {
  flex: 0 0 auto;
  min-width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(139, 108, 255, 0.14);
  border: 1px solid rgba(139, 108, 255, 0.3);
  font-weight: 750;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.mine-pos.is-done   { background: rgba(67, 214, 160, 0.12); border-color: rgba(67, 214, 160, 0.32); font-size: 1.2rem; }
.mine-pos.is-gone   { background: rgba(255, 255, 255, 0.05); border-color: var(--line); color: var(--text-dim); }

.mine-body { min-width: 0; }
.mine-song { font-weight: 600; overflow-wrap: anywhere; }
.mine-artist { font-size: 0.86rem; color: var(--text-soft); overflow-wrap: anywhere; }
.mine-state { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.mine-hint { margin: 14px 0 0; font-size: 0.78rem; color: var(--text-dim); }

.card-closed { text-align: center; }
.closed-title { margin: 0 0 8px; font-size: 1.2rem; }
.closed-text { margin: 0; color: var(--text-soft); }

.foot {
  margin-top: 28px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- */
/* Admin                                                             */
/* ---------------------------------------------------------------- */

.admin-bar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 18, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
}

.admin-brand { font-weight: 750; letter-spacing: -0.01em; }
.admin-brand span { color: var(--text-dim); font-weight: 500; }
.admin-bar .spacer { flex: 1 1 auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
}

.pill b { color: var(--text); font-variant-numeric: tabular-nums; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); }
.dot.is-open   { background: var(--ok);  box-shadow: 0 0 0 4px rgba(67, 214, 160, 0.16); }
.dot.is-closed { background: var(--err); box-shadow: 0 0 0 4px rgba(255, 107, 125, 0.16); }

.btn-inline {
  width: auto;
  padding: 10px 18px;
  font-size: 0.88rem;
}

.inline-form { margin: 0; }

.btn-ghost { background: var(--surface); }
.btn-ok    { background: rgba(67, 214, 160, 0.15);  border-color: rgba(67, 214, 160, 0.4);  color: #b9f2dd; }
.btn-warn  { background: rgba(245, 181, 68, 0.14);  border-color: rgba(245, 181, 68, 0.4);  color: #ffe1ab; }
.btn-err   { background: rgba(255, 107, 125, 0.13); border-color: rgba(255, 107, 125, 0.38); color: #ffc2ca; }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Queue-Eintraege */

.queue-list { list-style: none; margin: 0; padding: 0; }

.queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 16px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.028);
  cursor: grab;
}

.queue-item.is-next {
  border-color: rgba(139, 108, 255, 0.5);
  background: rgba(139, 108, 255, 0.08);
}

.queue-item.is-dragging { opacity: 0.4; }
.queue-item.is-over     { border-color: var(--accent-soft); }

.q-pos {
  grid-row: 1 / span 3;
  align-self: start;
  min-width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.queue-item.is-next .q-pos {
  background: rgba(139, 108, 255, 0.2);
  border-color: rgba(139, 108, 255, 0.45);
}

.q-title {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.q-artist { color: var(--accent-soft); font-size: 1rem; overflow-wrap: anywhere; }

.q-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.q-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.q-actions .btn {
  width: auto;
  flex: 1 1 120px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.q-actions .btn-move {
  flex: 0 0 auto;
  width: 52px;
  min-width: 52px;
  padding: 12px 0;
  font-size: 1.05rem;
}

/* Verlauf */

.hist-list { list-style: none; margin: 0; padding: 0; }

.hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.hist-item:first-child { border-top: none; }

.tag {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
}

.tag.played  { background: rgba(67, 214, 160, 0.14);  border-color: rgba(67, 214, 160, 0.38);  color: #9fe9cd; }
.tag.skipped { background: rgba(245, 181, 68, 0.14);  border-color: rgba(245, 181, 68, 0.38);  color: #ffdb9e; }
.tag.deleted { background: rgba(255, 107, 125, 0.12); border-color: rgba(255, 107, 125, 0.34); color: #ffb3bd; }

.hist-body { flex: 1 1 auto; min-width: 0; }
.hist-song { font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.hist-meta { font-size: 0.76rem; color: var(--text-dim); }

.btn-restore {
  width: auto;
  flex: 0 0 auto;
  padding: 7px 12px;
  font-size: 0.78rem;
  background: var(--surface-2);
}

.empty {
  padding: 26px 4px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(18, 18, 28, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  max-width: min(92vw, 480px);
  text-align: center;
}

.toast.is-error { border-color: rgba(255, 107, 125, 0.5); color: #ffc2ca; }

/* Login */

.login-wrap {
  max-width: 380px;
  margin: 0 auto;
  padding: 12vh 20px 40px;
}

.login-title { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -0.02em; }
.login-sub   { margin: 0 0 22px; color: var(--text-soft); font-size: 0.92rem; }

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