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

:root {
  --bg:           #050810;
  --surface:      #0c1223;
  --card-bg:      rgba(12, 18, 35, 0.75);
  --violet:       #7c3aed;
  --cyan:         #06b6d4;
  --grad:         linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #475569;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(124,58,237,0.45);
  --success:      #10b981;
  --error:        #f43f5e;
  --radius:       18px;
  --radius-sm:    10px;
  --shadow:       0 24px 64px rgba(0,0,0,0.55);
  font-family: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Animated background orbs ── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  animation: orbDrift 14s ease-in-out infinite alternate;
}
.orb-1 { width: 500px; height: 500px; background: var(--violet); top: -120px; left: -140px; animation-duration: 16s; }
.orb-2 { width: 400px; height: 400px; background: var(--cyan);   bottom: -100px; right: -100px; animation-duration: 12s; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: #ec4899;        top: 40%; left: 55%; animation-duration: 18s; animation-delay: -8s; opacity: 0.1; }

@keyframes orbDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.08); }
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  background: rgba(5, 8, 16, 0.7);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 36px; height: 36px; border-radius: 10px; }
.brand-name { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.nav-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(124,58,237,0.18);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Main ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 40px;
}

/* ── Hero ── */
.hero { text-align: center; margin-bottom: 40px; }
.hero-title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { color: var(--text-2); font-size: 1rem; font-weight: 400; max-width: 480px; margin: 0 auto; }

/* ── Converter Card ── */
.card {
  width: 100%;
  max-width: 780px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 32px;
}

/* ── Drop Zone ── */
.drop-zone {
  position: relative;
  border: 2px dashed rgba(124,58,237,0.35);
  border-radius: var(--radius-sm);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  background: rgba(124,58,237,0.04);
}
.drop-zone:hover,
.drop-zone:focus-within {
  border-color: rgba(124,58,237,0.7);
  background: rgba(124,58,237,0.08);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.12);
  outline: none;
}
.drop-zone.drag-over {
  border-color: var(--cyan);
  background: rgba(6,182,212,0.09);
  box-shadow: 0 0 32px rgba(6,182,212,0.2);
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.drop-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(124,58,237,0.12);
  margin-bottom: 16px;
  animation: pulseRing 3s ease-in-out infinite;
}
.drop-icon { width: 32px; height: 32px; color: #a78bfa; }
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(124,58,237,0); }
}
.drop-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.drop-sub { font-size: 0.92rem; color: var(--text-2); }
.drop-link { color: #a78bfa; text-decoration: underline; cursor: pointer; }
.drop-hint { margin-top: 10px; font-size: 0.78rem; color: var(--text-3); }

/* ── Preview Row ── */
.preview-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  animation: slideUp 0.3s ease;
}
.preview-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}
.preview-thumb {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.clear-btn {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.clear-btn:hover { background: var(--error); color: white; }
.clear-btn svg { width: 10px; height: 10px; }
.preview-info { flex: 1; }
.info-name { font-weight: 600; font-size: 0.95rem; word-break: break-all; margin-bottom: 4px; }
.info-meta { font-size: 0.82rem; color: var(--text-2); margin-bottom: 14px; }
.info-from { font-size: 0.85rem; color: var(--text-2); margin-bottom: 10px; }
.info-from strong { color: var(--text); }

/* ── Format Pills ── */
.format-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.pill {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.pill:hover { border-color: rgba(124,58,237,0.5); color: #a78bfa; }
.pill.active {
  background: var(--grad);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 12px rgba(124,58,237,0.4);
}
.pill.same-fmt { opacity: 0.4; cursor: not-allowed; }

/* ── Convert Button ── */
.convert-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: var(--grad);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.convert-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.convert-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,58,237,0.5); }
.convert-btn:hover::after { transform: translateX(100%); }
.convert-btn:active { transform: translateY(0); }
.convert-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-icon svg { width: 18px; height: 18px; }

/* ── Status Blocks ── */
.status-block {
  text-align: center;
  padding: 32px 20px;
  animation: slideUp 0.3s ease;
}
.status-title { font-size: 1.1rem; font-weight: 600; margin: 12px 0 6px; }
.status-sub { font-size: 0.9rem; color: var(--text-2); }

/* Spinner */
.spinner-ring {
  width: 56px; height: 56px;
  border: 3px solid rgba(124,58,237,0.2);
  border-top-color: var(--violet);
  border-right-color: var(--cyan);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Success icon */
.success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(16,185,129,0.12);
  border: 2px solid rgba(16,185,129,0.4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  color: var(--success);
  animation: popIn 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}
.success-icon svg { width: 26px; height: 26px; }

/* Error icon */
.error-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(244,63,94,0.1);
  border: 2px solid rgba(244,63,94,0.35);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  color: var(--error);
  animation: popIn 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}
.error-icon svg { width: 26px; height: 26px; }
.error-msg { color: var(--error); white-space: pre-wrap; margin-top: 6px; }

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Result actions */
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 18px 0 10px; }
.download-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 28px;
  background: var(--grad);
  color: white;
  font-weight: 600; font-size: 0.95rem; font-family: inherit;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,58,237,0.5); }
.download-btn svg { width: 18px; height: 18px; }
.ghost-btn {
  padding: 10px 22px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ghost-btn:hover { border-color: rgba(124,58,237,0.5); color: #a78bfa; }
.expiry-note { font-size: 0.78rem; color: var(--text-3); margin-top: 6px; }

/* ── Utilities ── */
.hidden { display: none !important; }
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Footer notes ── */
.privacy-note {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
}

/* ── Site Footer ── */
.site-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-3);
}
.site-footer a { color: #a78bfa; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 560px) {
  .card { padding: 20px 16px; }
  .preview-row { flex-direction: column; align-items: center; }
  .preview-thumb { width: 100%; height: 180px; }
  .preview-info { width: 100%; }
  .hero-title { font-size: 1.7rem; }
}
