:root {
  --bg-dark: #090b10;
  --bg-card: rgba(18, 22, 33, 0.75);
  --bg-card-hover: rgba(25, 31, 46, 0.85);
  --bg-input: rgba(13, 16, 24, 0.9);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(138, 75, 255, 0.35);
  --border-focus: #8a4bff;

  --accent-primary: #8a4bff;
  --accent-primary-hover: #7937f5;
  --accent-gradient: linear-gradient(135deg, #8a4bff 0%, #00d2ff 100%);
  --accent-gradient-warm: linear-gradient(135deg, #ff007a 0%, #7928ca 100%);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --status-green: #10b981;
  --status-yellow: #f59e0b;
  --status-red: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Background Ambient Lighting */
.glow-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.sphere-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7928ca, #ff0080);
  top: -150px;
  left: -100px;
}

.sphere-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #0070f3, #00dfd8);
  top: 30%;
  right: -150px;
}

.sphere-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #7928ca, #4c1d95);
  bottom: -100px;
  left: 20%;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(138, 75, 255, 0.4);
}

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

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.brand-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(138, 75, 255, 0.1);
  border: 1px solid rgba(138, 75, 255, 0.28);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: #c4b5fd;
  backdrop-filter: blur(12px);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.badge-pill:hover {
  background: rgba(138, 75, 255, 0.16);
  border-color: rgba(138, 75, 255, 0.45);
}

.badge-pill .sparkle {
  font-size: 0.95rem;
  line-height: 1;
}

/* Main Hero */
.main-content {
  flex: 1;
  padding: 48px 0;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 36px;
}

/* Input Card */
.input-card {
  width: 100%;
  max-width: 760px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-card:focus-within {
  border-color: var(--border-glow);
  box-shadow: 0 20px 40px -10px rgba(138, 75, 255, 0.25);
}

.url-form {
  display: flex;
  gap: 12px;
  width: 100%;
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px;
  transition: border-color 0.2s;
}

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

.input-icon {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-main);
  padding: 14px 0;
}

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

.btn-paste {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  outline: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  padding: 0 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 24px rgba(138, 75, 255, 0.35);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(138, 75, 255, 0.45);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.quick-samples {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 0 6px;
}

.samples-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.sample-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.sample-chip:hover {
  background: rgba(138, 75, 255, 0.15);
  border-color: rgba(138, 75, 255, 0.4);
  color: #e2e8f0;
}

/* Alert Box */
.alert-box {
  width: 100%;
  max-width: 760px;
  margin-top: 20px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  animation: slideDown 0.3s ease;
}

.alert-text {
  font-size: 0.9rem;
  color: #fca5a5;
}

/* Result Card */
.result-card {
  width: 100%;
  max-width: 760px;
  margin-top: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(25px);
  text-align: left;
  animation: fadeIn 0.4s ease;
}

.result-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.media-preview-container {
  display: flex;
  flex-direction: column;
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

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

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  color: #fff;
  letter-spacing: 0.04em;
}

.platform-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(138, 75, 255, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
}

.media-details {
  display: flex;
  flex-direction: column;
}

.video-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.uploader-info, .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tabs */
.format-tabs {
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--bg-card-hover);
  color: #fff;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.section-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 10px;
}

.quality-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.quality-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.quality-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.quality-chip.selected {
  background: rgba(138, 75, 255, 0.2);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(138, 75, 255, 0.3);
}

.btn-download {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(138, 75, 255, 0.35);
  transition: all 0.2s;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(138, 75, 255, 0.5);
}

.btn-download:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Live Progress */
.progress-container {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

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

.progress-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.progress-status {
  font-size: 0.88rem;
  color: var(--text-muted);
}

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

.progress-percent {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.btn-cancel-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel-download:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fee2e2;
}

.btn-cancel-download:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
  box-shadow: 0 0 12px rgba(138, 75, 255, 0.8);
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.progress-stats strong {
  color: var(--text-muted);
}

/* History Section */
.history-section {
  width: 100%;
  max-width: 760px;
  margin-top: 36px;
  text-align: left;
}

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

.history-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-text-only {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-text-only:hover {
  color: var(--status-red);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  gap: 14px;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: var(--border-glow);
}

.history-thumb {
  width: 50px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

.history-info {
  flex: 1;
  overflow: hidden;
}

.history-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Platforms Showcase */
.platforms-showcase {
  margin-top: 60px;
  text-align: center;
}

.platforms-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.platform-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.platform-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-glow);
}

.platform-icon {
  font-size: 1.5rem;
}

.platform-card strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.platform-card span {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Footer */
.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer code {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.copyright {
  margin-top: 6px;
  font-size: 0.85rem;
}

.copyright a {
  color: #c4b5fd;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.copyright a:hover {
  color: #fff;
}

/* 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;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.15); }
}

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

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

/* Restriction & Bypass Box */
.restriction-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

.restriction-box.unlocked {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.restriction-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.restriction-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.restriction-text strong {
  display: block;
  font-size: 0.95rem;
  color: #fca5a5;
  margin-bottom: 2px;
}

.restriction-box.unlocked .restriction-text strong {
  color: #6ee7b7;
}

.restriction-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.bypass-control {
  margin-top: 10px;
}

.bypass-input-wrap {
  display: flex;
  gap: 8px;
}

.bypass-input-wrap input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.bypass-input-wrap input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(138, 75, 255, 0.2);
}

.btn-bypass {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-bypass:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.bypass-hint-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.8rem;
}

.bypass-hint {
  color: var(--text-dim);
  font-style: italic;
}

.bypass-message {
  font-weight: 500;
}

.bypass-message.error {
  color: var(--status-red);
}

.bypass-message.success {
  color: var(--status-green);
}

/* Responsive */
@media (max-width: 720px) {
  .navbar {
    padding: 16px 0;
  }
  .badge-pill {
    display: none;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .url-form {
    flex-direction: column;
  }
  .btn-primary {
    padding: 14px;
    width: 100%;
  }
  .result-grid {
    grid-template-columns: 1fr;
  }
  .platforms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
