/* ===== VARIABLES ===== */
:root {
  --bg-primary:    #0a0a12;
  --bg-secondary:  #111124;
  --bg-card:       #1a1a2e;
  --bg-card-hover: #1e1e38;
  --border:        rgba(120, 80, 220, 0.18);
  --border-strong: rgba(120, 80, 220, 0.4);
  --primary:       #8b5cf6;
  --primary-dark:  #7c3aed;
  --primary-light: rgba(139, 92, 246, 0.15);
  --cyan:          #06b6d4;
  --cyan-light:    rgba(6, 182, 212, 0.12);
  --text-1:        #f1f5f9;
  --text-2:        #94a3b8;
  --text-3:        #64748b;
  --success:       #22c55e;
  --error:         #ef4444;
  --warning:       #f59e0b;
  --info:          #3b82f6;
  --shadow:        0 8px 32px rgba(0, 0, 0, 0.6);
  --r:             12px;
  --r-sm:          8px;
  --t:             0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}
.header-content {
  max-width: 1400px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.logo-icon {
  font-size: 1.6rem;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  background: var(--primary-light);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ===== MAIN LAYOUT ===== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 28px 100px;
}

/* ===== CONTROLS BAR ===== */
.controls-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: 1rem;
}
.search-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-size: 0.93rem;
  transition: var(--t);
  font-family: inherit;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-input::placeholder { color: var(--text-3); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  font-family: inherit;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-suggest {
  background: transparent;
  color: var(--cyan);
  border: 1.5px solid var(--cyan);
  padding: 10px 24px;
}
.btn-suggest:hover { background: var(--cyan-light); }

/* Small icon-style action buttons */
.btn-icon {
  padding: 5px 9px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--t);
  font-family: inherit;
}
.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-icon.danger:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}
.btn-icon.success:hover {
  border-color: var(--success);
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}
.btn-icon.inqueue {
  border-color: var(--success);
  color: var(--success);
  opacity: 0.7;
  cursor: default;
}
.btn-icon.muted {
  border-color: var(--border);
  color: var(--text-2);
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== CONTENT GRID ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
  align-items: start;
}

/* ===== SECTION ===== */
.songs-section,
.waitlist-section,
.suggestions-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.section-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
}
.count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  min-width: 22px;
  text-align: center;
}

/* ===== SONG LIST ===== */
.song-list {
  max-height: 62vh;
  overflow-y: auto;
}
.song-item {
  display: flex;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(120, 80, 220, 0.08);
  gap: 12px;
  transition: background var(--t);
}
.song-item:last-child { border-bottom: none; }
.song-item:hover { background: var(--bg-card-hover); }
.song-info { flex: 1; min-width: 0; }
.song-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-singer {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 1px;
}
.song-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* ===== WAITLIST ===== */
.waitlist {
  max-height: 62vh;
  overflow-y: auto;
}
.waitlist-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(120, 80, 220, 0.08);
  gap: 10px;
  transition: background var(--t);
}
.waitlist-item:last-child { border-bottom: none; }
.waitlist-item:hover { background: var(--bg-card-hover); }
.waitlist-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.waitlist-info { flex: 1; min-width: 0; }
.waitlist-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.waitlist-singer {
  font-size: 0.75rem;
  color: var(--text-2);
}
.waitlist-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  align-items: center;
}
/* Keep spacing consistent when move buttons are hidden */
.waitlist-actions .btn-icon[style*="visibility:hidden"] {
  visibility: hidden;
}

/* ===== SUGGEST AREA ===== */
.suggest-area {
  margin: 24px 0;
  display: flex;
  justify-content: center;
}

/* ===== SUGGESTIONS SECTION ===== */
.suggestions-section { margin-top: 0; }
.suggestion-item {
  display: flex;
  align-items: flex-start;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(120, 80, 220, 0.08);
  gap: 14px;
  transition: background var(--t);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--bg-card-hover); }
.suggestion-info { flex: 1; min-width: 0; }
.suggestion-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-1);
}
.suggestion-singer {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 2px;
}
.suggestion-note {
  font-size: 0.78rem;
  color: var(--text-3);
  font-style: italic;
  margin-top: 4px;
}
.suggestion-date {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 3px;
}
.suggestion-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 2px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}
.empty-state p { font-size: 0.88rem; }

/* ===== ADMIN TOGGLE (fixed, bottom-right) ===== */
.admin-toggle-btn {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--bg-card);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  font-family: inherit;
  box-shadow: var(--shadow);
}
.admin-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.admin-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none !important; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 5px 8px;
  border-radius: 6px;
  transition: var(--t);
  font-family: inherit;
}
.modal-close:hover { color: var(--text-1); background: var(--border); }
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-1);
  padding-right: 24px;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 15px; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-label .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-3);
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-size: 0.92rem;
  transition: var(--t);
  font-family: inherit;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ===== NOTIFICATIONS ===== */
.notifications {
  position: fixed;
  bottom: 76px;
  right: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.notification {
  padding: 11px 16px;
  border-radius: var(--r-sm);
  font-size: 0.87rem;
  font-weight: 500;
  max-width: 300px;
  box-shadow: var(--shadow);
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 3px solid;
  pointer-events: auto;
}
.notification.show { transform: translateX(0); }
.notification-success { background: rgba(34,197,94,0.13); border-color: var(--success); color: #86efac; }
.notification-error   { background: rgba(239,68,68,0.13);  border-color: var(--error);   color: #fca5a5; }
.notification-warning { background: rgba(245,158,11,0.13); border-color: var(--warning); color: #fcd34d; }
.notification-info    { background: rgba(59,130,246,0.13); border-color: var(--info);    color: #93c5fd; }

/* ===== LANGUAGE FILTER TABS ===== */
.limit-notice {
  margin-bottom: 10px;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.87rem;
}

.lang-filters {
  padding: 9px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.lang-filters:empty { display: none; }
.lang-filter-btn {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-2);
  transition: var(--t);
  font-family: inherit;
}
.lang-filter-btn:hover { color: var(--text-1); border-color: var(--border-strong); }
.lang-filter-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ===== LANGUAGE BADGES ===== */
.lang-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 7px;
  vertical-align: middle;
  white-space: nowrap;
}
.lang-EN { background: rgba(34, 197, 94,  0.15); color: #4ade80; }
.lang-JP { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.lang-KR { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.lang-MD { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.lang-CA { background: rgba(234, 179, 8,  0.15); color: #facc15; }
.lang-OT { background: rgba(148,163,184,  0.15); color: #94a3b8; }

/* ===== UTILITY ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .content-grid { grid-template-columns: 1fr; }
  .song-list, .waitlist { max-height: 45vh; }
}
@media (max-width: 580px) {
  .main { padding: 16px 14px 90px; }
  .header { padding: 0 16px; }
  .controls-bar { flex-wrap: wrap; }
  .search-wrap { flex: 1 1 100%; }
}
