/* MyMusic — Dark Theme */
:root {
  --bg: #0b0b10;
  --bg-secondary: #12121a;
  --card: #16162280;
  --card-solid: #161622;
  --text: #eae8f4;
  --text-muted: #8884a2;
  --accent: #7c5cfc;
  --accent-hover: #6a48e6;
  --accent-secondary: #00d4aa;
  --border: #252538;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(124, 92, 252, 0.15);
  --glow: rgba(124, 92, 252, 0.25);
  --gradient-hero: linear-gradient(135deg, #7c5cfc22 0%, #00d4aa15 50%, #0b0b10 100%);
  --radius: 14px;
  --radius-lg: 20px;
}

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

html {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  background: rgba(11, 11, 16, 0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}

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

.nav-link.active {
  color: var(--accent);
  background: rgba(124, 92, 252, 0.12);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 8px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3v10.55A4 4 0 1 0 14 17V7h4V3h-6z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3v10.55A4 4 0 1 0 14 17V7h4V3h-6z'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
}

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

.logo:hover::before {
  background: var(--accent-secondary);
}

/* Main */
.main {
  flex: 1;
  padding: 0 2rem 12rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* Sections */
.section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 1.25em;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}

/* Hero */
.hero {
  text-align: left;
  padding: 5rem 3rem;
  margin: 0 -2rem 3rem;
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 600px;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Genres */
.genre-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.genre-card {
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.genre-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.genre-card:hover {
  border-color: var(--accent);
  background: rgba(124, 92, 252, 0.08);
  box-shadow: 0 4px 20px var(--shadow-hover);
  transform: translateY(-2px);
}

.genre-card:hover::before {
  opacity: 1;
}

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

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

/* Catalog filter */
.catalog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 92, 252, 0.08);
}

.filter-btn.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

/* About */
.about {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.about .section-title {
  grid-column: 1 / -1;
}

.about-text {
  color: var(--text-muted);
  line-height: 1.8;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-link::after {
  content: '\2192';
  margin-left: auto;
  transition: transform 0.2s;
}

.about-link:hover {
  background: rgba(124, 92, 252, 0.08);
  border-color: var(--accent);
}

.about-link:hover::after {
  transform: translateX(4px);
}

/* Inner pages */
.page-content {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.page-header {
  margin-bottom: 2.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.back-link:hover {
  color: var(--accent);
  background: rgba(124, 92, 252, 0.08);
}

.page-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-body h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

.page-body h2:first-of-type {
  margin-top: 0;
}

.page-body p,
.page-body li {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.page-body ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.page-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.contact-block {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-block h2 {
  margin-top: 0;
  border-left: none;
  padding-left: 0;
}

.page-body a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.page-body a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.faq-list {
  margin: 0;
}

.faq-list dt {
  font-weight: 600;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.faq-list dt:first-child {
  margin-top: 0;
}

.faq-list dd {
  color: var(--text-muted);
  margin-left: 0;
  line-height: 1.8;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Site footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Message */
.message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.message.info {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-secondary);
  border: 1px solid rgba(0, 212, 170, 0.25);
}

.message.error {
  background: rgba(252, 92, 92, 0.1);
  color: #fc5c5c;
  border: 1px solid rgba(252, 92, 92, 0.25);
}

.message.hidden {
  display: none;
}

/* Track list */
.track-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.track-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.track-card:hover {
  box-shadow: 0 8px 32px var(--shadow-hover);
  transform: translateY(-4px);
  border-color: rgba(124, 92, 252, 0.3);
}

.track-card.playing {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 24px var(--glow);
}

.track-artwork-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-secondary);
}

.track-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.track-card:hover .track-artwork {
  transform: scale(1.05);
}

.track-play-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  box-shadow: 0 4px 16px rgba(124, 92, 252, 0.5);
}

.track-card:hover .track-play-btn {
  opacity: 1;
  transform: translateY(0);
}

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

.track-play-btn svg {
  width: 22px;
  height: 22px;
}

.track-card.playing .track-play-btn {
  opacity: 1;
  transform: translateY(0);
  background: var(--accent-secondary);
}

.track-info {
  padding: 0.875rem 1rem;
}

.track-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.track-artist {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Player */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(18, 18, 26, 0.92);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-top: 1px solid var(--border);
}

.player-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.875rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

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

.player-artwork {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.control-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 12px rgba(124, 92, 252, 0.3);
}

.control-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.45);
}

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

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

.progress-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.time {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.progress {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124, 92, 252, 0.4);
  transition: transform 0.15s ease;
}

.progress::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 120px;
}

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

.volume {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.volume::-webkit-slider-thumb:hover {
  background: var(--accent);
}

.volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--text-muted);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 992px) {
  .nav-links {
    flex-wrap: wrap;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .nav-links {
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .hero {
    padding: 3rem 1.5rem;
    margin: 0 -1rem 2rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .main {
    padding: 0 1rem 12rem;
  }

  .track-list {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .genre-list {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .player-content {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .player-track {
    flex: 1 1 100%;
  }

  .player-controls {
    order: 3;
    flex: 1 1 100%;
  }

  .player-volume {
    flex: 0 0 auto;
  }
}
