/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg-base:     #0a0a0a;
  --bg-card:     #141414;
  --bg-card-alt: #1e1e1e;
  --accent-from: #7B3FF5;
  --accent-to:   #F0287A;
  --text:        #ffffff;
  --muted:       #888888;
  --label:       #aaaaaa;
  --border:      #2a2a2a;
  --radius:      14px;
  --font:        'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* ── Guest Layout ───────────────────────────────────────── */
.guest-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hero section with concert background */
.hero-section {
  position: relative;
  background-color: var(--bg-base);
  background-image:
    url('../images/bg-concert.jpg'),
    radial-gradient(ellipse at 25% 0%, rgba(100, 40, 210, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 0%, rgba(210, 30, 100, 0.4) 0%, transparent 55%);
  background-size: cover, auto, auto;
  background-position: center top, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  padding: 44px 24px 64px;
  text-align: center;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(10, 10, 10, 0.6) 55%,
    rgba(10, 10, 10, 1) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
}

/* Logo */
.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.logo-icon-text {
    width: 50%;
    object-fit: contain;
}
.logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.logo-brand {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #fff;
}

.logo-sub {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.6em;
  color: var(--accent-from);
}
.logo-sub-gradient {
    background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Headline */
.headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  margin-bottom: 20px;
}

.headline-white,
.headline-gradient {
  font-size: clamp(3.4rem, 15vw, 5.8rem);
  font-weight: 900;
  display: block;
  letter-spacing: -0.01em;
}

.headline-white {
  color: #fff;
}

.headline-gradient {
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.headline-divider {
  width: 56px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  margin: 16px auto 18px;
  border-radius: 2px;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--label);
  line-height: 1.65;
  text-align: center;
}

/* Form section */
.form-section {
  flex: 1;
  background: var(--bg-base);
  padding: 32px 20px 28px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* Confirmation banners */
.confirm-banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.9rem;
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.55;
}

.confirm-success {
  background: rgba(123, 63, 245, 0.15);
  border: 1px solid rgba(123, 63, 245, 0.4);
  color: #c4a8ff;
}

.confirm-info {
  background: rgba(240, 40, 122, 0.1);
  border: 1px solid rgba(240, 40, 122, 0.35);
  color: #ffadd0;
}

/* Form fields */
.field-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.field-group:focus-within {
  border-color: rgba(123, 63, 245, 0.6);
}

.field-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  color: var(--label);
  margin-bottom: 8px;
}

.field-input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  padding: 0;
}

.field-input::placeholder {
  color: #3a3a3a;
}

.field-error {
  display: block;
  color: #ff6b6b;
  font-size: 0.8rem;
  margin-top: 6px;
}

/* Submit button */
.btn-submit {
  display: block;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 19px 24px;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn-submit:hover  { opacity: 0.92; }
.btn-submit:active { opacity: 0.82; transform: scale(0.99); }

/* Inactive state (no active event) */
.inactive-state {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 24px;
  background-image:
    radial-gradient(ellipse at 25% 0%, rgba(100, 40, 210, 0.3) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 0%, rgba(210, 30, 100, 0.2) 0%, transparent 55%);
}

.inactive-message {
  font-size: 1.05rem;
  color: var(--muted);
  text-align: center;
}

/* ── Now Playing Strip ──────────────────────────────────── */
.now-playing-strip {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.now-playing-strip[hidden] { display: none; }

.np-text {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.np-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.np-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Waveform animation */
.waveform {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  flex-shrink: 0;
}

.waveform span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--accent-from), var(--accent-to));
  animation: wave 1.2s ease-in-out infinite;
}

.waveform span:nth-child(1) { height: 40%; animation-delay: 0s; }
.waveform span:nth-child(2) { height: 80%; animation-delay: 0.2s; }
.waveform span:nth-child(3) { height: 60%; animation-delay: 0.4s; }
.waveform span:nth-child(4) { height: 90%; animation-delay: 0.1s; }
.waveform span:nth-child(5) { height: 50%; animation-delay: 0.3s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.25); }
}

/* ── Admin Styles ───────────────────────────────────────── */
.admin-body {
  background: #0d0d0d;
}

.admin-header {
  background: #111111;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.admin-nav {
  display: flex;
  gap: 24px;
  font-size: 0.875rem;
}

.admin-nav a {
  color: var(--label);
  transition: color 0.15s;
}

.admin-nav a:hover { color: var(--text); }

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* Admin login */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
}

.admin-brand-block {
  text-align: center;
  margin-bottom: 32px;
}

.admin-brand-name {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.admin-brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.admin-alert {
  background: rgba(240, 40, 122, 0.12);
  border: 1px solid rgba(240, 40, 122, 0.3);
  color: #ffadd0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.admin-field {
  margin-bottom: 16px;
}

.admin-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--label);
  margin-bottom: 6px;
}

.admin-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.admin-input:focus {
  border-color: var(--accent-from);
}

.admin-input::placeholder {
  color: #444;
}

.btn-admin-primary {
  width: 100%;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}

.btn-admin-primary:hover { opacity: 0.9; }

/* Admin dashboard */
.admin-dashboard { }

.admin-section {
  margin-bottom: 48px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.admin-section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.queue-count {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}

.admin-create-form {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.admin-create-form .admin-input {
  flex: 1;
  min-width: 200px;
}

.btn-admin-secondary {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s;
}

.btn-admin-secondary:hover { border-color: var(--accent-from); }

.admin-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 16px 0;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #111;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #181818;
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td {
  background: #111;
}

.admin-table .row-active td {
  background: rgba(123, 63, 245, 0.05);
}

.td-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

/* Small action buttons */
.btn-sm {
  display: inline-block;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-activate   { background: rgba(123,63,245,0.18); color: #c4a8ff; border: 1px solid rgba(123,63,245,0.4); }
.btn-activate:hover   { background: rgba(123,63,245,0.32); }
.btn-deactivate { background: rgba(100,100,100,0.12); color: var(--muted); border: 1px solid var(--border); }
.btn-deactivate:hover { background: rgba(100,100,100,0.22); }

.btn-play { background: rgba(123,63,245,0.18); color: #c4a8ff; border: 1px solid rgba(123,63,245,0.35); }
.btn-play:hover { background: rgba(123,63,245,0.32); }
.btn-done { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.28); }
.btn-done:hover { background: rgba(34,197,94,0.22); }
.btn-skip { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.btn-skip:hover { background: rgba(239,68,68,0.2); }

/* Status badges */
.status-badge {
  display: inline-block;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  white-space: nowrap;
}

.status-active   { background: rgba(123,63,245,0.2); color: #c4a8ff; border: 1px solid rgba(123,63,245,0.35); }
.status-inactive { background: rgba(100,100,100,0.1); color: var(--muted); border: 1px solid transparent; }

.status-song-open       { background: rgba(100,100,100,0.12); color: #aaa; border: 1px solid transparent; }
.status-song-nowplaying {
  background: linear-gradient(90deg, rgba(123,63,245,0.22), rgba(240,40,122,0.22));
  color: #e8a8ff;
  border: 1px solid rgba(123,63,245,0.35);
}
.status-song-played   { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.25); }
.status-song-skipped  { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

.wish-count {
  display: inline-block;
  background: rgba(123,63,245,0.15);
  color: #c4a8ff;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-section    { padding: 32px 16px 52px; }
  .form-section    { padding: 24px 16px 20px; }
  .admin-main      { padding: 20px 16px 48px; }
  .admin-create-form { flex-direction: column; }
  .td-actions      { flex-wrap: wrap; }
  .admin-table th,
  .admin-table td  { padding: 10px; }
}

@media (min-width: 520px) {
  .form-section         { max-width: 520px; }
  .now-playing-strip    { max-width: 520px; }
}
