/* SPDX-License-Identifier: AGPL-3.0-only */
/* SPDX-FileCopyrightText: 2025-2026 The 25-ji-code-de Team */

/* style.css - simple fullscreen video with overlay info */

/* CSS Variables */
:root {
  --color-danger: #ff6b6b;
  --color-danger-bg: rgba(255, 107, 107, 0.15);
  --color-danger-border: rgba(255, 107, 107, 0.3);
  --color-danger-hover-bg: rgba(255, 107, 107, 0.25);
  --color-danger-hover-border: rgba(255, 107, 107, 0.5);
}

/* Utility Classes */
.sekai-hidden {
  display: none !important;
}

/* Button Variants */
.sekai-secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sekai-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.sekai-danger-btn {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
  margin-top: 12px;
}

.sekai-danger-btn:hover {
  background: var(--color-danger-hover-bg);
  border-color: var(--color-danger-hover-border);
}

/* Base Styles */
#app, html, body {
  height: 100vh;
  margin: 0;
  background: #000;
}

#app{display:flex;align-items:center;justify-content:center;position:relative}

/* Video Loading Indicator */
.video-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(180, 130, 255, 0.8);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loader-text {
  color: rgba(255, 255, 255, 0.8);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.video-loader.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Make video responsive and show the whole video on narrow/portrait screens.
   Use object-fit: contain so the video is fully visible with letterboxing
   instead of being cropped (object-fit:cover). Limit height to viewport. */
video{
  width: 100%;
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  object-fit: contain;
  background: #000; /* letterbox color */
}
#overlay{position:absolute;left:0;top:0;width:100%;padding:12px;box-sizing:border-box}
#info{color:#fff;font-family:system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial;font-size:14px;background:rgba(0,0,0,0.35);display:inline-block;padding:6px 10px;border-radius:6px;cursor:pointer;user-select:none;transition:background 0.2s ease, transform 0.1s ease}
#info:hover{background:rgba(0,0,0,0.5)}
#info:active{transform:scale(0.98);background:rgba(0,0,0,0.6)}
#controls{position:absolute;right:12px;top:12px;display:flex;gap:8px;align-items:center}
#controls button{background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);color:#fff;padding:6px 8px;border-radius:6px;font-size:13px;backdrop-filter:blur(4px);cursor:pointer}
#controls button:hover:not([aria-pressed="true"]){background:rgba(255,255,255,0.09)}
#volumeSlider{width:110px}
/* no extra select styles (speed selector removed) */
#muteBtn[aria-pressed="false"]{opacity:0.9}
#muteBtn[aria-pressed="true"]{opacity:0.75}
#audioProcessBtn[aria-pressed="false"]{opacity:0.7}
#audioProcessBtn[aria-pressed="true"]{opacity:1;background:rgba(100,200,255,0.15);border-color:rgba(100,200,255,0.3)}
#audioProcessBtn[aria-pressed="true"]:hover{background:rgba(100,200,255,0.2);border-color:rgba(100,200,255,0.4)}
#controls input[type="range"]{appearance:none;background:transparent;height:24px}
#controls input[type="range"]::-webkit-slider-runnable-track{height:6px;background:rgba(255,255,255,0.12);border-radius:6px}
#controls input[type="range"]::-webkit-slider-thumb{width:12px;height:12px;border-radius:50%;background:#fff;margin-top:-3px}
#overlay.hidden{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease, visibility .18s ease}

/* Live Status Widget */
.live-status-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  align-items: flex-start;
  pointer-events: auto;
}

.live-stat-item {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, transform 0.1s ease;
  cursor: pointer;
  user-select: none;
}

.live-stat-item:hover {
  background: rgba(0, 0, 0, 0.5);
}

.live-stat-item:active {
  transform: scale(0.98);
  background: rgba(0, 0, 0, 0.6);
}

.online-users .live-dot {
  width: 8px;
  height: 8px;
  background-color: #4caf50;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

.broadcast-msg {
  max-width: 320px;
  overflow: hidden;
}

.broadcast-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.broadcast-text-wrapper {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  max-width: 240px;
}

.broadcast-text {
  display: inline-block;
  white-space: nowrap;
}

/* Auto-scrolling animation for long broadcast text */
.broadcast-text.scrolling {
  position: relative;
  color: transparent; /* Hide original text */
  --scroll-distance: 0px; /* Will be set by JS */
}

.broadcast-text.scrolling::after {
  content: attr(data-full-text);
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  color: #fff;
  animation: broadcastScrollText 10s ease-in-out infinite;
}

@keyframes broadcastScrollText {
  0%, 20% {
    transform: translateX(0);
  }
  50%, 70% {
    transform: translateX(var(--scroll-distance));
  }
  100% {
    transform: translateX(0);
  }
}

/* HEVC warning banner - styled to blend with existing overlay and placed bottom-left */
#hevcWarning{position:absolute;left:12px;bottom:12px;z-index:9999}
#hevcWarning .hevc-inner{background:rgba(0,0,0,0.5);color:#fff;padding:8px 12px;border-radius:8px;display:flex;gap:10px;align-items:center;font-family:system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial;font-size:13px;border:1px solid rgba(255,255,255,0.06);backdrop-filter:blur(6px)}
/* no dismiss button styles (banner is non-dismissible) */

@media (max-width:520px){
  #hevcWarning .hevc-inner{font-size:12px;padding:7px 9px}
  #hevcWarning{left:8px;bottom:8px}
}

/* Responsive: on narrow devices stack info and controls vertically to avoid overlap */
@media (max-width:750px){
  /* make overlay use document flow and stack children */
  #overlay{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
    padding:10px;
  }

  /* remove absolute positioning so controls flow below info */
  #controls{
    position:static;
    right:auto;
    top:auto;
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    width:100%;
    box-sizing:border-box;
    justify-content:flex-start;
    background:rgba(0,0,0,0.18);
    padding:6px 8px;
    border-radius:6px;
  }

  /* make info take full width so it doesn't collide with controls */
  #info{
    display:block;
    width:100%;
    box-sizing:border-box;
  }

  /* reduce slider width on small screens */
  #volumeSlider{width:80px}
}

/* Pomodoro Timer Styles */
#pomodoroBtn {
  font-size: 16px;
  padding: 6px 10px;
}

#pomodoroPanel {
  position: fixed;
  bottom: 80px;
  right: 12px;
  background: rgba(15, 15, 25, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 0;
  width: 750px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 1000;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial;
  color: #fff;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform-origin: bottom right;
  overflow: hidden;
}

/* When clock is collapsed, make panel narrower */
#pomodoroPanel:has(.world-clock-section.collapsed) {
  width: 420px;
}

#pomodoroPanel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
}

/* Main Content: Left-Right Layout */
.pomodoro-main-content {
  display: flex;
  flex-direction: row;
}

/* Remove old :has() rule - not needed anymore */

/* World Clock Section - Left Side */
.world-clock-section {
  flex: 0 0 350px;
  width: 350px;
  background: linear-gradient(135deg, rgba(30, 30, 45, 0.25) 0%, rgba(20, 20, 35, 0.35) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 28px 24px 24px;
  transition: flex-basis 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 400px;
  max-height: 600px;
  position: relative;
}

.world-clock-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.world-clock-section.collapsed {
  flex: 0 0 0;
  width: 0;
  padding: 0;
  opacity: 0;
  border-right: none;
  min-height: 0;
  max-height: 0;
}

/* Main Clock - Time.is Style */
.clock-item.main-clock {
  text-align: center;
  margin-bottom: 20px;
}

.clock-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 400;
}

.clock-time-large {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-family: 'Montserrat', 'SF Mono', 'Monaco', 'Consolas', 'Roboto Mono', monospace;
  line-height: 1.2;
  display: flex;
  justify-content: center;
  align-items: baseline;
  margin-bottom: 8px;
}

.time-hours, .time-minutes, .time-seconds {
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
}

.time-separator {
  opacity: 0.6;
  margin: 0 2px;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 49% { opacity: 0.6; }
  50%, 100% { opacity: 0.2; }
}

.time-milliseconds {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
  margin-left: 2px;
  align-self: flex-end;
  padding-bottom: 6px;
}

.clock-date {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* World Clocks Grid */
.world-clocks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.clock-item-small {
  text-align: center;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.clock-item-small:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.clock-label-small {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clock-select {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  text-align-last: center;
  outline: none;
  font-family: inherit;
}

.clock-select:hover {
  color: rgba(255, 255, 255, 0.8);
}

.clock-select option {
  background: #1e1e2d;
  color: #fff;
  text-align: left;
}

.clock-time-small {
  font-family: 'Montserrat', 'SF Mono', 'Monaco', 'Consolas', 'Roboto Mono', monospace;
  font-variant-numeric: tabular-nums;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 1px;
}

.time-hms {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0;
  font-family: 'Montserrat', sans-serif;
}

.time-ms {
  /* Removed - no longer displayed */
  display: none;
}

/* Remove old clock styles */
.clock-item {
  /* styles removed */
}

.clock-display {
  /* styles removed */
}

.clock-display.ticking {
  /* removed */
}

@keyframes pulse {
  /* kept for other uses */
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.pomodoro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(8px);
}

.header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.2s;
  padding: 6px 10px;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.toggle-btn:hover:not(.active) {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4));
  border-color: rgba(99, 102, 241, 0.6);
  opacity: 1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.toggle-btn.active:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(168, 85, 247, 0.5));
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.5);
}

.close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

/* Pomodoro Body - Right Side */
.pomodoro-body {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 450px;
  margin: 0 auto;
  width: 100%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When clock is collapsed, center the pomodoro */
.world-clock-section.collapsed ~ .pomodoro-body {
  max-width: 100%;
}

.pomodoro-display {
  font-size: 64px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: #ff6b6b;
  text-shadow: 0 2px 12px rgba(255, 107, 107, 0.3);
}

.pomodoro-status {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}

.pomodoro-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.pomodoro-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.pomodoro-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.pomodoro-btn:hover:not(:disabled)::before {
  left: 100%;
}

.pomodoro-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pomodoro-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pomodoro-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pomodoro-btn.primary {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  border-color: rgba(255, 107, 107, 0.5);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.pomodoro-btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff5252 0%, #ff4444 100%);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.pomodoro-settings {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 20px 16px 16px;
  margin-top: 8px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}

.setting-item label {
  color: rgba(255, 255, 255, 0.8);
}

.setting-item input[type="number"] {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  width: 70px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.setting-item input[type="number"]:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#pomodoroRound {
  color: #fff;
  font-weight: 500;
}

/* Responsive adjustments for pomodoro panel */
@media (max-width: 1000px) {
  #pomodoroPanel {
    width: 95vw;
    min-width: 300px;
    max-width: 95vw;
    max-height: 80vh;
    right: 2.5vw;
    bottom: 70px;
  }

  /* When clock is collapsed, allow panel to be smaller */
  #pomodoroPanel:has(.world-clock-section.collapsed) {
    width: 95vw;
    max-width: 550px;
  }

  .pomodoro-main-content {
    min-height: auto;
  }

  .world-clock-section {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 12px 12px;
    justify-content: unset;
  }

  .world-clock-section.collapsed {
    display: none;
  }

  .clock-time-large {
    font-size: 32px;
  }

  .time-milliseconds {
    font-size: 14px;
    padding-bottom: 3px;
  }

  .clock-date {
    font-size: 11px;
  }

  .world-clocks-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .time-hms {
    font-size: 13px;
  }

  .time-ms {
    font-size: 9px;
  }

  .pomodoro-body {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.5rem;
    padding: 16px;
    max-width: unset;
  }

  .pomodoro-display {
    margin-top: 24px;
    grid-column: 1;
    grid-row: 1;
    font-size: 48px;
  }
  
  .pomodoro-status {
    grid-column: 1;
    grid-row: 2;
  }

  .pomodoro-controls {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .pomodoro-settings {
    margin-top: 0;
    grid-column: 2;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .pomodoro-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .pomodoro-display {
    font-size: 40px;
  }
  
  .world-clocks-grid {
    grid-template-columns: 1fr;
  }
}

/* CD Player Styles */
#cdPlayerBtn {
  font-size: 16px;
  padding: 6px 10px;
}

#cdPlayerPanel {
  position: fixed;
  bottom: 80px;
  right: 12px;
  background: rgba(15, 15, 25, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 0;
  width: 800px;
  max-height: 600px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 999;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial;
  color: #fff;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform-origin: bottom right;
  overflow: hidden;
}

#cdPlayerPanel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
}

.cd-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(8px);
}

.cd-player-body {
  display: flex;
  flex-direction: row;
  height: 520px;
  overflow: hidden;
}

/* Music List Section */
.music-list-section {
  flex: 0 0 320px;
  max-width: 320px;
  min-width: 280px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: row;
  background: linear-gradient(135deg, rgba(30, 30, 45, 0.25) 0%, rgba(20, 20, 35, 0.35) 100%);
}

.music-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.music-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.music-search input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.music-search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.music-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.music-list::-webkit-scrollbar {
  width: 6px;
}

.music-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.music-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.music-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.music-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  gap: 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.music-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.music-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.music-item-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

/* Auto-scrolling animation for long titles only */
.music-item-title.scrolling {
  position: relative;
  text-overflow: clip;
  color: transparent; /* Hide original text */
  --scroll-distance: 0px; /* Will be set by JS */
}

.music-item-title.scrolling::after {
  content: attr(data-full-text);
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  color: #fff; /* Show scrolling text */
  animation: autoScrollText 8s ease-in-out infinite;
}

@keyframes autoScrollText {
  0%, 30% {
    transform: translateX(0);
  }
  70% {
    transform: translateX(var(--scroll-distance));
  }
  100% {
    transform: translateX(0);
  }
}

.music-item-artist {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Now Playing Section */
.now-playing-section {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
}

.now-playing-section::-webkit-scrollbar {
  width: 6px;
}

.now-playing-section::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.now-playing-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.now-playing-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.album-cover-container {
  width: 240px;
  height: 240px;
  position: relative;
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}

.album-cover {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.05);
  transition: border-radius 0.5s ease;
  transform: rotate(0deg);
}

/* Playing state: turn into a spinning CD */
.album-cover-container.playing .album-cover {
  border-radius: 50%;
  animation: spin 20s linear infinite;
  transition: border-radius 0.5s ease;
}

/* Loading spinner overlay */
.track-loading-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s;
}

.track-loading-spinner.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner-icon {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spinLoader 1s ease-in-out infinite;
}

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

.cd-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /* CD texture: grooves and shine */
  background: 
    /* Grooves */
    repeating-radial-gradient(rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 2px, transparent 3px, transparent 4px),
    /* Shine */
    conic-gradient(from 0deg, transparent 0deg, rgba(255,255,255,0.2) 45deg, transparent 90deg, rgba(255,255,255,0.2) 135deg, transparent 180deg, rgba(255,255,255,0.2) 225deg, transparent 270deg, rgba(255,255,255,0.2) 315deg, transparent 360deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  transform: rotate(0deg);
}

.album-cover-container.playing .cd-animation {
  opacity: 1;
  animation: spin 20s linear infinite;
  transition: opacity 0.5s;
}

/* Audio Visualizer Canvas */
#visualizerCanvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%; /* Larger than cover */
  height: 150%;
  z-index: 0; /* Behind cover */
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

#visualizerCanvas.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Center hole overlay removed */
.album-cover-container::after {
  display: none;
}

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

.track-info {
  text-align: center;
  margin-bottom: 24px;
  max-width: 400px;
}

.track-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.track-artist {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.track-vocal {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* Player Progress */
.player-progress {
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.time-current, .time-total {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

#progressBar {
  flex: 1;
  height: 6px;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
}

#progressBar::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

#progressBar::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#progressBar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* Player Controls */
.player-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.control-btn:hover:not(:disabled):not(.active) {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-btn:active:not(:disabled) {
  transform: scale(1.05);
}

.control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.play-btn {
  width: 60px;
  height: 60px;
  font-size: 24px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  border-color: rgba(255, 107, 107, 0.5);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.play-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff5252 0%, #ff4444 100%);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.control-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4));
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.control-btn.active:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(168, 85, 247, 0.5));
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.5);
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 200px;
}

.volume-control span {
  font-size: 18px;
}

#cdVolumeSlider {
  flex: 1;
  height: 6px;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
}

#cdVolumeSlider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

#cdVolumeSlider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#cdVolumeSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* Responsive for CD Player */
@media (max-width: 1000px) {
  #cdPlayerPanel {
    width: 95vw;
    max-width: 95vw;
    right: 2.5vw;
    bottom: 70px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
  }

  .cd-player-body {
    height: auto;
    flex: 1;
  }

  .music-list-section {
    flex: 0 0 40%; /* 左侧占40%宽度 */
    max-width: 40%;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    order: 1;
  }

  .music-categories {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px;
    overflow-x: auto;
  }

  .category-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .music-list-container {
    flex: 1;
    overflow: hidden;
  }

  .music-search {
    padding: 8px;
  }

  .music-item {
    padding: 8px 10px;
    margin-bottom: 4px;
    font-size: 13px;
  }

  .now-playing-section {
    padding: 16px;
    order: 2;
    min-height: 300px;
  }

  .album-cover-container {
    width: 160px;
    height: 160px;
    margin-bottom: 16px;
  }

  .track-title {
    font-size: 18px;
  }

  .track-artist {
    margin-bottom: 16px;
  }
  
  .track-info {
    margin-bottom: 16px;
  }

  .player-controls {
    gap: 12px;
    margin-bottom: 16px;
  }

  .control-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .play-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .player-progress {
    margin-bottom: 12px;
  }

  .volume-control {
    max-width: 85%;
    padding-bottom: 80px;
  }
}

@media (max-width: 480px) {
  .music-list-section {
    flex: 0 0 100px;
  }
  
  .album-cover-container {
    width: 140px;
    height: 140px;
  }
  
  .now-playing-section {
    min-height: auto;
  }
}

/* Music Categories - Vertical Sidebar */
.music-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(0, 0, 0, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  scrollbar-width: none;
}

.music-categories::-webkit-scrollbar {
  width: 4px;
}

.music-categories::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.music-categories::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.category-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  padding: 10px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.category-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.category-btn:hover:not(.active) img {
  opacity: 1;
}

.category-btn.active img {
  opacity: 1;
}

.category-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.category-btn.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.6);
  color: #fff;
  transform: translateX(4px);
}

.category-btn.active:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.7);
}

/* Music list container wrapper */
.music-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Favorite Icon in Music Item */

.music-item-content {
  flex: 1;
  min-width: 0; /* Allow text truncation */
  position: relative;
  /* overflow will be set to visible by JS for scrolling items */
}

.music-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.favorite-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.favorite-btn:hover {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
  transform: scale(1.05);
}

.favorite-btn.active {
  color: #ff6b6b;
}

/* Category Colors */
.category-btn[data-category="favorites"].active,
.category-btn[data-category="favorites"]:hover {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

.category-btn[data-category="virtual_singer"].active,
.category-btn[data-category="virtual_singer"]:hover {
  border-color: #33CCBB;
  background: rgba(51, 204, 187, 0.2);
}

.category-btn[data-category="leo_need"].active,
.category-btn[data-category="leo_need"]:hover {
  border-color: #4455DD;
  background: rgba(68, 85, 221, 0.2);
}

.category-btn[data-category="more_more_jump"].active,
.category-btn[data-category="more_more_jump"]:hover {
  border-color: #88DD44;
  background: rgba(136, 221, 68, 0.2);
}

.category-btn[data-category="vivid_bad_squad"].active,
.category-btn[data-category="vivid_bad_squad"]:hover {
  border-color: #EE1166;
  background: rgba(238, 17, 102, 0.2);
}

.category-btn[data-category="wonderlands_x_showtime"].active,
.category-btn[data-category="wonderlands_x_showtime"]:hover {
  border-color: #FF9900;
  background: rgba(255, 153, 0, 0.2);
}

.category-btn[data-category="25_ji_nightcord_de"].active,
.category-btn[data-category="25_ji_nightcord_de"]:hover {
  border-color: #884499;
  background: rgba(136, 68, 153, 0.2);
}

.category-btn[data-category="special"].active,
.category-btn[data-category="special"]:hover {
  border-color: #39C5BB;
  background: rgba(57, 197, 187, 0.2);
  color: #39C5BB;
}

.category-btn[data-category="playlists"].active,
.category-btn[data-category="playlists"]:hover {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
}

/* Playlist UI Styles */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
}

.playlist-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  aspect-ratio: 1;
  justify-content: center;
}

.playlist-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.playlist-card.create-new {
  border-style: dashed;
  color: rgba(255, 255, 255, 0.5);
}

.playlist-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.playlist-name {
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
}

.playlist-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}

/* Add to Playlist Button */
.add-to-playlist-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.add-to-playlist-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
  transform: scale(1.05);
}

/* Delete Local Music Button */
.delete-local-btn {
  background: none;
  border: none;
  color: rgba(255, 100, 100, 0.4);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.delete-local-btn:hover {
  color: rgba(255, 100, 100, 1);
  background: rgba(255, 100, 100, 0.1);
  transform: scale(1.05);
}

/* Playlist Dropdown Menu */
.playlist-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1e1e2d;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.playlist-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.playlist-dropdown::-webkit-scrollbar {
  width: 6px;
}

.playlist-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.playlist-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.playlist-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-dropdown-item:last-child {
  border-bottom: none;
}

.playlist-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.playlist-dropdown-item.create-new {
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-dropdown-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.playlist-dropdown-name {
  flex: 1;
  font-size: 13px;
}

.playlist-dropdown-check {
  font-size: 14px;
  color: #51cf66;
  flex-shrink: 0;
}

/* Modal for Playlist Selection */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #1e1e2d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 300px;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.modal-body {
  padding: 8px;
  overflow-y: auto;
}

.playlist-option {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.playlist-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.playlist-option-icon {
  font-size: 18px;
}

/* Orientation Warning */
#orientation-warning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  text-align: center;
}

#orientation-warning .phone-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: rotate-phone 2.5s infinite ease-in-out;
}

#orientation-warning p {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  opacity: 0.8;
  letter-spacing: 1px;
}

@keyframes rotate-phone {
  0%, 10% { transform: rotate(0deg); }
  40%, 60% { transform: rotate(-90deg); }
  90%, 100% { transform: rotate(0deg); }
}

@media screen and (orientation: portrait) {
  #orientation-warning {
    display: flex;
  }
}

/* Settings Panel Styles */
#settingsPanel {
  position: fixed;
  bottom: 80px;
  right: 12px;
  background: rgba(15, 15, 25, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 0;
  width: 700px; /* Increased width for sidebar layout */
  max-height: 600px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 1001;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial;
  color: #fff;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform-origin: bottom right;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#settingsPanel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.02));
  flex-shrink: 0;
}

.settings-body-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 500px; /* Fixed height for layout */
}

/* Sidebar */
.settings-sidebar {
  width: 200px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sidebar-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-btn.active {
  background: rgba(100, 200, 255, 0.15);
  color: #fff;
  font-weight: 500;
}

.sidebar-btn.active:hover {
  background: rgba(100, 200, 255, 0.2);
}

.sidebar-btn .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* Content Area */
.settings-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.1);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home Tab Styles */
.home-welcome-section {
  margin-bottom: 32px;
}

.home-welcome-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-nickname-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nickname-text {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.icon-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

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

.home-stats-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  background: rgba(255, 255, 255, 0.06);
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.1);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.summary-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.home-tips-card {
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.15) 0%, rgba(33, 150, 243, 0.15) 100%);
  border: 1px solid rgba(100, 181, 246, 0.3);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.home-tips-card::before {
  content: '”';
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: 80px;
  color: rgba(255, 255, 255, 0.05);
  font-family: serif;
}

.tips-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #90caf9;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tips-content {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

/* General Settings Styles */
.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: ;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.setting-row select,
.setting-row input[type="number"] {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  min-width: 100px;
}

.setting-row select:focus,
.setting-row input[type="number"]:focus {
  outline: none;
  border-color: rgba(100, 200, 255, 0.5);
}

.setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #64b5f6;
  cursor: pointer;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  color: #fff;
  margin: 0 0 8px;
}

.empty-state p {
  font-size: 14px;
  margin: 0 0 24px;
  max-width: 300px;
}

.primary-btn {
  background: #64b5f6;
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: #90caf9;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.activity-list {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  transition: background 0.2s;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.activity-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

/* Achievements List */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.achievement-score {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
}

.score-value {
  font-size: 24px;
  font-weight: 700;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s, background 0.2s;
}

.achievement-item:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.achievement-item.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.achievement-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.1);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.achievement-info {
  flex: 1;
}

.achievement-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.achievement-points {
  font-size: 11px;
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  padding: 2px 6px;
  border-radius: 4px;
}

.achievement-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.achievement-check {
  color: #4caf50;
  font-weight: bold;
  font-size: 18px;
}

/* About Section */
.about-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.about-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.about-header h3 {
  font-size: 18px;
  margin: 0 0 4px;
}

.about-header .version {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  display: flex;
  flex-direction: column;
   gap: 4px;
  align-items: center;
}

/* Version status styles */
.version-dev {
  color: #ffa500;
  font-weight: 500;
}

.version-current {
  color: rgba(255, 255, 255, 0.6);
}

.version-checking {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.version-uptodate {
  color: #4ade80;
  font-size: 11px;
  font-weight: 500;
}

.version-update-available {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #60a5fa;
  font-size: 11px;
  background: rgba(96, 165, 250, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 4px;
}

.version-update-link {
  color: #fff;
  background: rgba(96, 165, 250, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 11px;
  transition: background 0.2s ease;
}

.version-update-link:hover {
  background: rgba(96, 165, 250, 0.5);
}

.about-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.links-row {
  display: flex;
  gap: 10px;
}

.link-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
}

.link-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  color: #fff;
}

.legal-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.6;
  margin: 0;
  text-align: justify;
}

.legal-text p {
  margin-bottom: 8px;
}

.legal-text strong {
  color: rgba(255, 255, 255, 0.5);
}

/* Legal Links */
.legal-links-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.legal-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.legal-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 4px;
}

/* Responsive for Settings Panel */
@media (max-width: 1000px) {
  #settingsPanel {
    width: 95vw;
    max-width: 95vw;
    right: 2.5vw;
    left: auto;
    bottom: 70px;
    max-height: 80vh;
  }
  
  .settings-body-layout {
    height: auto;
    max-height: calc(80vh - 60px);
  }
}

@media (max-width: 720px) {
  #settingsPanel {
    width: 95vw;
    max-width: 95vw;
    right: 2.5vw;
    left: auto;
    bottom: 60px;
    max-height: 85vh;
  }
  
  .settings-header {
    padding: 14px 16px;
    font-size: 15px;
  }
  
  .settings-body-layout {
    flex-direction: column;
    height: auto;
    max-height: calc(85vh - 55px);
  }
  
  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
  }
  
  .sidebar-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
  }
  
  .sidebar-btn .label {
    display: none;
  }
  
  .sidebar-btn.active .label {
    display: inline;
  }
  
  .settings-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }
  
  /* Home tab adjustments */
  .home-welcome-section h2 {
    font-size: 22px;
  }
  
  .nickname-text {
    font-size: 16px;
  }
  
  .summary-card {
    padding: 12px;
  }
  
  .summary-icon {
    font-size: 18px;
  }
  
  .summary-text {
    font-size: 13px;
  }
  
  .home-tips-card {
    padding: 14px;
  }
  
  .tips-content {
    font-size: 13px;
  }
  
  /* Stats tab adjustments */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  /* About tab adjustments */
  .about-header h3 {
    font-size: 16px;
  }
  
  .about-desc {
    font-size: 13px;
  }
  
  .links-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .link-btn {
    padding: 12px;
  }
  
  .legal-links-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .legal-text {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  #settingsPanel {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* Version Info Modal */
.version-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.version-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.version-modal {
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #fff;
}

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

.version-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.version-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 24px;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.version-modal-close:hover {
  color: #fff;
}

.version-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  font-size: 14px;
}

.version-label {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.version-value {
  color: rgba(255, 255, 255, 0.9);
  font-family: monospace;
  word-break: break-all;
}

.version-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.version-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.version-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.version-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.version-btn-primary {
  background: #60a5fa;
  color: #000;
  font-weight: 500;
}

.version-btn-primary:hover {
  background: #93c5fd;
}

/* Make the version element clickable */
#appVersion {
  cursor: pointer;
  transition: opacity 0.2s;
  position: relative;
  user-select: none;
}

#appVersion:hover {
  opacity: 0.8;
}

/* Chat Panel Styles */
#chatPanel {
  position: fixed;
  bottom: 12px;
  right: 12px;
  width: 320px;
  height: 400px;
  max-height: 60vh;
  background: rgba(15, 15, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
}

#chatPanel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px);
}

#chatPanel .panel-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}

#chatPanel .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#chatPanel .chat-messages::-webkit-scrollbar {
  width: 4px;
}

#chatPanel .chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

#chatPanel .chat-message {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
  animation: fadeIn 0.2s ease;
}

#chatPanel .chat-message .time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}

#chatPanel .chat-message .name {
  font-weight: 600;
  color: rgba(180, 130, 255, 0.9);
}

#chatPanel .chat-message .separator {
  color: rgba(255, 255, 255, 0.5);
  margin-right: 4px;
}

#chatPanel .chat-message.system {
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  font-size: 12px;
  margin: 4px 0;
  text-align: center;
}

#chatPanel .chat-input-area {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

#chatPanel #chatInput {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

#chatPanel #chatInput:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#chatPanel #chatSendBtn {
  background: rgba(180, 130, 255, 0.2);
  border: 1px solid rgba(180, 130, 255, 0.3);
  color: #fff;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

#chatPanel #chatSendBtn:hover:not(:disabled) {
  background: rgba(180, 130, 255, 0.3);
}

#chatPanel #chatSendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 520px) {
  #chatPanel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(0);
  }
  
  #chatPanel.hidden {
    transform: translateY(100%);
  }
}

/* Health Reminder Toasts */
#health-toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.health-toast {
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toast-slide-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.health-toast.hiding {
  opacity: 0;
  transform: translateY(-20px);
}

.health-toast.sedentary {
  border-left: 4px solid #ff9800;
}

.health-toast.hydration {
  border-left: 4px solid #2196f3;
}

.toast-icon {
  font-size: 24px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #fff;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-content .setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-content .setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label span:first-child {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.setting-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.setting-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  width: 80px;
}

.setting-input:focus {
  outline: none;
  border-color: rgba(100, 200, 255, 0.5);
}

.setting-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  min-width: 150px;
  cursor: pointer;
}

.setting-select:focus {
  outline: none;
  border-color: rgba(100, 200, 255, 0.5);
}

.setting-select option {
  background: rgba(30, 30, 45, 0.95);
  color: #fff;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #64b5f6;
}

input:focus + .slider {
  box-shadow: 0 0 1px #64b5f6;
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.slider.round {
  border-radius: 22px;
}

.slider.round:before {
  border-radius: 50%;
}
/* Todo List Panel */
#todoPanel {
  position: fixed;
  top: 60px;
  right: 12px;
  bottom: 120px;
  width: 320px;
  background: rgba(15, 15, 25, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 0;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 1000;
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform-origin: top right;
}

#todoPanel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
}

#todoPanel .panel-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}

#todoPanel .panel-header .header-controls {
  display: flex;
  gap: 8px;
}

#todoPanel .close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  transition: color 0.2s;
}

#todoPanel .close-btn:hover {
  color: #fff;
}

.todo-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
  height: 100%;
}

.todo-input-area {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.todo-input-area.v2-input {
  margin-bottom: 12px;
  margin-top: 4px;
}

#newTodoInput,
#newTodoInputToday,
#newTodoInputInbox {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

#newTodoInput:focus,
#newTodoInputToday:focus,
#newTodoInputInbox:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

.todo-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  transition: background 0.2s;
}

.todo-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.todo-list-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}

.todo-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.todo-item {
  display: grid;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  grid-template-columns: 24px 1fr auto auto; /* Checkbox | Text | Pomo | Controls */
  grid-template-rows: auto auto; /* Main Row | Meta Row (if needed) */
  position: relative;
}

.todo-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  opacity: 0.5;
}

.todo-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  grid-column: 1;
  margin: 0;
}

.todo-checkbox:checked {
  background: #aab;
  border-color: #aab;
}

.todo-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #222;
}

.todo-text {
  flex: 1;
  font-size: 14px;
  word-break: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-delete-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: rgba(255, 80, 80, 0.8);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  transition: opacity 0.2s;
}

.todo-item:hover .todo-delete-btn {
  opacity: 1;
}

.todo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.text-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 12px;
}

.text-btn:hover {
  color: #fff;
  text-decoration: underline;
}

/* Scrollbar for todo list */
.todo-list-container::-webkit-scrollbar {
  width: 6px;
}
.todo-list-container::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}
.todo-list-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* Todo Item Active Task */
.todo-item.active-task {
  border: 1px solid rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08); /* Red tint for focus */
}

.todo-focus-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: rgba(255, 200, 100, 0.9);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  transition: opacity 0.2s;
}

.todo-item:hover .todo-focus-btn {
  opacity: 0.7;
}

.todo-focus-btn:hover {
  opacity: 1 !important;
}

.todo-focus-btn:disabled {
  display: none;
}

.pomodoro-badge {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Active task indicator in pomodoro panel */
.active-task-indicator {
  display: flex;
  align-items: center;
  gap: 6px;            /* Tighter gap */
  padding: 8px 12px;   /* More compact padding */
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08); /* More subtle border */
  border-radius: 10px;
  margin-top: 16px;    /* Space from controls above */
  margin-bottom: 8px;  /* Space from settings below */
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  flex-direction: column;
}

.active-task-indicator .task-label {
  opacity: 0.6;
  font-size: 11px;
}

.active-task-indicator .task-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-task-indicator .clear-task-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
}

.active-task-indicator .clear-task-btn:hover {
  color: #fff;
}

.todo-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px; /* Space for scrollbar */
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.todo-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.todo-scroll-area::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}
.todo-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* Sections */
.todo-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-right: 8px;
}

.section-info {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  margin: 4px 0;
}

.todo-item.completed {
  opacity: 0.6;
}

/* Task Text & Unplanned Label */
.todo-content-wrapper {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.todo-meta-badges {
  display: flex;
  gap: 6px;
}

.badge-unplanned {
  font-size: 10px;
  background: rgba(255, 80, 80, 0.2);
  color: #ff6b6b;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
}

/* Pomodoro Estimation & Tracking */
.pomodoro-track {
  grid-column: 3;
  display: flex;
  gap: 3px;
  align-items: center;
}

.pomo-box { /* Estimation [ ] */
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  position: relative;
}

.pomo-box.filled::after { /* Completed [x] */
  content: '×';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ff6b6b;
  font-size: 14px;
  line-height: 1;
  font-weight: bold;
}

.pomo-circle { /* Overhead ( ) */
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  position: relative;
}

.pomo-circle.filled::after { /* Completed (x) */
  content: '×';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ff6b6b;
  font-size: 14px;
  line-height: 1;
}

.pomo-add-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  margin-left: 2px;
}
.pomo-add-btn:hover { color: #fff; }

/* Interruptions */
.interruption-track {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  grid-column: 2 / 5; /* Span across */
  font-family: monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.int-icon {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.int-icon:hover { opacity: 1; color: #fff; }

.int-count-internal::before { content: "Internal: "; opacity: 0.6; }
.int-count-external::before { content: "External: "; opacity: 0.6; }

/* Action Buttons (Move, Delete) */
.todo-actions {
  grid-column: 4;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.todo-item:hover .todo-actions {
  opacity: 1;
}

.action-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.action-btn.btn-delete:hover { color: #ff6b6b; }
.action-btn.btn-up:hover { color: #4ade80; }


.active-task-indicator.has-task {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Top Row: Icon + Name + Close */
.active-task-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;
}

.active-task-label-icon {
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.active-task-name-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0; /* Enable flex truncation */
  line-height: normal;
}

.active-task-name-text.empty {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  font-weight: 400;
}

.active-task-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  margin-right: -4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s;
}
.active-task-close-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 255, 255, 0.1);
}

/* Bottom Row: Tomatoes + Quick Actions */
.active-task-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.active-task-pomo-track {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Override token size for this panel */
.active-task-pomo-track .pomo-token {
  width: 14px;
  height: 14px;
}

.active-task-int-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.active-task-int-btns .int-btn {
  padding: 2px 8px;
  font-size: 10px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.int-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.int-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.int-btn.internal:hover {
  border-color: rgba(255, 200, 100, 0.5);
  color: #ffc864;
}
.int-btn.external:hover {
  border-color: rgba(100, 200, 255, 0.5);
  color: #64c8ff;
}

/* Pulse animation for active task when pomodoro is running */
.active-task-indicator.running {
  animation: task-pulse 2s ease-in-out infinite;
}

@keyframes task-pulse {
  0%, 100% { border-color: rgba(255, 107, 107, 0.25); }
  50% { border-color: rgba(255, 107, 107, 0.5); }
}

/* --- 2.0 Redesign: Visual & Intuitive --- */

/* Remove default list bullets */
.todo-items-v2 {
  list-style: none;
  padding-left: 0;
}

/* 1. Pomodoro Tokens (Replacement for [] and ()) */
.pomo-token-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.pomo-token {
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: help;
}

/* Empty Token (Estimation) - Grey Outline Tomato */
.pomo-token.est {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3Cpath d='M12 2v2'/%3E%3Cpath d='M12 22v-2'/%3E%3Cpath d='M2 12h2'/%3E%3Cpath d='M20 12h2'/%3E%3C/svg%3E");
  opacity: 0.6;
}

/* Completed Token - Red Tomato */
.pomo-token.done {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23ff6b6b' d='M16 4C9.37 4 4 9.37 4 16s5.37 12 12 12 12-5.37 12-12S22.63 4 16 4z'/%3E%3Cpath fill='%232ecc71' d='M16 2c-1 0-3 2-3 4h6c0-2-2-4-3-4z'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 4px rgba(255, 107, 107, 0.3));
  transform: scale(1.1);
}

/* Add Button (+ Tomato) */
.pomo-add-btn-v2 {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  margin-left: 4px;
}
.pomo-add-btn-v2:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ff6b6b;
  border-color: #ff6b6b;
}

/* 2. Visual Interruption Counters */
.int-badges {
  display: flex;
  gap: 8px;
  margin-left: auto; /* Push to right just before controls/pomo tokens */
}

.int-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.int-badge:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.int-icon-img {
  font-style: normal;
  font-size: 14px;
}

/* 3. Section Headers Redesign */
.section-header-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  margin-top: 8px;
  color: #fff;
}

.section-icon {
  font-size: 18px;
}

.section-title-v2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.section-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  opacity: 0.6;
}

/* 4. Improved Card Layout */
.todo-item-v2 {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.todo-item-v2:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.todo-item-v2.active-task {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 107, 107, 0.05) 100%);
  border-color: rgba(255, 107, 107, 0.4);
}

.todo-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.todo-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* Custom Checkbox */
.checkbox-v2 {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox-v2:hover { border-color: #fff; }

.checkbox-v2.checked {
  background: #4ade80;
  border-color: #4ade80;
}

.checkbox-v2.checked::after {
  content: '✓';
  color: #000;
  font-weight: bold;
  font-size: 12px;
}

.todo-text-v2 {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.todo-text-v2.completed {
  text-decoration: line-through;
  opacity: 0.5;
}

/* 5. Quick Actions overlay on hover */
.todo-hover-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

.todo-item-v2:hover .todo-hover-actions {
  opacity: 1;
}

.hover-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.hover-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
}
.hover-btn.delete:hover { background: rgba(255, 80, 80, 0.3); color: #ff6b6b; }
.hover-btn.focus:hover { background: rgba(255, 200, 100, 0.3); color: #ffc864; }


/* Breathing Panel */
#breathingPanel {
  position: fixed;
  bottom: 80px;
  right: 12px;
  width: 380px;
  background: rgba(15, 15, 25, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  z-index: 1000;
  color: #fff;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  transform-origin: bottom right;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#breathingPanel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
}

.breathing-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 16px;
}

.breathing-content {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.breathing-circle-container {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Guide ring (static reference) */
.breathing-guide-ring {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

@property --c1 {
  syntax: '<color>';
  inherits: false;
  initial-value: rgba(180, 130, 255, 0.9);
}

@property --c2 {
  syntax: '<color>';
  inherits: false;
  initial-value: rgba(120, 80, 200, 0.8);
}

.breathing-circle {
  width: 60px;
  height: 60px;
  /* Default/Exhale color: Purple/Blue (Cool) */
  --c1: rgba(180, 130, 255, 0.9);
  --c2: rgba(120, 80, 200, 0.8);
  background: radial-gradient(circle at 30% 30%, var(--c1), var(--c2));
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(150, 100, 255, 0.4);
  transform: scale(1);
  /* Duration is set by JS per step */
  transition-property: transform, box-shadow, --c1, --c2;
  will-change: transform, box-shadow, --c1, --c2;
  /* Flex for centering text inside */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* States */
.breathing-circle.inhale {
  transform: scale(3.3);
  /* Inhale: Brighter, slightly cyan/white (Energy/Air) */
  --c1: rgba(200, 240, 255, 0.95);
  --c2: rgba(100, 200, 255, 0.85);
  background: radial-gradient(circle at 30% 30%, var(--c1), var(--c2));
  box-shadow: 0 0 30px rgba(150, 220, 255, 0.6);
}

.breathing-circle.hold {
  transform: scale(3.3);
  /* Hold: Steady, slightly warmer or just stable */
  --c1: rgba(255, 220, 250, 0.95);
  --c2: rgba(200, 150, 220, 0.9);
  background: radial-gradient(circle at 30% 30%, var(--c1), var(--c2));
  box-shadow: 0 0 25px rgba(200, 150, 255, 0.5);
}

.breathing-circle.exhale {
  transform: scale(1);
  /* Exhale: Back to default */
  --c1: rgba(180, 130, 255, 0.9);
  --c2: rgba(120, 80, 200, 0.8);
  background: radial-gradient(circle at 30% 30%, var(--c1), var(--c2));
  box-shadow: 0 0 20px rgba(150, 100, 255, 0.4);
}

.breathing-controls-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.breathing-instruction {
  font-size: 24px;
  font-weight: 300;
  min-height: 36px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  font-family: 'Montserrat', system-ui, sans-serif;
}

.breathing-mode-description {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  text-align: center;
}

.breathing-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.breathing-mode-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.breathing-mode-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
}

.breathing-mode-btn.active {
  background: rgba(180, 130, 255, 0.3);
  border-color: rgba(180, 130, 255, 0.5);
  box-shadow: 0 0 10px rgba(180, 130, 255, 0.2);
}

.breathing-mode-btn.active:hover {
  background: rgba(180, 130, 255, 0.4);
  box-shadow: 0 0 14px rgba(180, 130, 255, 0.3);
}

.breathing-main-btn {
  width: 100%;
  display: flex;
  justify-content: center;
}

.breathing-action-btn {
  background: linear-gradient(135deg, #7c4dff 0%, #512da8 100%);
  border: none;
  padding: 10px 32px;
  border-radius: 24px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 77, 255, 0.3);
  transition: all 0.2s ease;
}

.breathing-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.4);
}

.breathing-action-btn:active {
  transform: translateY(0);
}

.breathing-action-btn.stop {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.breathing-action-btn.stop:hover {
  background: rgba(255, 255, 255, 0.2);
}

.breathing-action-btn.hidden {
  display: none;
}

.breathing-circle-text {
  /* Positioned by flex in parent now, but absolute still works if we want precise control. 
     Since parent has scale transform, this text will scale with it. 
     We can remove absolute positioning to rely on flex centering. */
  position: static;
  transform: none;
  font-size: 14px; /* Slightly smaller base since it scales up 3.3x */
  font-weight: 600;
  color: #fff;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  /* Ensure text doesn't look blurry when scaled? 
     Actually scale transform might make it blurry in some browsers. 
     But let's assume it's fine for this effect. */
}

.breathing-mode-description-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  max-width: 300px;
}

.breathing-mode-rhythm {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.breathing-mode-detail {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  line-height: 1.4;
}

/* Breathing Panel Responsive */
@media (max-width: 1000px) {
  #breathingPanel {
    width: 95vw;
    max-width: 550px;
    bottom: 70px;
    right: 2.5vw;
    min-width: 300px;
    height: auto;
    max-height: 70vh;
  }

  #breathingPanel.hidden {
    transform: scale(0.95);
  }

  .breathing-content {
    padding: 16px;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
  }

  .breathing-circle-container {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
  }

  .breathing-guide-ring {
    width: 140px;
    height: 140px;
  }

  .breathing-circle {
    width: 42px;
    height: 42px;
  }

  .breathing-circle.inhale,
  .breathing-circle.hold {
    transform: scale(3.3);
  }

  .breathing-circle-text {
    font-size: 11px;
  }

  .breathing-controls-area {
    flex: 1;
    min-width: 0;
    gap: 10px;
  }

  .breathing-instruction {
    font-size: 18px;
    min-height: 28px;
  }

  .breathing-mode-description-container {
    max-width: 100%;
    gap: 3px;
  }

  .breathing-mode-rhythm {
    font-size: 11px;
  }

  .breathing-mode-detail {
    font-size: 10px;
    line-height: 1.3;
  }

  .breathing-modes {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .breathing-mode-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 11px;
  }

  .breathing-action-btn {
    width: 100%;
    max-width: none;
    padding: 8px 24px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .breathing-circle-container {
    width: 120px;
    height: 120px;
  }

  .breathing-guide-ring {
    width: 120px;
    height: 120px;
  }

  .breathing-circle {
    width: 36px;
    height: 36px;
  }

  .breathing-instruction {
    font-size: 16px;
  }

  .breathing-mode-btn {
    font-size: 10px;
    padding: 5px 6px;
  }
}

/* Sync Panel Styles */
.settings-content-inner {
  padding: 0 10px;
}
.settings-content-inner.sekai-hidden {
  display: none;
}
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.05);
  padding: 16px;
  border-radius: 12px;
}
.user-avatar-circle {
  width: 48px;
  height: 48px;
  background: #64b5f6;
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px;
}
.user-details {
  flex: 1;
  overflow: hidden;
}
.user-name {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-status-box {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}
.status-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.status-label {
  color: rgba(255,255,255,0.6);
}
.status-value {
  color: #fff;
  font-family: monospace;
}
.settings-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-actions .primary-btn {
  padding: 12px;
  font-size: 15px;
}

.settings-actions-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.settings-actions-row button {
  flex: 1;
  margin-top: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.full-width {
  width: 100%;
}


/* Notification System */
#sekai-notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
  width: 100%;
  pointer-events: none;
}

.sekai-notification {
  background: rgba(20, 20, 25, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  overflow: hidden;
  position: relative;
}

.sekai-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.sekai-notification::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: currentColor;
  opacity: 0.7;
}

.sekai-notification-success { color: #4ade80; }
.sekai-notification-error { color: #f87171; }
.sekai-notification-warning { color: #facc15; }
.sekai-notification-info { color: #60a5fa; }

.sekai-notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sekai-notification-icon svg {
  width: 20px;
  height: 20px;
}

.sekai-notification-content {
  color: #e5e5e5;
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
  word-break: break-word;
}

.sekai-notification-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px;
  margin: -4px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sekai-notification-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 480px) {
  #sekai-notification-container {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    width: auto;
  }
  
  .sekai-notification {
    transform: translateY(-20px);
  }
  
  .sekai-notification.show {
    transform: translateY(0);
  }
}

/* Modal System */
.sekai-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  opacity: 1;
}

.sekai-modal-overlay.sekai-hidden {
  opacity: 0;
  pointer-events: none;
}

.sekai-modal {
  background: rgba(25, 25, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sekai-modal-overlay.sekai-hidden .sekai-modal {
  transform: scale(0.95);
}

.sekai-modal-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.sekai-modal-content {
  color: #ccc;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.sekai-modal-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px;
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

.sekai-modal-input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.5);
}

.sekai-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.sekai-modal-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.sekai-modal-btn-cancel {
  background: transparent;
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sekai-modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sekai-modal-btn-confirm {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sekai-modal-btn-confirm:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Playlist Import Dialog */
.import-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-overlay.hidden {
  display: none;
}

.import-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(40, 20, 60, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 10001;
  overflow: hidden;
}

.import-dialog.hidden {
  display: none;
}

.import-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.import-dialog-header h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}

.import-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.import-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.import-dialog-body {
  padding: 20px;
}

.server-select {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.server-select-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.server-select-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.server-select-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4));
  border-color: rgba(99, 102, 241, 0.6);
}

.server-select-btn.active:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(168, 85, 247, 0.5));
  transform: translateY(-1px);
}

.server-select-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.import-input-group {
  margin-bottom: 16px;
}

#playlistUrlInput {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

#playlistUrlInput:focus {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(0, 0, 0, 0.4);
}

#playlistUrlInput:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.import-hint {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

.import-error-msg {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 6px;
  color: #ff6b6b;
  font-size: 13px;
  margin-bottom: 12px;
}

.import-error-msg.hidden {
  display: none;
}

.import-progress-msg {
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 6px;
  color: #a5b4fc;
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}

.import-progress-msg.hidden {
  display: none;
}

.import-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.import-btn-secondary,
.import-btn-primary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.import-btn-secondary {
  background: transparent;
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.import-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.import-btn-primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6));
  color: #fff;
  border: 1px solid rgba(99, 102, 241, 0.6);
}

.import-btn-primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.7), rgba(168, 85, 247, 0.7));
  transform: translateY(-1px);
}

.import-btn-primary:disabled,
.import-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Platform Badge */
.platform-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 14px;
  opacity: 0.8;
}

/* Save to Local Button */
.save-to-local-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.7;
  transition: all 0.2s;
}

.save-to-local-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}
