:root {
  --bg: #0a0a0a;
  --panel: #151515;
  --panel-strong: #1c1c1c;
  --text: #f2efe6;
  --muted: #b7b2a5;
  --accent: #4c86c6;
  --accent-glow: rgba(111, 182, 242, 0.35);
  --border: rgba(255, 255, 255, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --max-width: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Vazirmatn", sans-serif;
  background: radial-gradient(circle at 10% 10%, #1a1a1a 0%, var(--bg) 45%, #050505 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

body::before {
  content: "";
  position: fixed;
  inset: auto;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -120px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  filter: blur(10px);
  z-index: -1;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 40px;
  opacity: 0;
  transform: translateY(14px);
  animation: enter 0.7s ease forwards;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-version {
  font-weight: 300;
  color: var(--muted);
  opacity: 0.75;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #57e389;
  box-shadow: 0 0 8px rgba(87, 227, 137, 0.5);
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.card {
  background: linear-gradient(160deg, #191919, #121212);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  animation: cardIn 0.85s cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}

.input-card h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.input-card {
  animation-delay: 0.15s;
}

.queue-card {
  animation-delay: 0.32s;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 182, 242, 0.25);
  background: rgba(76, 134, 198, 0.12);
  color: rgba(242, 239, 230, 0.8);
  font-size: 0.85rem;
  line-height: 1;
  margin-bottom: 14px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #57e389;
  box-shadow: 0 0 8px rgba(87, 227, 137, 0.5);
}

.lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.98rem;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

input[type="url"] {
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1;
  direction: ltr;
  width: 100%;
  padding-right: 44px;
}

input[type="url"]::placeholder {
  color: rgba(242, 239, 230, 0.4);
}

.input-clear {
  position: absolute;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(242, 239, 230, 0.7);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
}

.input-clear:hover {
  color: rgba(242, 239, 230, 0.95);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.btn-paste {
  padding: 8px 14px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary {
  background: linear-gradient(180deg, #5b9ae0 0%, #3a6ea3 100%);
  color: #f4f4f4;
  border: 1px solid rgba(111, 182, 242, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(76, 134, 198, 0.32);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 12px 26px rgba(76, 134, 198, 0.45);
}

.input-row .btn-primary {
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 128px;
}

.btn-primary.is-loading {
  cursor: progress;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(244, 244, 244, 0.3);
  border-top-color: rgba(244, 244, 244, 0.95);
  animation: spin 0.8s linear infinite;
}

.btn-percent {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(244, 244, 244, 0.95);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.1);
}

.helper {
  margin-top: 16px;
  font-size: 0.85rem;
  color: rgba(242, 239, 230, 0.55);
}

.status-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 8, 8, 0.6);
  display: grid;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
}

.status-label {
  color: rgba(242, 239, 230, 0.6);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 154, 224, 0.6), rgba(91, 154, 224, 1));
  transition: width 0.25s ease;
}

.status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-error {
  font-size: 0.85rem;
  color: #ff9b9b;
}

.is-hidden {
  display: none;
}

.sources {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.sources-label {
  color: rgba(242, 239, 230, 0.6);
}

.sources-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(242, 239, 230, 0.8);
  line-height: 1;
}

.source svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.source-ytm {
  color: rgba(242, 239, 230, 0.8);
  border-color: rgb(199, 0, 40);
  background: rgba(254, 0, 50, 0.08);
}

.source-spotify {
  color: rgba(242, 239, 230, 0.8);
  border-color: rgba(22, 202, 82, 0.37);
  background: rgba(46, 224, 106, 0.08);
}

.source-soundcloud {
  color: rgba(242, 239, 230, 0.8);
  border-color: rgba(252, 124, 32);
  background: rgba(224, 132, 112, 0.08);
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-renew {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-renew.is-loading {
  cursor: progress;
}

.btn-renew:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(242, 239, 230, 0.55);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}


.queue {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}

.queue-item {
  background: rgba(6, 6, 6, 0.6);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: itemIn 0.4s ease;
}

.queue-item.empty {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: rgba(242, 239, 230, 0.5);
  font-size: 0.9rem;
  justify-content: center;
}

.empty-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(111, 182, 242, 0.35);
  background: rgba(76, 134, 198, 0.18);
  color: rgba(111, 182, 242, 0.9);
  box-shadow: 0 0 12px rgba(76, 134, 198, 0.2);
}

.empty-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.rec-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.rec-title {
  direction: ltr;
  font-weight: 500;
  font-size: 0.95rem;
}

.rec-artist {
  color: rgba(242, 239, 230, 0.55);
  font-size: 0.85rem;
}

.rec-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.queue-item.skeleton {
  background: rgba(8, 8, 8, 0.6);
  display: grid;
  gap: 10px;
}

.skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-line.short {
  width: 48%;
}

.skeleton-line.long {
  width: 76%;
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.queue-footer {
  margin-top: 18px;
  font-size: 0.85rem;
  color: rgba(242, 239, 230, 0.6);
}

.footer {
  margin-top: 32px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -12px 24px rgba(76, 134, 198, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border-radius: 16px;
  font-size: 0.8rem;
  color: rgba(242, 239, 230, 0.5);
  opacity: 0;
  transform: translateY(14px);
  animation: footerIn 0.75s cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
  animation-delay: 0.5s;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(242, 239, 230, 0.9);
}

.footer-sub {
  color: rgba(242, 239, 230, 0.5);
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.footer-label {
  color: rgba(242, 239, 230, 0.45);
}

.footer-anchor {
  color: rgba(242, 239, 230, 0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 239, 230, 0.2);
}

.footer-anchor:hover {
  border-bottom-color: rgba(242, 239, 230, 0.6);
}


@keyframes enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes cardIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  70% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes footerIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .footer {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .input-row .btn {
    width: auto;
  }

  .btn-paste {
    padding: 8px 10px;
    min-width: 0;
    font-size: 0.8rem;
  }

  .input-row .btn-primary {
    min-width: 0;
  }

  .queue-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-right {
    align-items: center;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 26px 18px 32px;
  }

  .card {
    padding: 22px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row .btn {
    width: 100%;
  }

  .sources {
    align-items: center;
  }

  .sources-label {
    text-align: center;
    width: 100%;
  }

  .sources-row {
    justify-content: center;
  }

  .live-badge {
    align-self: center;
  }
}

