/* ═══════════════════════════════════════════════
   Spicy AMLL Player — Apple Music Style Upload
   ═══════════════════════════════════════════════ */

/* ── Layout ── */
.am-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #000;
}

/* ══════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════ */
.am-sidebar {
  background: rgba(20, 20, 20, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
  user-select: none;
  -webkit-user-select: none;
}

.am-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px 28px;
}

.am-sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(254, 36, 60, 0.5));
}

.am-sidebar-title {
  font-family: var(--spicy-font-family);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
}

/* ── Sidebar Sections ── */
.am-sidebar-section {
  padding: 0 12px;
  margin-bottom: 24px;
}

.am-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 12px;
  margin-bottom: 8px;
}

.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: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.am-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.am-nav-item.am-nav-active {
  background: rgba(250, 36, 60, 0.15);
  color: #fa243c;
}

.am-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.8;
}

.am-nav-item.am-nav-active svg {
  opacity: 1;
}

/* ── Sidebar Footer ── */
.am-sidebar-footer {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.am-sidebar-footer p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.25);
}

.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: #fa243c;
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════ */
.am-main {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0a0a0a;
}

/* ── 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;
}

.am-glow {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: amGlowMove 25s infinite alternate ease-in-out;
}

.am-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #fa243c 0%, transparent 70%);
  top: -150px;
  right: -100px;
}

.am-glow-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #5e11ff 0%, transparent 70%);
  bottom: -100px;
  left: -50px;
  animation-duration: 30s;
  animation-delay: -5s;
}

.am-glow-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #fd2458 0%, transparent 70%);
  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: 48px 56px;
  max-width: 1100px;
  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, #fa243c 0%, #5e11ff 100%);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(250, 36, 60, 0.3);
}

.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(250, 36, 60, 0.12);
  border-color: #fa243c;
  transform: scale(1.02);
}

.am-upload-card.has-file {
  border-color: rgba(250, 36, 60, 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: #fa243c;
}

.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(250, 36, 60, 0.15);
  color: #fa243c;
}

.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: #fd2458;
  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: #fa243c;
  background: rgba(250, 36, 60, 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) */
.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 transparent;
  transition: background 0.2s, transform 0.2s;
  cursor: grab;
  user-select: none;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.queue-item:active {
  cursor: grabbing;
}

.queue-item.dragging {
  opacity: 0.5;
  background: rgba(250, 36, 60, 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: #fa243c;
}

@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: #fa243c;
  color: #fff;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 24px rgba(250, 36, 60, 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(250, 36, 60, 0.45);
  background: #fd2458;
}

.am-error-msg {
  font-size: 0.85rem;
  color: #fa243c;
  min-height: 20px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .am-layout {
    grid-template-columns: 1fr;
  }

  .am-sidebar {
    display: none;
  }

  .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);
}

.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 {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
}

.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: #fa243c;
}

.am-mobile-nav-item.am-mobile-nav-active svg {
  filter: drop-shadow(0 0 10px rgba(250, 36, 60, 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: #fa243c;
  background: rgba(250, 36, 60, 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(250, 36, 60, 0.5);
  box-shadow: 0 0 0 4px rgba(250, 36, 60, 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: #fa243c;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
}

.am-text-btn:hover {
  background: rgba(250, 36, 60, 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;
  border: 4px solid rgba(250, 36, 60, 0.1);
  border-top-color: #fa243c;
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: amSpin 1s infinite linear;
}

#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;
}

@keyframes amSpin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════
   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: #fa243c;
  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-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: #fa243c;
}
.am-track-row.active .am-track-title,
.am-track-row.active .am-track-num,
.am-track-row.active .am-track-duration {
  color: #fff;
}

/* ══════════════════════════════════════════════════
   ARTIST VIEW
   ══════════════════════════════════════════════════ */
.am-artist-view {
  animation: amFadeIn 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.am-artist-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: #fa243c;
  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(250,36,60,0.8);
}

.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(250,36,60,0.2);
  border-left: 4px solid #fa243c;
}

/* ══════════════════════════════════════════════════
   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(250, 36, 60, 0.1);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #fa243c;
}
.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;
  background: radial-gradient(circle, rgba(250, 36, 60, 0.15) 0%, rgba(175, 82, 222, 0.1) 50%, transparent 100%);
  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;
}

.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;
  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, #FF2D55 0%, #FA243C 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 12px 30px rgba(250, 36, 60, 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);
}

.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;
}

.premium-btn.primary {
  background: linear-gradient(135deg, #FF2D55 0%, #FA243C 100%);
  color: #fff;
  padding: 0 30px;
  min-width: 150px;
  box-shadow: 0 8px 20px rgba(250, 36, 60, 0.3);
}

.premium-btn.primary:hover:not(:disabled) {
  transform: scale(1.03);
  box-shadow: 0 12px 30px rgba(250, 36, 60, 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(250, 36, 60, 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: #FF453A; }
.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;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
