﻿:root {
  color-scheme: dark;
  --bg-primary: #0f0f10;
  --bg-secondary: #151518;
  --bg-elevated: rgba(33, 33, 36, 0.92);
  --bg-elevated-soft: rgba(255, 255, 255, 0.04);
  --sidebar-width: clamp(260px, 28vw, 340px);
  --layout-gap: clamp(1.25rem, 3vw, 2.5rem);
  --accent: #1db954;
  --accent-strong: #1ed760;
  --accent-muted: rgba(29, 185, 84, 0.18);
  --danger: #f05454;
  --text-primary: #f6f8f9;
  --text-secondary: #a7abb3;
  --text-muted: #7f828a;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

::selection {
  background: rgba(29, 185, 84, 0.45);
  color: #050505;
}

body {
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
  padding: 96px clamp(1.5rem, 4vw, 3.5rem) 160px clamp(1.5rem, 4vw, 3.5rem);
  padding-right: calc(var(--sidebar-width) + var(--layout-gap));
  background: linear-gradient(140deg, #050505 0%, var(--bg-primary) 40%, #161621 100%);
  color: var(--text-primary);
  letter-spacing: 0.01em;
  background-attachment: fixed;
}

.main-content {
  margin-right: calc(var(--sidebar-width) + var(--layout-gap));
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(29, 185, 84, 0.18) 0%, transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(91, 192, 222, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.navbar {
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  min-height: 72px;
  transition: background 0.3s ease;
}

.navbar .container-fluid {
  max-width: 1180px;
}

.navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 1.05rem;
}

.brand-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(29, 185, 84, 0.6);
  position: relative;
}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(29, 185, 84, 0.4);
  opacity: 0.6;
}

.nav-hint {
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.page-intro {
  background: linear-gradient(160deg, rgba(29, 185, 84, 0.12), rgba(29, 185, 84, 0) 70%);
  border: 1px solid rgba(29, 185, 84, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-soft);
}

.page-intro .lead {
  max-width: 640px;
  margin-bottom: 0;
}

.section-title {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.song-grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  justify-content: flex-start;
}

.song-grid > [class*='col'] {
  padding: 0 !important;
  flex: 1 1 220px;
  max-width: 260px;
  min-width: 200px;
  display: flex;
}

.song-grid > [class*='col'] > * {
  width: 100%;
}

.song-grid .card {
  background: var(--bg-elevated-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.song-grid .card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.song-grid .card-img-top {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  filter: saturate(1.05);
}

.song-grid .card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.song-grid .card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0;
}

.song-grid .card-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.song-grid .btn {
  border-radius: 999px;
  font-weight: 600;
}

#recommended-pagination {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
  row-gap: 0.75rem;
}

#recommended-pagination span {
  font-weight: 500;
  letter-spacing: 0.04em;
}

#recommended-pagination > div {
  display: flex;
  gap: 0.5rem;
}

#recommended-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.playlist-panel {
  position: fixed;
  top: 100px;
  right: var(--layout-gap);
  width: var(--sidebar-width);
  bottom: 140px;
  background: linear-gradient(155deg, rgba(24, 24, 27, 0.95), rgba(17, 17, 20, 0.88));
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.6rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  z-index: 2;
}

.playlist-panel h3 {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.playlist-panel .playlist-hint {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.playlist-panel .list-group {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.playlist-panel .list-group::-webkit-scrollbar {
  width: 6px;
}

.playlist-panel .list-group::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.playlist-panel .list-group::-webkit-scrollbar-track {
  background: transparent;
}

#playlist {
  margin: 0;
  padding: 0;
}

#playlist .list-group-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid transparent;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#playlist .list-group-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}

#playlist .list-group-item span {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#playlist .list-group-item.active {
  background: linear-gradient(120deg, rgba(29, 185, 84, 0.28), rgba(29, 185, 84, 0.12)) !important;
  border-color: rgba(29, 185, 84, 0.45);
  box-shadow: 0 14px 32px rgba(29, 185, 84, 0.25);
}

#playlist .list-group-item.active span {
  color: var(--text-primary);
}

#playlist .list-group-item > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#playlist .list-group-item.bg-dark {
  background-color: transparent !important;
}

#playlist .list-group-item.text-center {
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px dashed rgba(255, 255, 255, 0.16);
}

#playlist .list-group-item.opacity-50 {
  opacity: 0.4 !important;
}

.btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.btn-dark {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-dark:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: var(--accent);
  border-color: var(--accent);
  color: #020f08;
}

.btn-success:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 10px 25px rgba(29, 185, 84, 0.35);
}

.btn-success:active {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--text-primary);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-info {
  border-color: rgba(125, 207, 255, 0.3);
  color: var(--text-primary);
}

.btn-outline-info:hover {
  background: rgba(125, 207, 255, 0.12);
  border-color: rgba(125, 207, 255, 0.5);
}

.btn-danger {
  background: rgba(240, 84, 84, 0.2);
  border: 1px solid rgba(240, 84, 84, 0.4);
  color: #ff8a8a;
}

.btn-danger:hover {
  background: rgba(240, 84, 84, 0.32);
  border-color: rgba(240, 84, 84, 0.5);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.player-bar {
  background: rgba(9, 9, 12, 0.88) !important;
  backdrop-filter: blur(22px);
  border-top: 1px solid var(--border-color) !important;
}

.player-bar .container {
  max-width: 1180px;
}

.player-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.player-meta #info {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.player-controls .btn {
  min-width: 72px;
}

.player-audio {
  display: flex;
  align-items: center;
}

.player-audio audio {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.35rem 0.5rem;
}

#cover {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.45);
}

@media (max-width: 1280px) {
  body {
    padding-right: calc(var(--sidebar-width) + 1.25rem);
  }
}

@media (max-width: 992px) {
  body {
    padding: 88px clamp(1.25rem, 4vw, 2rem) 200px clamp(1.25rem, 4vw, 2rem);
    padding-right: clamp(1.25rem, 5vw, 2.5rem);
  }

  .main-content {
    margin-right: 0;
  }

  .playlist-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    padding: 1.5rem;
    margin-top: 2.5rem;
  }

  .playlist-panel .list-group {
    max-height: 420px;
  }
}

@media (max-width: 768px) {
  .page-intro {
    padding: 1.5rem;
  }

  .player-bar .container {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .player-controls {
    width: 100%;
    justify-content: center;
  }

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

  .player-audio {
    width: 100%;
  }

  .player-bar {
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 576px) {
  body {
    padding: 80px 1rem 220px 1rem;
  }

  .navbar .nav-hint {
    display: none !important;
  }

  #cover {
    width: 60px;
    height: 60px;
  }
}
