:root {
  --bg-main: #f8fafc;
  --panel-bg: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(226, 232, 240, 0.9);
  --panel-hover-border: rgba(99, 102, 241, 0.4);
  
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  --accent-indigo: #4f46e5;
  --accent-purple: #7c3aed;
  --accent-pink: #ec4899;
  --accent-cyan: #0891b2;
  --accent-green: #10b981;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 30px rgba(79, 70, 229, 0.08);
  --shadow-glow: 0 15px 35px rgba(124, 58, 237, 0.12);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Ambient Floating Glow Blobs (Light Theme) */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  animation: floatBlob 18s infinite alternate ease-in-out;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: #c7d2fe; /* Light indigo */
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: #fbcfe8; /* Light pink */
  bottom: -150px;
  right: -100px;
  animation-delay: -6s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: #bae6fd; /* Light cyan */
  top: 40%;
  left: 35%;
  animation-delay: -12s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Clean Light Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

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

/* Navbar */
.navbar {
  padding: 20px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  width: 46px;
  height: 46px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

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

.logo-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-indigo);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Hero Section */
.hero {
  padding: 50px 0 40px;
  text-align: center;
}

.hero-header {
  max-width: 800px;
  margin: 0 auto 36px;
}

.hero-title {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.8px;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.6;
}

/* Downloader Card & Input */
.downloader-card {
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-glow);
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: rgba(255, 255, 255, 0.95);
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 6px 8px 6px 18px;
  gap: 12px;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within {
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.input-icon-box {
  font-size: 20px;
  color: var(--accent-purple);
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 16px;
  font-family: inherit;
  padding: 10px 0;
}

.input-wrapper input::placeholder {
  color: var(--text-dim);
}

/* Buttons */
.btn-paste {
  background: #f1f5f9;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-paste:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-submit {
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
  transition: var(--transition-normal);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(124, 58, 237, 0.5);
}

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

/* Supported Pills */
.supported-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}

.pill-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.pill.active, .pill:hover {
  background: #ffffff;
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.pill.yt i { color: #ff0000; }
.pill.ig i { color: #e1306c; }
.pill.tt i { color: #000000; }
.pill.fb i { color: #1877f2; }
.pill.tw i { color: #0f172a; }
.pill.pin i { color: #e60023; }
.pill.rd i { color: #ff4500; }

/* Alert Card */
.alert-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  color: #991b1b;
  text-align: left;
}

.alert-card.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-icon { font-size: 22px; color: #ef4444; }
.alert-card.alert-success .alert-icon { color: #10b981; }
.alert-message { flex: 1; font-size: 15px; font-weight: 500; }
.alert-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

/* Result Card */
.result-card {
  padding: 28px;
  text-align: left;
  margin-top: 24px;
  background: #ffffff;
  animation: fadeIn 0.4s ease-out;
}

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

.result-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
}

.thumb-col {
  width: 100%;
}

.thumb-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #f1f5f9;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--panel-border);
}

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

.duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.platform-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Info Column */
.info-col {
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-main);
}

.video-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.options-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  gap: 8px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.option-card {
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: var(--transition-fast);
}

.option-card:hover {
  background: #ffffff;
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.opt-info {
  display: flex;
  flex-direction: column;
}

.opt-quality {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.opt-note {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-download-opt {
  width: 100%;
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-download-opt.audio-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-download-opt:hover {
  opacity: 0.92;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Download Status */
.download-status {
  margin-top: 16px;
  background: #f1f5f9;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

.status-info {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent-indigo);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

/* Features Section */
.features-section {
  padding: 60px 0 40px;
  text-align: center;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 32px;
  color: var(--text-main);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 28px 20px;
  text-align: center;
  background: #ffffff;
  transition: var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--panel-hover-border);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin: 0 auto 16px;
}

.gradient-1 { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.gradient-2 { background: linear-gradient(135deg, #a855f7, #9333ea); }
.gradient-3 { background: linear-gradient(135deg, #ec4899, #db2777); }
.gradient-4 { background: linear-gradient(135deg, #10b981, #059669); }

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
}

/* History Section */
.history-section {
  padding: 40px 0 60px;
}

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

.history-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-clear {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

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

.history-card {
  display: flex;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.history-card img {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.history-details {
  overflow: hidden;
}

.history-details h4 {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-weight: 700;
}

.history-details p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 24px 0;
  border-top: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.8);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title { font-size: 30px; }
  .result-layout { grid-template-columns: 1fr; }
  .input-wrapper { flex-direction: column; padding: 12px; }
  .btn-submit { width: 100%; justify-content: center; }
  .btn-paste { width: 100%; justify-content: center; }
  .options-grid { grid-template-columns: 1fr; }
}
