:root {
  --bg-primary: #0a0b10;
  --bg-secondary: #12141f;
  --bg-card: rgba(22, 25, 38, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #6366f1;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  line-height: 1.5;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.8rem;
}

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

/* Main Card */
.main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
}

/* Tab Switcher */
.tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  margin-bottom: 1.8rem;
  border: 1px solid var(--border-color);
}

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

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

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Input Form */
.input-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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

.url-input {
  width: 100%;
  padding: 0.95rem 4.5rem 0.95rem 1.1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.url-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.paste-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.submit-btn {
  padding: 0.95rem 1.6rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.submit-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Tip Box */
.tip-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: #cbd5e1;
}

.tip-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 2.8rem 1.5rem;
  text-align: center;
  background: rgba(18, 20, 31, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
  opacity: 0.85;
}

.drop-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.drop-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Progress Section */
.progress-card {
  margin-top: 1.5rem;
  padding: 1.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.progress-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-percent {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 9999px;
  transition: width 0.25s ease;
}

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

/* Result Section */
.result-card {
  margin-top: 1.8rem;
  padding: 1.5rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
}

.result-video {
  width: 100%;
  border-radius: var(--radius-md);
  background: #000;
  max-height: 420px;
  margin-bottom: 1.2rem;
}

.result-meta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #cbd5e1;
}

.actions-group {
  display: flex;
  gap: 0.8rem;
}

.download-btn {
  flex: 1;
  padding: 0.9rem;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.download-btn:hover {
  background: #059669;
  box-shadow: 0 4px 15px var(--success-glow);
}

.reset-btn {
  padding: 0.9rem 1.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Features Footer */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.feature-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .title { font-size: 2rem; }
  .input-group { flex-direction: column; }
  .submit-btn { width: 100%; justify-content: center; }
  .actions-group { flex-direction: column; }
}
