/* Musical PWA - Styles */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #141419;
  --bg-tertiary: #1c1c24;
  --bg-elevated: #242430;
  
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-tertiary: #606070;
  
  --accent: #ff2d55;
  --accent-glow: rgba(255, 45, 85, 0.3);
  --accent-secondary: #ff6b8a;
  
  --success: #30d158;
  --warning: #ffd60a;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  --player-height: 72px;
  --nav-height: 70px;
  
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(255, 45, 85, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(88, 86, 214, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* Main Content */
.main {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom));
}

.view {
  display: none !important;
  position: absolute;
  inset: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 16px;
  padding-top: calc(var(--safe-area-top) + 16px);
}

.view.active {
  display: block !important;
}

/* View Header */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 8px;
}

.view-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-icon {
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.version-badge {
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.version-badge:hover {
  background: var(--bg-elevated);
}

/* Bottom Navigation - Always at bottom */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  z-index: 200;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 24px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  height: var(--nav-height);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s;
}

.nav-item:active svg {
  transform: scale(0.9);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active svg {
  stroke: var(--accent);
}

/* Adjust content when player is active */
body.player-active .main {
  padding-bottom: calc(var(--nav-height) + var(--player-height) + var(--safe-area-bottom));
}

/* Search */
.search-container {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-bottom: 16px;
  background: linear-gradient(to bottom, var(--bg-primary) 80%, transparent);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 0 16px;
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 14px 12px;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-tertiary);
}

.search-clear {
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Results */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.video-card:hover {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.05);
}

.video-card:active {
  transform: scale(0.98);
}

.video-card.playing {
  border-color: var(--accent);
  background: rgba(255, 45, 85, 0.08);
}

.video-thumb {
  width: 100px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.video-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.video-duration {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

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

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.search-tip {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-tip .tip-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 4px 0;
}

.search-tip code {
  display: block;
  padding: 10px 14px;
  margin: 8px 0;
  background: var(--bg-primary);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Playlists Grid */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.playlist-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  position: relative;
}

.playlist-card:hover {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.playlist-card .btn-delete-playlist {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 45, 85, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.playlist-card .btn-delete-playlist svg {
  width: 14px;
  height: 14px;
  stroke: white;
}

.playlist-card:hover .btn-delete-playlist {
  opacity: 1;
}

.playlist-card .btn-delete-playlist:hover {
  background: var(--accent);
  transform: scale(1.1);
}

/* Default playlist badge */
.playlist-card.default-playlist::before {
  content: '★';
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.75rem;
  color: var(--accent);
}

.playlist-cover {
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
}

.playlist-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Playlist Detail */
.playlist-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-info {
  flex: 1;
}

.playlist-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.playlist-tracks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Settings */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.settings-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.setting-option:hover {
  background: var(--bg-elevated);
}

.setting-option.active {
  border-color: var(--accent);
  background: rgba(255, 45, 85, 0.1);
}

.setting-option-icon {
  font-size: 1.25rem;
}

.setting-option-text {
  flex: 1;
  text-align: left;
}

.setting-option-check {
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.setting-option.active .setting-option-check {
  opacity: 1;
}

/* About Card */
.about-card {
  text-align: center;
  padding: 20px 0;
}

.about-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.about-logo .logo-icon {
  font-size: 2rem;
}

.about-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.about-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.about-version {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* Buttons */
.btn-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-elevated);
}

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

.btn-icon.btn-danger {
  background: rgba(255, 45, 85, 0.2);
  color: var(--accent);
}

.btn-icon.btn-danger:hover {
  background: var(--accent);
  color: white;
}

.playlist-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-back {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-back svg {
  width: 24px;
  height: 24px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--accent-secondary);
}

/* Player Bar - Sits above navbar */
.player-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-area-bottom));
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 150;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.player-progress {
  height: 3px;
  background: var(--bg-tertiary);
  position: relative;
}

.cache-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  width: 0%;
  transition: width 0.3s ease-out;
}

.progress-bar {
  position: relative;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  width: 0%;
  transition: width 0.1s linear;
}

.player-content {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
}

.player-track {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.player-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-tertiary);
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-title {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.control-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.control-btn:hover {
  background: var(--bg-tertiary);
}

.control-btn svg {
  width: 20px;
  height: 20px;
}

.play-btn {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: white;
}

.play-btn:hover {
  background: var(--accent-secondary);
  transform: scale(1.05);
}

/* Play/Pause icon visibility */
.play-btn .play-icon,
.play-btn .pause-icon {
  display: block;
}

.play-btn .play-icon[hidden],
.play-btn .pause-icon[hidden] {
  display: none !important;
}

/* Player bar favorite button */
.player-bar .favorite-btn {
  color: var(--text-secondary);
  transition: color 0.2s, transform 0.2s;
}

.player-bar .favorite-btn .heart-outline {
  display: block;
}

.player-bar .favorite-btn .heart-filled {
  display: none;
}

.player-bar .favorite-btn:hover {
  color: var(--accent);
}

.player-bar .favorite-btn.is-favorite {
  color: var(--accent);
}

.player-bar .favorite-btn.is-favorite .heart-outline {
  display: none;
}

.player-bar .favorite-btn.is-favorite .heart-filled {
  display: block;
}

.player-bar .favorite-btn:active {
  transform: scale(0.9);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none !important;
  align-items: flex-end;
  justify-content: center;
}

.modal[style*="display: flex"],
.modal[style*="display:flex"] {
  display: flex !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 70vh;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(70vh - 80px);
}

.playlist-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.playlist-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.95rem;
}

.playlist-option:hover {
  background: var(--bg-elevated);
}

.btn-new-playlist {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: none;
  border: 2px dashed var(--text-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-new-playlist:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-new-playlist svg {
  width: 20px;
  height: 20px;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 16px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--player-height) + 20px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast span {
  font-size: 0.9rem;
}

.toast button {
  background: var(--accent);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
}

.loading-overlay[style*="display: flex"],
.loading-overlay[style*="display:flex"] {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Hidden elements */
[hidden] {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-elevated);
}

/* Cached indicator */
.cached-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success);
  color: var(--bg-primary);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Delete button */
.btn-delete {
  width: 32px;
  height: 32px;
  background: rgba(255, 59, 48, 0.15);
  border: none;
  border-radius: var(--radius-sm);
  color: #ff3b30;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-delete:hover {
  background: rgba(255, 59, 48, 0.25);
}

.btn-delete svg {
  width: 16px;
  height: 16px;
}

/* Hidden YouTube Player */
#ytPlayerContainer {
  position: fixed;
  bottom: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Categories */
.categories-container {
  padding: 8px 0;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.category-card {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(255, 45, 85, 0.2);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.category-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.hint-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Player Time Display */
.player-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* Make player bar clickable */
.player-content {
  cursor: pointer;
}

/* ========== Full Screen Player ========== */
.fullscreen-player {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.4s;
  padding: calc(var(--safe-area-top) + 20px) 24px calc(var(--safe-area-bottom) + 20px);
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.fullscreen-player.is-open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0s;
}

/* Header */
.fs-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  flex-shrink: 0;
}

.fs-close-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.fs-close-btn:hover {
  opacity: 1;
}

.fs-close-btn svg {
  width: 24px;
  height: 24px;
}

.fs-now-playing {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.fs-header-spacer {
  width: 40px;
}

/* Artwork */
.fs-artwork-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  flex-shrink: 0;
}

.fs-artwork {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  background: var(--bg-elevated);
}

.fs-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Track Info */
.fs-track-info {
  padding: 16px 0 12px;
  flex-shrink: 0;
  text-align: center;
}

.fs-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.fs-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.fs-artist {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-favorite-btn {
  background: none;
  border: none;
  color: var(--accent);
  padding: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.fs-favorite-btn:active {
  transform: scale(0.9);
}

.fs-favorite-btn svg {
  width: 28px;
  height: 28px;
}

.fs-favorite-btn .heart-outline {
  display: block;
}

.fs-favorite-btn .heart-filled {
  display: none;
}

.fs-favorite-btn.is-favorite .heart-outline {
  display: none;
}

.fs-favorite-btn.is-favorite .heart-filled {
  display: block;
  color: var(--accent);
}

/* Progress */
.fs-progress-container {
  padding: 8px 0;
  flex-shrink: 0;
}

.fs-progress-bar {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: visible;
}

.fs-progress-slider {
  position: absolute;
  inset: -10px 0;
  width: 100%;
  height: 24px;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  -webkit-appearance: none;
}

.fs-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.fs-progress-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--text-primary);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

.fs-progress-bar:hover .fs-progress-fill::after,
.fs-progress-slider:active + .fs-progress-fill::after {
  opacity: 1;
}

.fs-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* Controls */
.fs-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
  flex-shrink: 0;
}

.fs-control-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 12px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.fs-control-btn:hover {
  opacity: 1;
}

.fs-control-btn:active {
  transform: scale(0.9);
}

.fs-control-btn svg {
  width: 24px;
  height: 24px;
}

.fs-control-btn.active {
  color: var(--accent);
  opacity: 1;
}

.fs-prev-btn svg, .fs-next-btn svg {
  width: 32px;
  height: 32px;
}

.fs-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--text-primary);
  border: none;
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fs-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.fs-play-btn:active {
  transform: scale(0.95);
}

.fs-play-btn svg {
  width: 32px;
  height: 32px;
}

.fs-play-btn .fs-play-icon {
  margin-left: 4px;
}

/* Fullscreen play/pause icon visibility */
.fs-play-btn .fs-play-icon,
.fs-play-btn .fs-pause-icon {
  display: block;
}

.fs-play-btn .fs-play-icon[hidden],
.fs-play-btn .fs-pause-icon[hidden] {
  display: none !important;
}

/* Secondary Controls */
/* Mode Controls (Shuffle, Repeat) */
.fs-mode-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
  flex-shrink: 0;
}

.fs-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  color: var(--text-secondary);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.fs-mode-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.fs-mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.fs-mode-btn svg {
  width: 18px;
  height: 18px;
}

.fs-mode-btn span {
  font-weight: 500;
}

/* Secondary Controls */
.fs-secondary-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
  flex-shrink: 0;
}

.fs-secondary-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  cursor: pointer;
  transition: color 0.2s;
}

.fs-secondary-btn:hover {
  color: var(--accent);
}

.fs-secondary-btn svg {
  width: 24px;
  height: 24px;
}

.fs-secondary-btn span {
  font-size: 0.7rem;
  font-weight: 500;
}

/* Queue Modal */
.queue-modal-content {
  max-height: 70vh;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.queue-item:hover {
  background: var(--bg-elevated);
}

.queue-item.playing {
  background: var(--accent);
  color: white;
}

.queue-item.playing .queue-item-artist {
  color: rgba(255, 255, 255, 0.8);
}

.queue-item-index {
  width: 24px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-align: center;
}

.queue-item.playing .queue-item-index {
  color: rgba(255, 255, 255, 0.7);
}

.queue-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-title {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-artist {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-height: 700px) {
  .fs-artwork {
    width: 140px;
    height: 140px;
  }
  
  .fs-track-info {
    padding: 12px 0 8px;
  }
  
  .fs-title {
    font-size: 1.125rem;
  }
  
  .fs-controls {
    padding: 12px 0;
    gap: 16px;
  }
  
  .fs-play-btn {
    width: 56px;
    height: 56px;
  }
  
  .fs-play-btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (min-width: 768px) {
  .fullscreen-player {
    padding: 32px 48px;
  }
  
  .fs-artwork {
    max-width: 400px;
  }
}
