:root {
  --bg-main: #0c0e14;
  --bg-surface: #141722;
  --bg-card: #1c2030;
  --bg-glass: rgba(28, 32, 48, 0.75);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --sidebar-width: 240px;
  --player-height: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

/* Desktop Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.server-status {
  font-size: 0.72rem;
  color: var(--accent);
  display: block;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: #a5b4fc;
  border-left: 3px solid var(--accent);
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* Buttons */
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.primary-btn:active {
  transform: scale(0.96);
}

.secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.active {
  color: var(--accent);
}

/* Favorite & Delete Buttons */
.love-btn {
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.love-btn:hover {
  color: #ef4444;
  transform: scale(1.18);
}

.love-btn.loved,
.love-btn.active {
  color: #ef4444 !important;
}

.love-btn.loved svg,
.love-btn.active svg {
  fill: #ef4444;
  stroke: #ef4444;
}

.delete-media-btn {
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.delete-media-btn:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.12);
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-weight: 500;
  margin-left: 6px;
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding-bottom: var(--player-height);
}

/* Top Search Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(12, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 5;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  max-width: 440px;
  flex: 1;
  color: var(--text-muted);
}

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

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  width: 100%;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Scrollable Views */
.content-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.view-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.view-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dropdown {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

/* Song List Rows */
.song-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.song-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  transition: background 0.15s ease;
  cursor: pointer;
}

.song-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.song-row.playing {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--accent);
}

.song-row.playing .song-title {
  color: #a5b4fc;
}

.song-cover-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--bg-card);
  flex-shrink: 0;
}

.song-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.song-duration {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Video Grid & Cards */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.video-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #11131c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-overlay {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.2s ease;
}

.video-card:hover .video-play-overlay {
  transform: scale(1.15);
  background: var(--accent);
}

.video-duration-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}

.video-details {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

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

.video-title {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.video-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Fullscreen Video Modal */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 300;
  display: flex;
  flex-direction: column;
}

.video-modal-overlay.hidden {
  display: none;
}

.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(12, 14, 20, 0.8);
  border-bottom: 1px solid var(--border-subtle);
}

.video-modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.video-modal-body video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  outline: none;
}

/* Downloader View */
.downloader-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.downloader-card .input-group input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
}

.downloader-card .input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.downloader-options {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.format-toggle {
  display: flex;
  gap: 12px;
  background: var(--bg-surface);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
}

.toggle-option input[type="radio"]:checked + span {
  color: var(--accent);
}

.downloads-section h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.download-task-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.task-status-badge.completed { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.task-status-badge.downloading { background: rgba(99, 102, 241, 0.2); color: #6366f1; }
.task-status-badge.failed { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.download-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.download-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.2s ease;
}

/* Settings & Privacy View */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.setting-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.setting-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 460px;
}

.inline-edit {
  display: flex;
  gap: 8px;
}

.inline-edit input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .3s;
  border-radius: 28px;
}

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

input:checked + .slider {
  background: var(--accent-gradient);
}

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

/* Shared Folder Items */
.shared-folders-section .section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.folder-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.folder-path {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Wi-Fi Peers List */
.peers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.peer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.peer-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.peer-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.peer-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Grids for Artists & Albums */
.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.media-card:hover {
  transform: translateY(-4px);
  background: #23283c;
}

.media-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #2a2e42;
}

.media-card.artist-card .media-card-img {
  border-radius: var(--radius-full);
}

.media-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Mini Player */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background: rgba(20, 23, 34, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.mini-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.mini-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
}

.mini-player-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mini-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-card);
}

.mini-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mini-title {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.play-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--bg-main);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Full Audio Player Overlay */
.full-player-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s ease;
}

.full-player-overlay.open {
  visibility: visible;
  opacity: 1;
}

.full-player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 20, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.full-player-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 24px calc(24px + env(safe-area-inset-bottom));
}

.full-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.full-player-header-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.full-player-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 10px 0;
}

.artwork-card {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1/1;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  background: var(--bg-card);
}

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

.track-meta {
  text-align: left;
  margin: 12px 0 6px;
}

.track-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.track-text p {
  font-size: 1rem;
  color: var(--text-secondary);
}

.track-text .album-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seek-slider-container {
  width: 100%;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.playback-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

.main-play-btn {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--accent-glow);
  cursor: pointer;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: var(--text-muted);
}

.queue-panel {
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.queue-panel.hidden {
  display: none;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.queue-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.placeholder-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 12px 0;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-only {
  display: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    padding-bottom: calc(var(--player-height) + 64px + env(safe-area-inset-bottom));
  }

  .mobile-only {
    display: inline-flex;
  }

  .library-stats {
    display: none;
  }

  .top-bar {
    padding: 12px 16px;
  }

  .content-scrollable {
    padding: 16px;
  }

  .view-header h1 {
    font-size: 1.4rem;
  }

  .mini-player {
    bottom: calc(56px + env(safe-area-inset-bottom));
    padding: 0 16px;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(12, 14, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 90;
  }

  .bottom-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
  }

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

  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* My Device / My Files Dashboard Styles */
.my-device-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.12) 50%, rgba(20, 23, 34, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.device-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 10px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.my-device-hero h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: #ffffff;
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 620px;
}

/* Quick Navigation Cards */
.device-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.quick-nav-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.quick-nav-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.quick-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-share .quick-card-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.card-local .quick-card-icon {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.card-mesh .quick-card-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.quick-card-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.quick-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.quick-action-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.85rem;
  padding: 8px 14px;
  pointer-events: none;
}

/* My Media Section */
.my-media-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-heading-row h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Scope Pill Tabs */
.scope-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.scope-tab {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.scope-tab:hover {
  color: var(--text-primary);
}

.scope-tab.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.peer-scope-dropdown {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.18s ease;
  height: 31px;
}

.peer-scope-dropdown:hover, .peer-scope-dropdown:focus {
  border-color: var(--accent);
  color: var(--text-primary);
}

.peer-scope-dropdown.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}


.local-track-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  font-weight: 600;
  margin-left: 6px;
}

.share-track-now-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}

.share-track-now-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   Photos & Gallery Styles
   ========================================================================== */
.photos-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 60px;
}

.photo-timeline-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-timeline-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.photo-timeline-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.photo-timeline-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

.photo-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid var(--border-subtle);
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.photo-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
}

.photo-card:hover .photo-card-overlay {
  opacity: 1;
}

.photo-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #a5b4fc;
  align-self: flex-start;
}

/* ==========================================================================
   Fullscreen Photo Lightbox
   ========================================================================== */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.94);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index: 10;
}

.lightbox-title-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lightbox-title-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.lightbox-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

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

.lightbox-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 10px;
}

.lightbox-img {
  max-width: 94vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s ease;
  user-select: none;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* ==========================================================================
   Pending Uploads (Approval Queue)
   ========================================================================== */
.pending-uploads-card {
  background: var(--bg-surface);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
}

.pending-uploads-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pending-uploads-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fbbf24;
}

.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  gap: 12px;
}

.pending-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.pending-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.pending-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.approve-btn {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.approve-btn:hover {
  opacity: 0.88;
}

.reject-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.reject-btn:hover {
  opacity: 0.88;
}

/* ==========================================================================
   Destination & External Player Helpers
   ========================================================================== */
.destination-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.vlc-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
  text-decoration: none;
  transition: all 0.15s ease;
}

.vlc-play-btn:hover {
  background: #ea580c;
  color: #ffffff;
}


