/* ==========================================================================
   CLOCK LAB Player 専用スタイルシート
   ========================================================================== */

body.player-body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-color, #08090c);
  color: var(--text-color, #f1f5f9);
  user-select: none;
  transition: background-color 0.3s ease;
}

/* スキン切り替えフェードオーバーレイ */
.skin-transition-overlay {
  position: fixed;
  inset: 0;
  background: #06080b;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.35s ease;
}

.skin-transition-overlay.fading {
  opacity: 1;
}

/* ==========================================================================
   空状態（ウェルカム画面）
   ========================================================================== */
.player-empty-state {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.85) 0%, rgba(6, 8, 11, 0.95) 100%);
  backdrop-filter: blur(16px);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.player-empty-state.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.empty-state-card {
  max-width: 540px;
  width: 90%;
  padding: 40px 32px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.15);
}

.empty-logo {
  margin-bottom: 16px;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.empty-state-card h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #f8fafc;
  margin: 0 0 8px;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.empty-desc {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 28px;
  line-height: 1.6;
}

.empty-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: #38bdf8;
  color: #ffffff;
}

.empty-tip {
  font-size: 11px;
  color: #64748b;
  margin: 0 0 24px;
}

.empty-footer-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.link-to-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.link-to-editor:hover {
  color: #38bdf8;
}

/* ==========================================================================
   右上トップバー (Player)
   ========================================================================== */
.btn-editor-link {
  color: #94a3b8 !important;
}

.btn-editor-link:hover {
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.btn-accent {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.btn-accent:hover {
  background: rgba(56, 189, 248, 0.3) !important;
  color: #ffffff !important;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

/* ==========================================================================
   フローティング・プレイヤーバー（画面下部）
   ========================================================================== */
.player-floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: rgba(10, 15, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 40px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.15);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
}

/* マウス停止時のオートフェードアウト */
body.player-idle .player-floating-bar,
body.player-idle .top-controls-bar {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
}

body.player-idle .top-controls-bar {
  transform: translateY(-10px);
}

/* 左: 情報セクション */
.player-info-section {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 140px;
  max-width: 220px;
}

.playing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.playing-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #38bdf8;
}

.playing-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.skin-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skin-position {
  font-size: 10px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* 中央: コントロール & プログレス */
.player-controls-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.controls-buttons-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: scale(1.08);
}

.btn-play-pause {
  width: 38px;
  height: 38px;
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.btn-play-pause:hover {
  background: #38bdf8;
  color: #041019;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  transform: scale(1.08);
}

.btn-mode-toggle {
  width: auto;
  border-radius: 16px;
  padding: 4px 10px;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.btn-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #38bdf8;
  color: #38bdf8;
}

.mode-label {
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* プログレスバー */
.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 260px;
}

.progress-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  transition: width 0.25s linear;
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}

.time-remaining {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #e2e8f0;
}

.interval-label {
  color: #64748b;
  font-size: 9px;
}

.select-interval {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #38bdf8;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  cursor: pointer;
  outline: none;
}

.select-interval:hover {
  border-color: #38bdf8;
}

/* 右: ボリューム等 */
.player-extra-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-vol-slider {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
}

.player-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  transition: transform 0.1s;
}

.player-vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* ==========================================================================
   キュー管理 サイドパネル (右スライドイン)
   ========================================================================== */
.queue-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  z-index: 120;
  background: rgba(10, 15, 24, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.queue-panel.open {
  right: 0;
}

.queue-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.queue-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-header-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: 0.05em;
}

/* アクションバー */
.queue-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.queue-actions-bar button,
.queue-actions-bar label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-action-primary {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.btn-action-primary:hover {
  background: rgba(56, 189, 248, 0.28);
  color: #ffffff;
}

.btn-action-export {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-action-export:hover {
  background: rgba(16, 185, 129, 0.28);
  color: #ffffff;
}

.btn-action-import {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.btn-action-import:hover {
  background: rgba(168, 85, 247, 0.28);
  color: #ffffff;
}

/* キュー再生設定ボックス */
.queue-settings-box {
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}

.segmented-control {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.seg-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.seg-btn.active {
  background: #0284c7;
  color: #ffffff;
}

.interval-custom-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-interval-num {
  width: 54px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  text-align: right;
  outline: none;
}

.input-interval-num:focus {
  border-color: #38bdf8;
}

.interval-unit {
  font-size: 10px;
  color: #64748b;
}

/* ミニスイッチ */
.switch-mini {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.switch-mini input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-mini .slider-round {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  transition: 0.3s;
}

.switch-mini .slider-round:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch-mini input:checked + .slider-round {
  background-color: #0284c7;
}

.switch-mini input:checked + .slider-round:before {
  transform: translateX(14px);
}

/* キュー一覧リスト */
.queue-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.queue-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
}

.list-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #94a3b8;
  text-transform: uppercase;
}

.btn-text-danger {
  background: transparent;
  border: none;
  font-size: 10px;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.queue-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* キューカード */
.queue-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.queue-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.queue-card.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.15);
}

.queue-card-index {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  min-width: 18px;
}

.queue-card.active .queue-card-index {
  color: #38bdf8;
}

.queue-card-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.queue-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.queue-card.active .queue-card-title {
  color: #38bdf8;
}

.queue-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: #64748b;
}

.tag-badge {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

.tag-badge.mode {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* 操作ボタン群 */
.queue-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-card-icon {
  background: transparent;
  border: none;
  color: #64748b;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-card-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-card-icon.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* リストが空の時の表示 */
.queue-empty-msg {
  padding: 40px 20px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}
