/* Party Jukebox - Thème sombre DJ */
:root {
  --bg: #0a0a0a;
  --bg-card: #141410;
  --bg-input: #1a1a14;
  --bg-hover: #24241a;
  --accent: #cea245;
  --accent-light: #e0b84a;
  --accent-glow: rgba(206, 162, 69, 0.25);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --text: #e8e4d8;
  --text-muted: #a89f8a;
  --text-dim: #6b6352;
  --border: #2e2a1e;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--accent-light); text-decoration: none; }

/* Container */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.container--wide {
  max-width: 900px;
}

/* Header */
.header {
  text-align: center;
  padding: 20px 0 16px;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), #d4a030);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header .logo {
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto 4px;
}

.header .logo--sm {
  max-width: 140px;
}

.header .subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* Search bar */
.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.search-bar .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
  pointer-events: none;
}

/* Filter row */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filters select {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  flex-shrink: 0;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

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

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

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

.card-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #b8912e; }

.btn-success {
  background: var(--green);
  color: white;
}
.btn-success:hover { background: #16a34a; }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #dc2626; }

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Vote button */
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.vote-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.vote-btn.voted {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pending { background: var(--accent-glow); color: var(--accent-light); }
.badge-played { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-rejected { background: rgba(239,68,68,0.15); color: var(--red); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px;
  width: 100%;
  max-width: 500px;
  max-height: 80dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.modal label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
  margin-top: 12px;
}

.modal input, .modal textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.modal input:focus, .modal textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal textarea { resize: vertical; min-height: 60px; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn { flex: 1; }

/* Toast */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.85rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.5s forwards;
  pointer-events: auto;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.status-bar.open { background: rgba(34,197,94,0.1); color: var(--green); }
.status-bar.closed { background: rgba(239,68,68,0.1); color: var(--red); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}

.empty-state .icon { font-size: 2rem; margin-bottom: 8px; }

/* Loading */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Stats grid (DJ) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.toggle input { display: none; }

.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle .slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle input:checked + .slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .slider::before {
  transform: translateX(22px);
  background: white;
}

/* Responsive */
@media (min-width: 768px) {
  .container { padding: 24px; }
  .header { padding: 28px 0 20px; }
  .header h1 { font-size: 1.8rem; }

  .modal {
    border-radius: var(--radius);
    align-self: center;
  }
}
