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

:root {
  --blue-600:  #2563EB;
  --blue-700:  #1D4ED8;
  --blue-50:   #EFF6FF;
  --blue-100:  #DBEAFE;
  --slate-700: #334155;
  --slate-500: #64748B;
  --slate-300: #CBD5E1;
  --slate-100: #F1F5F9;
  --green-500: #10B981;
  --red-500:   #EF4444;
  --white:     #FFFFFF;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
}

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #F0F7FF 0%, #E8F0FE 100%);
  min-height: 100vh;
  color: var(--slate-700);
  line-height: 1.6;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-100);
  padding: 1rem 2rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-600);
  text-decoration: none;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--slate-700);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--slate-500);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2.5rem;
}

/* ── Drop Zone ────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2.5px dashed var(--slate-300);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.drop-icon { margin-bottom: 0.5rem; }

.drop-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--slate-700);
}

.drop-sub {
  color: var(--slate-500);
  font-size: 0.9rem;
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--slate-500);
  margin-top: 0.25rem;
}

/* ── File Preview ─────────────────────────────────────────────────────────── */
.file-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--slate-700);
  word-break: break-all;
}

.file-size {
  font-size: 0.8rem;
  color: var(--slate-500);
}

.btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--slate-500);
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.btn-remove:hover { color: var(--red-500); background: #FEE2E2; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue-600);
  color: var(--white);
}
.btn-primary:hover { background: var(--blue-700); }

.btn-convert {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.85rem;
  font-size: 1rem;
  background: var(--blue-600);
  color: var(--white);
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.18s;
  position: relative;
}

.btn-convert:hover:not(:disabled) { background: var(--blue-700); transform: translateY(-1px); }
.btn-convert:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress-wrap {
  margin-top: 1rem;
  height: 6px;
  background: var(--slate-100);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-600), var(--green-500));
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Status Message ───────────────────────────────────────────────────────── */
.status {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.status.success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.status.error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.status.info {
  background: var(--blue-50);
  color: #1E40AF;
  border: 1px solid var(--blue-100);
}

/* ── Features ─────────────────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.feature-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.feature-icon { font-size: 2rem; margin-bottom: 0.6rem; }

.feature-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}

.feature-item p {
  font-size: 0.85rem;
  color: var(--slate-500);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.25rem;
  font-size: 0.82rem;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-100);
  background: var(--white);
}

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

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .card { padding: 1.25rem; }
  .drop-zone { padding: 1.75rem 0.75rem; }
}
