/* ====================================================================
   style.css — Control Panel 視覺設計
   設計方向：深夜舞台感（深靛藍背景 + 霓虹洋紅點綴），
   但所有可互動的清單/卡片維持白底高對比，確保派對現場、
   各年齡層使用者都能在手機上快速看清楚、點得準。
   完全不依賴外部字型或 CDN（現場網路只有內部 WiFi，不保證能連網際網路）。
   ==================================================================== */

:root {
  --stage-bg: #12111f;
  --stage-bg-soft: #1b1930;
  --surface: #ffffff;
  --surface-text: #1a1523;
  --muted-text: #6b6480;
  --accent: #ff3d81;
  --accent-soft: #ffe3ee;
  --accent-cyan: #22d3c7;
  --border: #e9e6f2;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

/* 用 class 而不是 hidden 屬性來控制顯示/隱藏，比較不容易在檔案搬動過程中被意外弄壞 */
.is-hidden { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--stage-bg);
  color: var(--surface-text);
  min-height: 100vh;
}

.screen { min-height: 100vh; }

/* ---------------- 登入畫面 ---------------- */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, var(--stage-bg-soft), var(--stage-bg) 70%);
}

.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 40px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.mic-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.subtitle { color: var(--muted-text); margin: 0 0 24px; font-size: 14px; }

.text-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  outline: none;
  font-family: var(--font);
}
.text-input:focus { border-color: var(--accent); }

.error-text { color: var(--accent); font-size: 13px; margin: 10px 0 0; text-align: left; }

.primary-button {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.primary-button:active { transform: scale(0.98); }

.secondary-button {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px 24px;
  padding: 12px;
  font-size: 14px;
  color: var(--surface-text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

/* ---------------- 主畫面 ---------------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }

.on-air-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255,61,129,0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,61,129,0.55); }
  70% { box-shadow: 0 0 0 8px rgba(255,61,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,61,129,0); }
}

.user-chip-group { display: flex; align-items: center; gap: 8px; }

.user-chip {
  font-size: 13px;
  color: var(--stage-bg);
  background: var(--accent-cyan);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.logout-button {
  font-size: 12px;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.logout-button:active { transform: scale(0.96); }

.search-bar { padding: 0 16px 12px; }

.tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
}
.tab-button {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tab-button.active { background: var(--accent); }

.song-list {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  min-height: calc(100vh - 190px);
  padding: 8px 12px 100px;
}

.song-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
}
.song-card:last-child { border-bottom: none; }

.song-info { min-width: 0; }
.song-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-singer { font-size: 13px; color: var(--muted-text); margin-top: 2px; }

.add-button {
  flex: none;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.add-button:active { transform: scale(0.95); }
.add-button:disabled { opacity: 0.5; }

.empty-state {
  text-align: center;
  color: var(--muted-text);
  font-size: 14px;
  padding: 60px 24px;
  background: var(--surface);
}

/* ---------------- 待撥清單 ---------------- */
.waiting-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(255,61,129,0.4);
  cursor: pointer;
  z-index: 20;
}
.waiting-count {
  display: inline-block;
  background: rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 4px;
}

.waiting-panel {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.waiting-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.waiting-panel-header h2 { margin: 0; font-size: 17px; }

.icon-button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  font-size: 16px;
  cursor: pointer;
}

.waiting-list-content { padding: 8px 16px; overflow-y: auto; flex: 1; }

.waiting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.waiting-item .order-number {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--stage-bg-soft);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  margin-right: 12px;
}
.waiting-item.now-playing .order-number { background: var(--accent); }
.waiting-item-title { font-size: 14px; font-weight: 600; }
.waiting-item-meta { font-size: 12px; color: var(--muted-text); margin-top: 2px; }
.now-playing-badge {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  margin-left: 8px;
}

/* ---------------- Toast 提示 ---------------- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--stage-bg);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 40;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
