/* ═══════════════════════════════════════════════
   LyricsFlow — Apple Music Style Upload
   ═══════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   MOBILE HEADER, TOGGLE, AND DRAWER
   ══════════════════════════════════════════════════ */
.am-mobile-header {
  display: none;
}

.am-sidebar-close-btn {
  display: none;
}

.am-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.am-sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .am-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 2000 !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  }

  .am-sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .am-sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
  }

  .am-sidebar-toggle-btn:active {
    transform: scale(0.95);
  }

  .am-sidebar-toggle-btn svg {
    width: 22px;
    height: 22px;
  }

  .am-mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .am-mobile-logo {
    height: 17px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
  }

  .am-sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-left: auto;
  }

  .am-sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    color: #ffffff;
    transform: scale(1.05);
  }

  .am-sidebar-close-btn:active {
    transform: scale(0.9);
  }

  .am-sidebar-close-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* ── Layout ── */
.am-layout {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(55, 42, 65, 0.42) 0%, rgba(13, 13, 17, 0.98) 75%) fixed !important;
}

/* ══════════════════════════════════════════════════
   SIDEBAR (macOS Golden Gate Liquid Glass Style)
   ══════════════════════════════════════════════════ */
.am-sidebar {
  width: 220px !important;
  flex: 0 0 220px !important;
  background: rgba(20, 20, 26, 0.52) !important;
  backdrop-filter: blur(42px) saturate(210%) !important;
  -webkit-backdrop-filter: blur(42px) saturate(210%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 8px 0 32px rgba(0, 0, 0, 0.35) !important;
  display: flex;
  flex-direction: column;
  padding: 16px 0 12px 0;
  overflow-y: auto;
  user-select: none;
  -webkit-user-select: none;
  scrollbar-width: none;
  position: relative;
  z-index: 100;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", sans-serif;
}

.am-sidebar::-webkit-scrollbar {
  display: none;
}

.am-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 18px 16px 18px;
}

.am-sidebar-logo {
  height: 20px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

/* ── Sidebar Sections ── */
.am-sidebar-section {
  padding: 0 10px;
  margin-bottom: 16px;
}

.am-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.42);
  padding: 0 10px;
  margin-bottom: 4px;
}

.am-sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.am-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.25;
}

.am-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.am-nav-item.am-nav-active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.am-nav-item svg {
  fill: white;
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  opacity: 0.85;
}

.am-nav-item.am-nav-active svg {
  opacity: 1;
}

/* Distinct red accent icon for New tab matching Wave / Apple Music */
.am-nav-item[data-page="new"] svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
  opacity: 0.95;
}

.am-nav-item.am-nav-active[data-page="new"] svg {
  color: #fa586a !important;
  stroke: #fa586a !important;
  opacity: 1;
}

/* ── Sidebar Footer ── */
.am-sidebar-footer {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.am-sidebar-profile-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.am-sidebar-profile-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.am-sidebar-profile-btn .user-profile-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.am-sidebar-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.user-profile-name-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-sidebar-footer p {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  margin: 0;
}

.am-sidebar-footer a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.am-sidebar-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════ */
.am-main {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--am-page-theme-bg, #0a0a0a);
  transition: background 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Subtle Animated Background (Mix of both) ── */
.am-bg-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  filter: blur(100px);
  opacity: 0.3;
  transform: translateZ(0);
  will-change: transform;
}

.am-glow {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: amGlowMove 25s infinite alternate ease-in-out;
  transform: translateZ(0);
  will-change: transform;
}

.am-glow-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  right: -100px;
}

.am-glow-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -50px;
  animation-duration: 30s;
  animation-delay: -5s;
}

.am-glow-3 {
  width: 350px;
  height: 350px;
  top: 50%;
  left: 40%;
  animation-duration: 20s;
  animation-delay: -2s;
}

@keyframes amGlowMove {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(60px, 30px) scale(1.1);
  }

  66% {
    transform: translate(-30px, 80px) scale(0.9);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

/* ── Content Container ── */
.am-content {
  position: relative;
  z-index: 1;
  padding: 14px clamp(20px, 3.5vw, 48px) 36px;
  max-width: 100%;
  box-sizing: border-box;
  animation: amFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes amFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════════════ */
.am-hero {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 48px;
}

.am-hero-icon {
  width: 120px;
  height: 120px;
  min-width: 120px;
  background: linear-gradient(135deg, #48484a 0%, #1c1c1e 100%);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(255, 255, 255, 0.08);
}

.am-hero-icon svg {
  width: 56px;
  height: 56px;
  fill: #fff;
}

.am-hero-text {
  padding-top: 8px;
}

.am-hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.am-hero-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
  max-width: 450px;
}

/* ══════════════════════════════════════════════════
   UPLOAD AREA (in the "big div")
   ══════════════════════════════════════════════════ */
.am-upload-area {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.am-upload-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Upload Card ── */
.am-upload-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.am-upload-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-3px);
}

.am-upload-card.dragover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  transform: scale(1.02);
}

.am-upload-card.has-file {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.am-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.am-upload-card:hover .am-card-icon {
  background: #ffffff;
}

.am-upload-card:hover .am-card-icon svg {
  fill: #000;
}

.am-card-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.am-card-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.am-card-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

.am-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.am-card-badge.am-badge-optional {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
}

.am-upload-card input[type="file"] {
  display: none;
}

.zone-filename {
  font-size: 0.85rem;
  color: #e5e5e5;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 8px;
  display: none;
}

/* ══════════════════════════════════════════════════
   QUEUE PREVIEW
   ══════════════════════════════════════════════════ */
.am-queue-preview {
  display: none;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  animation: amSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.am-queue-preview.active {
  display: flex;
}

.am-queue-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.am-queue-header h4 {
  font-size: 1rem;
  font-weight: 700;
}

.am-queue-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.am-clear-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.am-clear-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.queue-list::-webkit-scrollbar {
  width: 4px;
}

.queue-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Queue items (reused from original with updated styling) */
/* BEFORE */
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  cursor: grab;
  user-select: none;
  touch-action: none;
  will-change: transform;
}


.queue-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.queue-item:active {
  cursor: grabbing;
}

.queue-item.dragging {
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

.drag-handle {
  color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  font-size: 1.1rem;
}

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

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

.ttml-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-family: Inter, "Noto Sans Georgian", "Vazirmatn", sans-serif;
  outline: none;
  max-width: 150px;
  cursor: pointer;
}

.ttml-select option {
  background: #1a1a1a;
  color: #fff;
}

.remove-item {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.remove-item:hover {
  color: #ffffff;
}

@keyframes amSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════════════
   ACTIONS
   ══════════════════════════════════════════════════ */
.am-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.am-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 700;
  font-family: Inter, "Noto Sans Georgian", "Vazirmatn", sans-serif;
  border-radius: 100px;
  border: none;
  background: #ffffff;
  color: #000;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.35);
}

.am-start-btn svg {
  width: 18px;
  height: 18px;
}

.am-start-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  box-shadow: none;
}

.am-start-btn:not(:disabled):hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 32px rgba(255, 255, 255, 0.45);
  background: #e5e5e5;
}

.am-error-msg {
  font-size: 0.85rem;
  color: #ffffff;
  min-height: 20px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .am-layout {
    grid-template-columns: 1fr;
  }

  .am-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 2000;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    box-shadow: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .am-sidebar.open {
    left: 0;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
  }

  .am-content {
    padding: 32px 24px;
  }

  .am-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .am-hero-subtitle {
    max-width: 100%;
  }

  .am-upload-cards {
    grid-template-columns: 1fr;
  }

  .am-hero-icon {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: 20px;
  }

  .am-hero-icon svg {
    width: 44px;
    height: 44px;
  }

  .am-hero-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 500px) {
  .am-content {
    padding: 24px 16px;
  }

  .am-hero-title {
    font-size: 1.5rem;
  }

  .am-upload-card {
    padding: 20px 18px;
  }
}

/* ══════════════════════════════════════════════════
   TEST DATABASE PAGE
   ══════════════════════════════════════════════════ */
.am-page {
  display: none;
}

.am-page.active {
  display: block;
  animation: amFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.am-preview-player-bar.visible {
  display: block;
}

/* ══════════════════════════════════════════════════
/* ══════════════════════════════════════════════════
   INDEX.HTML THEMES & ACCENTS
   ══════════════════════════════════════════════════ */

/* 1. Frosted Glass Sidebar & Content Mirroring (Dark Mode & Default) */
.am-sidebar {
  background: rgba(20, 20, 26, 0.52) !important;
  backdrop-filter: blur(42px) saturate(210%) !important;
  -webkit-backdrop-filter: blur(42px) saturate(210%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 8px 0 32px rgba(0, 0, 0, 0.35) !important;
}

[dir="rtl"] .am-sidebar {
  border-right: none !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 2. OLED Dark Theme: 100% PURE BLACK (#000000) EVERYWHERE */
[data-theme="oled-black"],
[data-theme="oled-black"] body,
[data-theme="oled-black"] .am-layout,
[data-theme="oled-black"] .am-main,
[data-theme="oled-black"] .am-main-content,
[data-theme="oled-black"] .am-content,
[data-theme="oled-black"] .am-page,
[data-theme="oled-black"] .am-sidebar,
[data-theme="oled-black"] .am-preview-player-bar,
[data-theme="oled-black"] .am-macos-window,
[data-theme="oled-black"] .am-about-sheet-card,
[data-theme="oled-black"] .aero-menu {
  background-color: #1c1c1e !important;
  background: #000000 !important;
}

[data-theme="oled-black"] .am-bg-glow {
  display: none !important;
}

[data-theme="oled-black"] .am-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="oled-black"][dir="rtl"] .am-sidebar {
  border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-right: none !important;
}

[data-theme="oled-black"] .am-preview-player-bar {
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.98) !important;
}

[data-theme="oled-black"] .am-standard-media-card,
[data-theme="oled-black"] .am-concert-card,
[data-theme="oled-black"] .am-artist-song-card,
[data-theme="oled-black"] .am-category-card,
[data-theme="oled-black"] .am-artist-station-card {
  background: #050505 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="oled-black"] .am-apple-search-input-wrapper #catalog-search {
  background: #000000 !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

/* 3. Light Mode Theme (Apple Music macOS Light Aesthetic) */
[data-theme="light-mode"],
[data-theme="light-mode"] body,
[data-theme="light-mode"] .am-layout,
[data-theme="light-mode"] .am-main,
[data-theme="light-mode"] .am-content {
  background-color: #f5f5f7 !important;
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .am-sidebar {
  background: rgba(240, 240, 243, 0.75) !important;
  backdrop-filter: blur(50px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(50px) saturate(200%) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light-mode"][dir="rtl"] .am-sidebar {
  border-left: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-right: none !important;
}

[data-theme="light-mode"] .am-sidebar .am-nav-item,
[data-theme="light-mode"] .am-sidebar .am-sidebar-brand span,
[data-theme="light-mode"] .am-sidebar .user-profile-name-text {
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .am-sidebar-logo {
  filter: brightness(0.15) !important;
}

[data-theme="light-mode"] .am-sidebar .am-section-label {
  color: rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light-mode"] .am-sidebar .am-nav-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light-mode"] .am-sidebar .am-nav-item.am-nav-active {
  background: rgba(250, 88, 106, 0.14) !important;
  color: #fa586a !important;
}

[data-theme="light-mode"] .am-preview-player-bar {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .am-preview-player-bar .am-preview-track-title {
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .am-preview-player-bar .am-preview-track-artist {
  color: rgba(0, 0, 0, 0.6) !important;
}

[data-theme="light-mode"] .am-preview-player-bar button svg {
  fill: #1d1d1f !important;
}

[data-theme="light-mode"] .am-hero-title,
[data-theme="light-mode"] .am-section-title,
[data-theme="light-mode"] .am-search-section-title,
[data-theme="light-mode"] .am-media-card-title,
[data-theme="light-mode"] .am-artist-song-title {
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .am-hero-subtitle,
[data-theme="light-mode"] .am-media-card-sub,
[data-theme="light-mode"] .am-artist-song-artist {
  color: rgba(0, 0, 0, 0.55) !important;
}

[data-theme="light-mode"] .am-standard-media-card,
[data-theme="light-mode"] .am-concert-card,
[data-theme="light-mode"] .am-artist-song-card,
[data-theme="light-mode"] .am-category-card,
[data-theme="light-mode"] .am-artist-station-card {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light-mode"] .am-apple-search-input-wrapper #catalog-search {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #1d1d1f !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light-mode"] .am-macos-window {
  background: rgba(248, 248, 250, 0.95) !important;
  color: #1d1d1f !important;
  border: 1px solid rgba(0, 0, 0, 0.14) !important;
}

[data-theme="light-mode"] .am-macos-title {
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .am-macos-input {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1d1d1f !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light-mode"] .am-macos-select {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1d1d1f !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light-mode"] .aero-menu {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .aero-menu-item {
  color: #1d1d1f !important;
}

[data-theme="light-mode"] .aero-menu-item:hover {
  background: rgba(250, 88, 106, 0.12) !important;
  color: #fa586a !important;
}

/* .am-mobile-nav-item rules removed */

.testdb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

.testdb-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.testdb-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.testdb-art {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  background-color: #151515;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.testdb-art svg {
  width: 40%;
  height: 40%;
  opacity: 0.15;
  fill: #fff;
}

.testdb-info {
  position: relative;
  z-index: 1;
}

.testdb-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.testdb-info p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.testdb-card.loading {
  pointer-events: none;
  opacity: 0.7;
}

@keyframes testdbPulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.testdb-card.loading {
  animation: testdbPulse 1.5s infinite ease-in-out;
}

/* ══════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
   ══════════════════════════════════════════════════ */
/* .am-mobile-nav style removed */

/* .am-mobile-nav-item removed */

/*
.am-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  padding-top: 8px;
}
*/

/*
.am-mobile-nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s;
}

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

.am-mobile-nav-item.am-mobile-nav-active {
  color: #ffffff;
}

.am-mobile-nav-item.am-mobile-nav-active svg {
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

@media (max-width: 900px) {
  .am-mobile-nav {
    display: grid;
  }
}
*/

/* ══════════════════════════════════════════════════
   LISTEN NOW & TRENDING SECTION
   ══════════════════════════════════════════════════ */
.trending-section {
  margin-top: 20px;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.trending-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trending-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.trending-art {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  background-color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
}

.trending-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.trending-card:hover .trending-art img {
  transform: scale(1.1);
}

.trending-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.trending-info p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

/* ── Skeleton Loaders ── */
.skeleton-card {
  height: 220px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  animation: amSkeleton 1.5s infinite;
}

@keyframes amSkeleton {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* ── Search Container ── */
.am-search-container {
  margin-bottom: 40px;
}

.am-search-box {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.am-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

#catalog-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 14px 14px 52px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s;
}

#catalog-search:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* ── Albums Grid ── */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.album-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.album-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.02);
}

.album-art {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.album-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.album-info p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

.skeleton-album {
  height: 88px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.skeleton-album::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  animation: amSkeleton 1.5s infinite;
}

/* ── Search Results ── */
.search-results-section {
  animation: amFadeIn 0.5s ease;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.am-text-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
}

.am-text-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ══════════════════════════════════════════════════
   PREPARATION OVERLAY
   ══════════════════════════════════════════════════ */
.prep-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  animation: amFadeIn 0.3s ease;
}

.prep-overlay.active {
  display: flex;
}

.prep-content {
  max-width: 400px;
  padding: 40px;
}

.prep-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
}

#prep-status {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#prep-subtext {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════
   SONG VIEW (Apple Music Style Song Detail Page)
   ══════════════════════════════════════════════════ */
.am-song-view {
  animation: amFadeIn 0.5s ease;
  padding-top: 10px;
  width: 100%;
}

.am-song-header {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  margin-bottom: 36px;
}

.am-song-cover {
  width: 250px;
  height: 250px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  object-fit: cover;
  flex-shrink: 0;
}

.am-song-details {
  flex: 1;
  min-width: 0;
}

.am-song-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #fff;
  letter-spacing: -0.02em;
}

.am-song-meta-line {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.am-song-meta-link {
  color: #fc3c44;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.am-song-meta-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.am-song-meta-dot {
  color: rgba(255, 255, 255, 0.35);
}

.am-song-section {
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.am-song-section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.am-song-lyrics-preview {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
  white-space: pre-line;
  margin-bottom: 14px;
}

.am-song-view-full-lyrics-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fc3c44;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 0.2s;
}

.am-song-view-full-lyrics-btn:hover {
  opacity: 0.8;
}

.am-credits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
}

.am-credit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.am-credit-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
  object-fit: cover;
}

.am-credit-info {
  display: flex;
  flex-direction: column;
}

.am-credit-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.am-credit-role {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .am-song-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .am-song-cover {
    width: min(240px, 65vw);
    height: min(240px, 65vw);
  }

  .am-song-title {
    font-size: 2rem;
  }

  .am-song-meta-line {
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════
   ALBUM VIEW
   ══════════════════════════════════════════════════ */
.am-album-view {
  animation: amFadeIn 0.5s ease;
  padding-top: 10px;
}

.am-album-header {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  margin-bottom: 40px;
}

.am-album-cover {
  width: 250px;
  height: 250px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  object-fit: cover;
}

.am-album-details {
  flex: 1;
}

.am-album-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}

.am-album-artist {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.am-album-meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.am-album-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  max-width: 600px;
  margin-bottom: 20px;
}

.am-album-tracks {
  display: flex;
  flex-direction: column;
}

.am-track-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.am-track-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.am-track-num {
  width: 40px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

.am-track-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
}

.am-track-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.15s ease, text-decoration 0.15s ease;
}

.am-track-title-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.am-track-duration {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-right: 20px;
}

.am-track-more {
  color: rgba(255, 255, 255, 0.5);
  padding: 4px;
}

.am-track-row.active {
  background: #ffffff;
}

.am-track-row.active .am-track-title,
.am-track-row.active .am-track-num,
.am-track-row.active .am-track-duration {
  color: #000;
}

/* ══════════════════════════════════════════════════
   ARTIST VIEW
   ══════════════════════════════════════════════════ */
.am-artist-view {
  animation: amFadeIn 0.5s ease;
  display: flex;
  flex-direction: column;
}

.am-artist-header:not(.am-artist-side-header) {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
  width: 100%;
}

.am-artist-image {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  margin-bottom: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.am-artist-name-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.am-artist-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
}

.am-artist-name {
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
}

.am-artist-content-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  width: 100%;
}

.am-latest-release-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 16px;
}

.am-latest-release-card img {
  width: 100px;
  height: 100px;
  border-radius: 8px;
}

.am-top-songs-list {
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════
   SONG CONTEXT MENU & MODALS
   ══════════════════════════════════════════════════ */
.am-context-menu {
  position: fixed;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  animation: amSlideUp 0.2s ease;
}

.context-menu-item {
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.am-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.am-modal-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: amFadeIn 0.3s ease;
}

.am-modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
}

.playlist-option {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.playlist-option:hover {
  background: rgba(255, 255, 255, 0.2);
  border-left: 4px solid #ffffff;
}

/* ══════════════════════════════════════════════════
   PLAYLISTS
   ══════════════════════════════════════════════════ */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.playlist-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.playlist-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

.playlist-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #ffffff;
}

.playlist-icon svg {
  width: 40px;
  height: 40px;
}

.playlist-tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* ══════════════════════════════════════════════════
   TTML DOWNLOADER PAGE (V2 PREMIUM)
   ══════════════════════════════════════════════════ */
#page-download-ttml {
  position: relative;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px);
  padding: 40px 20px;
  overflow-x: hidden;
}

#page-download-ttml.active {
  display: flex;
}

.download-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  filter: blur(80px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: amGlowPulse 10s infinite alternate ease-in-out;
}

.premium-downloader-container {
  position: relative;
  width: 100%;
  max-width: 850px;
  z-index: 1;
  overflow: visible;
}

.glass-card.premium-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 48px;
  overflow: visible;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: amFadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.downloader-header {
  text-align: center;
  margin-bottom: 40px;
}

.header-icon-wrapper {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #48484a 0%, #2c2c2e 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.3);
  color: #fff;
}

.header-icon-wrapper svg {
  width: 32px;
  height: 32px;
}

.premium-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.premium-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.45);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

.premium-search-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: flex;
  padding: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
  overflow: visible;
}

.premium-search-box:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.premium-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 20px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
}

.premium-btn {
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
}

#dl-song-format {
  position: relative;
}

#dl-song-format .aero-menu {
  top: 0;
  left: calc(100% + 6px);
  right: auto;
  min-width: 160px;
}

.premium-btn.primary {
  background: linear-gradient(135deg, #3a3a3c 0%, #1c1c1e 100%);
  color: #fff;
  padding: 0 30px;
  min-width: 150px;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.premium-btn.primary:hover:not(:disabled) {
  transform: scale(1.03);
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.4);
}

.premium-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 8px 18px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.premium-btn.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.premium-result-view {
  margin-top: 48px;
  position: relative;
  animation: amFadeInUp 0.6s 0.2s both;
}

.song-identity {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 40px;
}

.art-pulse-wrapper {
  position: relative;
}

.art-pulse-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.4);
  animation: amArtPulse 3s infinite;
  z-index: -1;
}

#ttml-preview-art {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.song-details h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.song-details p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code-stage {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stage-header {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dots {
  display: flex;
  gap: 6px;
}

.dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.stage-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.15em;
}

.code-viewport {
  padding: 24px;
  max-height: 350px;
  overflow-y: auto;
}

#ttml-code-block {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  white-space: pre-wrap;
  margin: 0;
}

#ttml-code-block::-webkit-scrollbar {
  width: 8px;
}

#ttml-code-block::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.status-indicator {
  margin-top: 24px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.status-indicator.error {
  color: #ffffff;
}

.status-indicator.success {
  color: #32D74B;
}

@keyframes amArtPulse {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.5;
  }
}

@keyframes amFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-loader {
  width: 18px;
  height: 18px;
}

/* -- Search Results Dropdown -- */
.dl-search-results {
  margin-top: 15px;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  transition: opacity 0.3s, transform 0.3s;
}

.dl-search-results.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.dl-search-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dl-search-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.dl-search-art {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.dl-search-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dl-search-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.dl-search-artist {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* Apple Music Full Lyrics Modal Sheet */
.am-full-lyrics-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: amFadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  padding: 20px;
  box-sizing: border-box;
}

.am-full-lyrics-modal-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 84vh;
  background: #18181a;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(10px);
  animation: amScaleUpModal 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.am-full-lyrics-modal-header {
  position: relative;
  padding: 24px 28px 16px 28px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #18181a;
}

.am-full-lyrics-modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.18s ease;
  padding: 0;
  align-self: flex-start;
}

.am-full-lyrics-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.05);
}

.am-full-lyrics-modal-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.am-full-lyrics-modal-meta {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.am-full-lyrics-modal-body {
  padding: 24px 28px 36px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.am-full-lyrics-modal-body::-webkit-scrollbar {
  width: 6px;
}

.am-full-lyrics-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.am-full-lyrics-stanza {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.am-full-lyrics-line {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.8;
  color: #ffffff;
  letter-spacing: -0.01em;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro', 'SF Arabic', 'Vazirmatn', Inter, sans-serif;
}

.am-full-lyrics-modal-body[dir="rtl"] .am-full-lyrics-line {
  text-align: right;
  font-family: 'SF Arabic', 'SF Pro Arabic', 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.95;
  letter-spacing: 0;
}

.am-full-lyrics-modal-body[dir="ltr"] .am-full-lyrics-line {
  text-align: left;
}

@keyframes amFadeInModal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes amScaleUpModal {
  from {
    transform: scale(0.95) translateY(12px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ══════════════════════════════════════════════════
   PLAYLIST VIEW & ALL PLAYLISTS MODERN STYLING
   ══════════════════════════════════════════════════ */
.am-playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px 20px;
  padding: 10px 0 40px;
}

.am-playlist-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.am-playlist-card:hover {
  transform: translateY(-4px);
}

.am-playlist-card-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  padding: 16px;
  box-sizing: border-box;
}

.am-playlist-card-art-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #000;
  letter-spacing: -0.02em;
  word-break: break-word;
  line-height: 1.2;
}

.am-playlist-card-title {
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-playlist-card-curator {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Playlist Detail Header & Actions ── */
.am-playlist-detail-header {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  align-items: flex-end;
}

.am-playlist-cover-large {
  width: 240px;
  height: 240px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.am-playlist-meta-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.am-playlist-page-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0;
}

.am-playlist-page-curator {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fa586a;
  cursor: pointer;
}

.am-playlist-page-updated {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}

.am-playlist-page-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 8px;
}

.am-playlist-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.am-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border-radius: 100px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.am-pill-btn.primary {
  background: #ffffff;
  color: #000000;
  padding: 0 24px;
}

.am-pill-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 38px;
  padding: 0;
}

.am-pill-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.am-pill-btn:active {
  transform: scale(0.97);
}

/* ── Songs Table ── */
.am-playlist-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.am-playlist-table-head {
  display: grid;
  grid-template-columns: 44px minmax(180px, 3fr) minmax(130px, 2fr) minmax(130px, 2fr) 60px 40px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.am-playlist-table-row {
  display: grid;
  grid-template-columns: 44px minmax(180px, 3fr) minmax(130px, 2fr) minmax(130px, 2fr) 60px 40px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
}

.am-playlist-table-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.am-playlist-table-row.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.am-playlist-row-art {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.am-playlist-row-title {
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.am-playlist-row-artist,
.am-playlist-row-album {
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.am-playlist-row-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* ── Suggested Songs Card Section ── */
.am-suggested-songs-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 40px;
  margin-bottom: 60px;
}

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

.am-suggested-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.am-suggested-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

.am-suggested-refresh-btn {
  background: none;
  border: none;
  color: #fa586a;
  font-weight: 600;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.am-suggested-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px 18px;
}

.am-suggested-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s ease;
}

.am-suggested-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.am-suggested-item-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.am-suggested-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-suggested-item-artist {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-suggested-add-btn {
  background: none;
  border: none;
  color: #fa586a;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.am-suggested-add-btn:hover {
  transform: scale(1.18);
}