:root {
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bg-color: #0b0f19;
  --card-bg: rgba(22, 28, 45, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary-accent: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --btn-hover-gradient: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #db2777 100%);
  --secondary-bg: rgba(255, 255, 255, 0.06);
  --secondary-hover: rgba(255, 255, 255, 0.12);
  --success-color: #10b981;
  --error-color: #ef4444;
  --radius-lg: 16px;
  --radius-md: 10px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Ambient Glows */
.glow-bg {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: rgba(99, 102, 241, 0.18);
  top: -100px;
  left: -100px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: rgba(236, 72, 153, 0.15);
  bottom: -150px;
  right: -100px;
}

.app-container {
  width: 100%;
  max-width: 960px;
  padding: 24px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Header */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success-color);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--secondary-bg);
  border: 1px solid var(--card-border);
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: var(--secondary-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 32px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Downloader Form */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 110px 16px 48px;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-wrapper input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.paste-btn {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--secondary-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
}

.paste-btn:hover {
  background: var(--secondary-hover);
}

/* Quality Selector */
.quality-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(10, 14, 23, 0.4);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.selector-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.select-wrapper {
  position: relative;
  flex: 1;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  background: rgba(22, 28, 45, 0.9);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 10px 36px 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.select-wrapper select:focus {
  border-color: var(--primary-accent);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.primary-btn {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.primary-btn:hover {
  background: var(--btn-hover-gradient);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.download-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.download-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.secondary-btn {
  background: var(--secondary-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

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

/* Preview Card */
.preview-card {
  animation: fadeIn 0.3s ease-in-out;
}

.track-info {
  display: flex;
  gap: 24px;
  align-items: center;
}

@media (max-width: 640px) {
  .track-info {
    flex-direction: column;
    text-align: center;
  }
}

.thumbnail-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.details-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quality-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .quality-badge {
    align-self: center;
  }
}

.track-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}

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

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.status-msg {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  text-align: center;
}

.status-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.status-msg.info {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

/* Mobile Integration Code Section */
.code-section {
  margin-top: 20px;
}

.code-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.code-title-group h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.code-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--secondary-bg);
}

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

.code-block-wrapper {
  position: relative;
  margin-top: 16px;
  background: #060911;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
}

.code-block-wrapper pre {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #a5b4fc;
  line-height: 1.6;
}

.copy-code-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer {
  margin-top: auto;
  text-align: center;
  padding: 24px 0 12px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
