@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #06060a;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-bg-hover: rgba(255, 255, 255, 0.07);
  --accent-primary: #8b5cf6;
  --accent-secondary: #6366f1;
  --accent-tertiary: #3b82f6;
  --text-primary: #f1f5f9;
  --text-secondary: #64748b;
  --text-muted: #475569;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(139, 92, 246, 0.4);
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --glow-primary: rgba(139, 92, 246, 0.15);
  --glow-secondary: rgba(99, 102, 241, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

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

/* ── Animated Background ── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 15%, var(--glow-primary) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, var(--glow-secondary) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(59,130,246,0.06) 0%, transparent 60%);
  animation: bgShift 20s ease-in-out infinite alternate;
}
.bg-grid::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
@keyframes bgShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(20deg); }
}

/* ── Floating Orbs ── */
.orb {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(80px); opacity: 0.4; animation: orbFloat 15s ease-in-out infinite;
}
.orb-1 { width: 300px; height: 300px; background: var(--accent-primary); top: 10%; left: -5%; animation-delay: 0s; }
.orb-2 { width: 250px; height: 250px; background: var(--accent-tertiary); bottom: 10%; right: -5%; animation-delay: -5s; }
.orb-3 { width: 200px; height: 200px; background: #ec4899; top: 50%; left: 50%; animation-delay: -10s; opacity: 0.2; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ── App Shell ── */
.app-wrapper {
  position: relative; z-index: 1;
  max-width: 960px; margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  min-height: 100vh;
}

/* ── Top Bar ── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; animation: fadeSlideDown 0.6s ease-out;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo svg, .logo i { color: var(--accent-primary); }
.top-actions { display: flex; gap: 0.75rem; align-items: center; }
.icon-btn {
  background: var(--card-bg); border: 1px solid var(--border-color);
  color: var(--text-secondary); width: 40px; height: 40px;
  border-radius: var(--radius-md); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
}
.icon-btn:hover { background: var(--card-bg-hover); color: var(--text-primary); border-color: var(--border-hover); }

/* ── Tab Navigation ── */
.tab-nav {
  display: flex; gap: 4px; padding: 4px;
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); margin-bottom: 2rem;
  animation: fadeSlideDown 0.6s ease-out 0.1s both;
}
.tab-btn {
  flex: 1; padding: 0.75rem 1rem; border: none; background: transparent;
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  border-radius: var(--radius-md); cursor: pointer;
  transition: all 0.3s ease; display: flex; align-items: center;
  justify-content: center; gap: 8px; white-space: nowrap;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white; font-weight: 600;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.tab-btn .badge {
  background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 700;
}
.tab-btn.active .badge { background: rgba(255,255,255,0.25); }

/* ── Tab Panels ── */
.tab-panel { display: none; animation: fadeSlideUp 0.4s ease-out; }
.tab-panel.active { display: block; }

/* ── Hero Card ── */
.hero-card {
  text-align: center; padding: 2.5rem 2rem;
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); margin-bottom: 1.5rem;
  animation: fadeSlideUp 0.5s ease-out 0.2s both;
}
.hero-card h1 {
  font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-card .subtitle {
  color: var(--text-secondary); font-size: 1rem; max-width: 500px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(99,102,241,0.1));
  border: 1px solid rgba(139,92,246,0.2);
  padding: 6px 14px; border-radius: 99px; font-size: 0.75rem;
  font-weight: 600; color: var(--accent-primary); margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border-color); border-radius: var(--radius-xl);
  padding: 3rem 2rem; margin-bottom: 1.5rem; cursor: pointer;
  transition: all 0.35s ease; position: relative; overflow: hidden;
  background: var(--card-bg);
}
.drop-zone::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius-xl);
  background: radial-gradient(circle at center, var(--glow-primary) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.35s ease;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.04);
  transform: scale(1.01);
}
.drop-zone:hover::before, .drop-zone.drag-over::before { opacity: 1; }
.drop-zone-content { position: relative; z-index: 1; text-align: center; }
.drop-zone-content i, .drop-zone-content svg {
  width: 48px; height: 48px; margin: 0 auto 1rem;
  color: var(--accent-primary); display: block;
}
.drop-zone-text { font-size: 1rem; color: var(--text-secondary); }
.drop-zone-text span { color: var(--accent-primary); font-weight: 600; }
.drop-zone-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ── File Queue ── */
.file-queue { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.875rem 1rem; background: var(--card-bg);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  animation: fadeSlideUp 0.3s ease-out;
}
.file-item-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  flex-shrink: 0;
}
.file-item-icon.doc { background: rgba(59,130,246,0.15); color: #60a5fa; }
.file-item-icon.img { background: rgba(16,185,129,0.15); color: #34d399; }
.file-item-icon.vid { background: rgba(245,158,11,0.15); color: #fbbf24; }
.file-item-icon.aud { background: rgba(236,72,153,0.15); color: #f472b6; }
.file-item-icon.other { background: rgba(148,163,184,0.15); color: #94a3b8; }
.file-item-info { flex: 1; min-width: 0; }
.file-item-name { font-weight: 500; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.file-item-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 6px;
  transition: all 0.2s;
}
.file-item-remove:hover { color: var(--error-color); background: rgba(239,68,68,0.1); }
.file-item-progress {
  height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px;
  margin-top: 6px; overflow: hidden;
}
.file-item-progress-fill {
  height: 100%; border-radius: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-tertiary));
  transition: width 0.4s ease;
}
.file-item.done .file-item-progress-fill { background: var(--success-color); }
.file-item.error .file-item-progress-fill { background: var(--error-color); }
.file-item-status { font-size: 0.7rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.file-item-status.pending { color: var(--text-muted); background: rgba(148,163,184,0.1); }
.file-item-status.converting { color: var(--accent-primary); background: rgba(139,92,246,0.1); }
.file-item-status.done { color: var(--success-color); background: rgba(16,185,129,0.1); }
.file-item-status.error { color: var(--error-color); background: rgba(239,68,68,0.1); }

/* ── Options Panel ── */
.options-panel {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 1.5rem; display: none;
}
.options-panel.visible { display: block; animation: fadeSlideUp 0.3s ease-out; }
.options-title {
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem;
}
.options-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.option-group { display: flex; flex-direction: column; gap: 6px; }
.option-group label {
  font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
select, input[type="number"] {
  background: rgba(15,15,20,0.8); border: 1px solid var(--border-color);
  color: var(--text-primary); padding: 0.7rem 0.875rem;
  border-radius: var(--radius-sm); outline: none; cursor: pointer;
  font-family: inherit; font-size: 0.875rem;
  transition: border-color 0.25s ease;
}
select:focus, input[type="number"]:focus { border-color: var(--accent-primary); }

/* ── Quality Slider ── */
.slider-group { display: flex; flex-direction: column; gap: 6px; }
.slider-group label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.slider-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px;
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  background: var(--accent-primary); border-radius: 50%;
  box-shadow: 0 0 10px rgba(139,92,246,0.4); cursor: pointer;
}
.slider-value {
  min-width: 40px; text-align: right; font-size: 0.85rem;
  font-weight: 600; color: var(--accent-primary);
}

/* ── Buttons ── */
.btn-primary {
  width: 100%; padding: 1rem; border: none; border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  font-family: inherit; display: flex; align-items: center;
  justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white; transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139,92,246,0.25);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139,92,246,0.35);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-success {
  width: 100%; padding: 1rem; border: none; border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  font-family: inherit; display: flex; align-items: center;
  justify-content: center; gap: 10px; text-decoration: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(16,185,129,0.25);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16,185,129,0.35); }

.btn-secondary {
  padding: 0.6rem 1.2rem; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--card-bg);
  color: var(--text-secondary); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.25s ease; font-family: inherit;
}
.btn-secondary:hover { background: var(--card-bg-hover); color: var(--text-primary); border-color: var(--border-hover); }

/* ── Stats Row ── */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  padding: 1rem; background: var(--card-bg);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  text-align: center; transition: all 0.3s ease;
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ── Feature Cards ── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem; margin-top: 1.5rem;
}
.feature-card {
  padding: 1.25rem; background: var(--card-bg);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  transition: all 0.3s ease; cursor: default;
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.feature-card i, .feature-card svg { color: var(--accent-primary); margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.35rem; }
.feature-card p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }

/* ── File Info / Analysis ── */
.file-analysis {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem;
  display: none;
}
.file-analysis.visible { display: block; animation: fadeSlideUp 0.3s ease-out; }
.analysis-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.analysis-item { padding: 0.75rem; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); }
.analysis-item .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.analysis-item .value { font-size: 0.95rem; font-weight: 600; margin-top: 4px; color: var(--text-primary); }

/* ── History ── */
.history-panel {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 1.25rem; margin-top: 1.5rem;
}
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border-color);
}
.history-item:last-child { border-bottom: none; }
.history-item .arrow { color: var(--accent-primary); font-weight: 600; }

/* ── Benefit Card ── */
.benefit-card {
  background: var(--card-bg); border: 1px solid var(--border-color);
  padding: 1.5rem; border-radius: var(--radius-lg); margin-top: 1.5rem;
}
.benefit-item {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 0.875rem; color: var(--text-secondary); font-size: 0.9rem;
}
.benefit-item:last-child { margin-bottom: 0; }
.benefit-item i, .benefit-item svg { color: var(--success-color); width: 18px; flex-shrink: 0; }

/* ── Career Badge ── */
.career-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2);
  color: var(--success-color); padding: 6px 14px; border-radius: 99px;
  font-size: 0.75rem; font-weight: 600; margin-bottom: 1rem;
}

/* ── Footer ── */
.app-footer {
  text-align: center; padding: 2rem 0 1rem;
  color: var(--text-muted); font-size: 0.8rem;
}
.app-footer a { color: var(--accent-primary); text-decoration: none; }

/* ── Toast Notifications ── */
.toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.875rem 1.25rem; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500; color: white;
  animation: toastIn 0.4s ease-out; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 10px; max-width: 360px;
}
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.info { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); }
.toast.out { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }

/* ── Animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
.pulse { animation: pulse 2s ease-in-out infinite; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .app-wrapper { padding: 1rem 1rem 2rem; }
  .hero-card { padding: 1.75rem 1.25rem; }
  .hero-card h1 { font-size: 1.5rem; }
  .tab-nav { flex-wrap: wrap; }
  .tab-btn { font-size: 0.78rem; padding: 0.6rem 0.5rem; }
  .tab-btn i { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .drop-zone { padding: 2rem 1rem; }
}
