:root {
  color-scheme: dark;
}
body {
  background-color: #0b0b0d;
  background-image: radial-gradient(circle at 25% 15%, rgba(155, 92, 255, 0.1), transparent 40%),
                    radial-gradient(circle at 75% 85%, rgba(155, 92, 255, 0.08), transparent 40%);
  overflow-x: hidden;
}
* {
  box-sizing: border-box;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

.grid {
  width: 100%;
  overflow: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  color: #d6d6d6;
  font-weight: 600;
  transition: all .2s ease;
  font-size: 14px;
}
.nav-link:hover { 
  background: rgba(255,255,255,.08); 
  color: #fff; 
  transform: translateX(2px);
}

.chip {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(155,92,255,.15);
  border: 1px solid rgba(155,92,255,.35);
  color: #d9c9ff;
  transition: all .2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.chip:hover {
  background: rgba(155,92,255,.25);
  transform: translateY(-1px);
}

.card {
  position: relative;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 auto;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  cursor: pointer;
}
.card:hover { 
  background: rgba(255,255,255,.08);
  transform: translateY(-4px); 
  box-shadow: 0 12px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(155,92,255,.2);
}

.card .meta { 
  padding: 14px; 
}
.card .meta .text-sm {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.card .meta .text-xs {
  font-size: 12px;
  margin-bottom: 12px;
}

.btn-add {
  display: flex; 
  align-items: center; 
  justify-content: center;
  gap: 6px; 
  width: 100%;
  background: #9b5cff; 
  color: #0b0b0d;
  border-radius: 12px; 
  padding: 10px 12px; 
  font-weight: 700;
  font-size: 13px;
  transition: all .2s ease;
  transform: translateY(8px);
  opacity: 0;
  visibility: hidden;
}
.card:hover .btn-add {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
.btn-add:hover { 
  background: #a569ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(155,92,255,.3);
}

.top-track-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background-color: rgba(155, 92, 255, 0.15);
  border: 1px solid rgba(155, 92, 255, 0.3);
  color: #cbb3ff;
  transition: all 0.25s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.top-track-add-btn:hover {
  background-color: rgba(155, 92, 255, 1);
  color: #0b0b0d;
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(155, 92, 255, 0.6);
}
.top-track-add-btn svg:first-child {
  transition: transform 0.25s ease;
}
.top-track-add-btn svg:last-child {
  position: absolute;
  transform: translateX(20px);
  transition: transform 0.25s ease;
}
.top-track-add-btn:hover svg:first-child {
  transform: translateX(-20px);
}
.top-track-add-btn:hover svg:last-child {
  transform: translateX(0);
}

.pager {
  font-size: 13px; 
  padding: 8px 14px; 
  border-radius: 10px;
  background: rgba(255,255,255,.06); 
  border: 1px solid rgba(255,255,255,.1);
  transition: all 0.2s ease;
  font-weight: 500;
}
.pager:hover { 
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.badge-you { 
  font-size: 10px; 
  padding: 2px 6px; 
  border-radius: 999px; 
  background: rgba(155, 92, 255, 0.18); 
  border: 1px solid rgba(155, 92, 255, 0.35); 
  color: #cbb3ff; 
  vertical-align: middle;
}

.badge-admin {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #a0aec0; /* gray-400 */
  vertical-align: middle;
}

.pager:disabled,
#searchBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: saturate(0.5);
}

.modal-backdrop {
  position:fixed; 
  inset:0; 
  background:rgba(0,0,0,.6); 
  backdrop-filter: blur(6px);
  display:flex; 
  align-items:center; 
  justify-content:center; 
  z-index:50;
}
.modal-sheet {
  width:100%; 
  max-width:520px; 
  background:#0f0f12;
  border:1px solid rgba(255,255,255,.1); 
  border-radius:16px; 
  overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(155,92,255,.2);
}
.modal-head { 
  padding:14px 16px; 
  border-bottom:1px solid rgba(255,255,255,.08); 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
}
.modal-body { 
  padding:16px; 
}
.modal-actions { 
  padding:12px 16px; 
  border-top:1px solid rgba(255,255,255,.08); 
  display:flex; 
  justify-content:flex-end; 
  gap:8px; 
}
.btn {
  padding:8px 12px; 
  border-radius:10px; 
  border:1px solid rgba(255,255,255,.12); 
  background:rgba(255,255,255,.06);
}
.btn:hover { 
  background:rgba(255,255,255,.1); 
}
.btn-primary { 
  background:#9b5cff; 
  border-color:#9b5cff; 
  color:#0b0b0d; 
  font-weight:700; 
}
.btn-primary:hover { 
  filter:brightness(1.05); 
}

.btn-danger {
  background-color: #dc2626; /* red-600 */
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.btn-danger:hover {
  background-color: #b91c1c; /* red-700 */
}

.mobile-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background-color: rgba(155, 92, 255, 0.9);
  color: #0b0b0d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  transition: all 0.2s ease-in-out;
}
.mobile-fab:hover {
  transform: scale(1.05);
  background-color: rgba(155, 92, 255, 1);
}
#mobileLoginBtn {
  background-color: rgba(30, 30, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
#mobileLoginBtn:hover {
  background-color: rgba(45, 45, 48, 1);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(155, 92, 255, 0.3);
  display: inline-block;
  background: linear-gradient(135deg, #fff, #cbb3ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Admin Chart Filters */
.chart-filter-btn {
  padding: 6px 12px;
  border-radius: 8px;
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.chart-filter-btn:hover {
  background-color: rgba(255,255,255,0.1);
}
.chart-filter-btn.active {
  background-color: #9b5cff;
  color: #0b0b0d;
  border-color: #9b5cff;
}

/* Admin User Action Buttons */
.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-action {
  background-color: rgba(255,255,255,0.1);
}
.btn-action:hover {
  background-color: rgba(255,255,255,0.2);
}
.btn-danger.btn-sm {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.btn-danger.btn-sm:hover {
   background-color: rgba(239, 68, 68, 0.25);
   color: #fff;
}

.btn-sm.btn-action {
    background-color: rgba(255, 255, 255, 0.1);
}
.btn-sm.btn-action:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness improvements */
@media (max-width: 640px) {
  .section-title {
    font-size: 1.5rem;
  }
  
  .card .meta {
    padding: 12px;
  }
  
  .card .thumb {
    aspect-ratio: 16/10;
  }
  
  .mobile-fab {
    width: 60px;
    height: 60px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  }
  
  #queue-sidebar {
    width: 100vw;
    max-width: 100vw;
  }
  
  #sidebar {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .grid.lg\\:grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Enhanced queue styling */
#queue-sidebar {
  background: rgba(11, 11, 13, 0.85);
  backdrop-filter: blur(12px);
}

#queue-sidebar .bg-white\/5 {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Better top tracks layout */
.group.flex.items-center.gap-4 {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}
.group.flex.items-center.gap-4:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 92, 255, 0.2);
  transform: translateY(-1px);
}

/* Enhanced artist list */
#topArtists li {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
#topArtists li:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 92, 255, 0.2);
  transform: translateY(-1px);
}

.scroll-row {
  display: flex;
  gap: 12px;
  overflow: auto;
  padding-bottom: 4px;
}
.scroll-row::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar { 
  height: 6px; 
  width: 6px; 
}
.scroll-row::-webkit-scrollbar-thumb,
.custom-scroll::-webkit-scrollbar-thumb { 
  background: rgba(155, 92, 255, 0.35); 
  border-radius: 999px; 
}

/* Alphabet Filter Styles */
.alphabet-filter-container {
  overflow-x: auto;
  padding-bottom: 8px; /* For scrollbar spacing */
}

.alphabet-filter-container::-webkit-scrollbar {
  height: 4px;
}
.alphabet-filter-container::-webkit-scrollbar-thumb {
  background: rgba(155, 92, 255, 0.2);
  border-radius: 4px;
}
.alphabet-filter-container::-webkit-scrollbar-thumb:hover {
  background: rgba(155, 92, 255, 0.4);
}

.alphabet-filter-scroll {
  display: flex;
  gap: 8px;
  width: max-content;
}

.alphabet-filter-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 600;
  color: #a0aec0; /* gray-400 */
  transition: all 0.2s ease;
}
.alphabet-filter-btn[data-letter="all"] {
  width: auto;
  padding: 0 16px;
}

.alphabet-filter-btn:not(:disabled):hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
}

.alphabet-filter-btn.active {
  background-color: #9b5cff;
  color: #0b0b0d;
  border-color: #9b5cff;
}

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

/* Enhanced playlist section */
.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 92, 255, 0.2);
  transform: translateY(-1px);
}

.btn-add-playlist {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #9b5cff;
  color: #0b0b0d;
  border-radius: 8px;
  font-weight: 600;
  transition: all .2s ease;
  flex-shrink: 0;
}

.btn-add-playlist:hover {
  background: #a569ff;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(155,92,255,.3);
}

.remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.remove-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
  transform: scale(1.05);
}

/* Payment Status Page Styles */
.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  border: 1px solid;
  background-color: rgba(255, 255, 255, 0.05);
}