@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ===== TOKENS ===== */
:root {
  --bg-base:        #0d0f14;
  --bg-surface:     #13161e;
  --bg-card:        rgba(255, 255, 255, 0.04);
  --bg-card-hover:  rgba(255, 255, 255, 0.07);
  --border:         rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(255, 255, 255, 0.14);

  --neon-amber:     #f5a623;
  --neon-blue:      #5b8cff;
  --neon-purple:    #9b72f5;
  --neon-green:     #3ecf8e;
  --neon-pink:      #f56bab;

  --text-primary:   #f0f2f8;
  --text-secondary: #8a90a8;
  --text-muted:     #4e546b;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(91,140,255,0.18);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== BACKGROUND GLOW ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(91,140,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 80%, rgba(155,114,245,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 60% 50%, rgba(245,166,35,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  border-radius: 8px; /* Smooths out any sharp edges if background isn't pure black */
}
.logo-text-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.logo-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.logo-title span { color: var(--neon-amber); }
.logo-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-blue);
  line-height: 1;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ===== SEARCH ===== */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 340px;
}
.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
#search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: 0.5rem 1rem 0.5rem 2.4rem;
  transition: var(--transition);
  outline: none;
}
#search-input::placeholder { color: var(--text-muted); }
#search-input:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(91,140,255,0.15);
  background: var(--bg-card-hover);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  padding: 0.55rem 1.2rem;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--neon-amber), #e8920f);
  color: #0d0f14;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(245,166,35,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,166,35,0.45);
}
.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
.btn-danger {
  background: rgba(220,53,69,0.12);
  border: 1px solid rgba(220,53,69,0.3);
  color: #ff6b7a;
}
.btn-danger:hover { background: rgba(220,53,69,0.22); }

/* ===== MAIN LAYOUT ===== */
main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.section-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.5rem;
}

/* ===== FILTER CHIPS ===== */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active {
  background: rgba(91,140,255,0.15);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}
.chip-icon { font-size: 0.9rem; }

/* ===== MUSICIANS GRID ===== */
.musicians-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ===== MUSICIAN CARD ===== */
.musician-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.musician-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-color, rgba(91,140,255,0.06)), transparent 60%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}
.musician-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.musician-card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.03em;
}
.card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ===== ROLE PILLS ===== */
.roles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ===== SONG SECTION IN CARD ===== */
.card-songs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.role-songs-block { }
.role-songs-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.songs-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.song-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.song-item::before {
  content: '♩';
  font-size: 0.7rem;
  color: var(--text-muted);
}
.no-songs {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== CARD FOOTER ===== */
.card-footer {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.empty-desc { font-size: 0.9rem; }

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ===== MODAL ===== */
.modal {
  background: #181c27;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}
.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* ===== FORM ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-input, .form-select {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(91,140,255,0.12);
}
.form-select option { background: #181c27; }

/* ===== ROLE SELECTOR ===== */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}
.role-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.role-toggle:hover { border-color: var(--border-strong); color: var(--text-primary); }
.role-toggle.selected {
  border-color: var(--neon-blue);
  background: rgba(91,140,255,0.12);
  color: var(--neon-blue);
}
.role-toggle .rt-icon { font-size: 1rem; }

/* ===== SONGS EDITOR (per role) ===== */
.songs-editor {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.songs-editor-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.songs-editor-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.songs-editor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
  min-height: 28px;
}
.song-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 0.22rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.song-tag-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.1rem;
  border-radius: 50%;
  transition: var(--transition);
  background: none;
  border: none;
}
.song-tag-remove:hover { color: #ff6b7a; background: rgba(220,53,69,0.12); }

.song-add-row {
  display: flex;
  gap: 0.5rem;
}
.song-add-row .form-input { margin: 0; }
.btn-add-song {
  flex-shrink: 0;
  background: rgba(91,140,255,0.14);
  border: 1px solid rgba(91,140,255,0.3);
  color: var(--neon-blue);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-add-song:hover { background: rgba(91,140,255,0.24); }

/* ===== FORM ACTIONS ===== */
.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: #1e2231;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.3s ease, fadeOut 0.4s ease 2.4s forwards;
  max-width: 280px;
}
.toast.success { border-left: 3px solid var(--neon-green); }
.toast.error   { border-left: 3px solid #ff6b7a; }

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(110%); }
}

/* ===== SONG VIEW MODAL ===== */
.detail-roles {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.detail-role-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
}
.detail-role-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.detail-songs-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.detail-song {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.detail-song:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.detail-song::before { content: '♪'; color: var(--text-muted); font-size: 0.8rem; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header-inner { gap: 0.5rem; }
  .logo-img { height: 34px; }
  .logo-title { font-size: 1.05rem; }
  .logo-subtitle { font-size: 0.6rem; }
  .search-wrapper { max-width: 160px; }
  main { padding: 1.5rem 1rem 3rem; }
  .musicians-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.25rem; }
  .roles-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 1.25rem; }
}
