/* Reset & Base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent-1: #ec4899;
  --accent-2: #14b8a6;
  --accent-3: #f59e0b;
  --spotify-green: #1DB954;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 50px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Floating Shapes Background */
.floating-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: float 20s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--primary), var(--accent-1));
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  top: 20%;
  right: -50px;
  animation-delay: -7s;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  bottom: 10%;
  left: 20%;
  animation-delay: -14s;
}

.shape-4 {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, var(--accent-1), var(--primary));
  bottom: 50%;
  right: 10%;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--accent-1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-lg);
}

.logo h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

/* Platform Tabs */
.platform-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent-1));
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-lg);
}

.tab-icon {
  font-size: 1.1rem;
}

/* Main Content */
.main-content {
  margin-bottom: 48px;
}

/* Input Card */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.input-card:hover {
  box-shadow: var(--shadow-xl);
}

.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

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

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

#videoUrl {
  width: 100%;
  padding: 16px 90px 16px 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

#videoUrl::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

#videoUrl:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.paste-btn {
  position: absolute;
  right: 8px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.paste-btn:hover {
  background: var(--border);
  color: var(--text);
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent-1));
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.download-btn:active {
  transform: translateY(0);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Error */
.error-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  margin-top: 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  color: #dc2626;
  font-size: 0.9rem;
}

/* Result Card */
.result-card {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px dashed var(--border);
  animation: slideUp 0.4s ease;
}

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

.video-info {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.thumbnail-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--border);
}

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

.platform-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.7);
  color: white;
}

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

.video-details h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-author {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.video-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-tag {
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
}

.format-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.format-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.format-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.format-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Quick Tips */
.quick-tips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.tip-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.tip-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.tip-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.tip-card p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* How To Section */
.how-to {
  margin-bottom: 48px;
}

.how-to h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.step-number {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-1));
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
}

.step h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.step p {
  color: var(--text-muted);
  font-size: 0.83rem;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.feature-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.footer-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.disclaimer {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .container {
    padding: 32px 20px;
  }

  .quick-tips {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px 14px;
  }

  .header {
    margin-bottom: 28px;
  }

  .logo {
    gap: 12px;
  }

  .logo-icon {
    width: 44px;
    height: 44px;
  }

  .logo-icon svg {
    width: 24px;
    height: 24px;
  }

  .logo h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.85rem;
  }

  /* Platform Tabs - Horizontal Scroll on Mobile */
  .platform-tabs {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 4px 12px 4px;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  .platform-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .tab {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.825rem;
    min-height: 44px;
  }

  /* Input Card */
  .input-card {
    padding: 20px 16px;
    margin-bottom: 24px;
    border-radius: var(--radius);
  }

  .input-group {
    flex-direction: column;
    gap: 10px;
  }

  #videoUrl {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    padding: 14px 80px 14px 44px;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.95rem;
    min-height: 48px;
  }

  .result-card {
    margin-top: 20px;
    padding-top: 20px;
  }

  .video-info {
    flex-direction: column;
    gap: 12px;
  }

  .thumbnail-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }

  .video-details h3 {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .format-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
  }

  .format-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    min-height: 44px;
  }

  /* Sections */
  .features {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .how-to h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .step {
    padding: 18px 14px;
  }

  .quick-tips {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 32px;
  }

  .tip-card {
    padding: 14px 10px;
  }

  .tip-icon {
    font-size: 1.6rem;
  }

  .tip-card h4 {
    font-size: 0.85rem;
  }

  .tip-card p {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .quick-tips {
    grid-template-columns: 1fr;
  }

  .logo h1 {
    font-size: 1.4rem;
  }

  #videoUrl {
    padding: 12px 72px 12px 40px;
    font-size: 14px;
  }

  .input-icon {
    left: 12px;
  }

  .paste-btn {
    right: 4px;
    padding: 6px 10px;
  }

  .footer-content p {
    font-size: 0.8rem;
  }

  .disclaimer {
    font-size: 0.75rem;
  }
}

/* Spotify-specific styles */
.platform-badge.spotify-badge {
  background: var(--spotify-green);
}

.tab[data-platform="spotify"].active {
  background: linear-gradient(135deg, #1DB954, #1ed760);
}

