/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-50:  #eff6ff;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --green-600: #16a34a;
  --green-50:  #f0fdf4;
  --red-600:  #dc2626;
  --red-50:   #fef2f2;
  --radius:   12px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-700);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* ===== HEADER ===== */
.header {
  background: #fff;
  border-bottom: 1px solid var(--gray-300);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.brand { display: flex; align-items: center; gap: .75rem; }
.brand-logo { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.brand-sub  { font-size: .75rem; color: var(--gray-500); }

.partners { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.partner-tag {
  font-size: .7rem;
  font-weight: 600;
  color: var(--blue-700);
  background: var(--blue-50);
  padding: .2rem .55rem;
  border-radius: 999px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.partner-sep { color: var(--gray-300); font-size: .8rem; }

/* ===== MAIN ===== */
.main { flex: 1; padding: 2.5rem 1rem 3rem; }
.container { max-width: 860px; margin: 0 auto; }

/* ===== HERO ===== */
.hero { text-align: center; margin-bottom: 2rem; }
.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .6rem;
}
.hero-desc {
  font-size: .95rem;
  color: var(--gray-500);
  max-width: 520px;
  margin: 0 auto;
}

/* ===== CARD ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.drop-icon { margin-bottom: 1rem; }
.drop-title { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: .3rem; }
.drop-or    { font-size: .85rem; color: var(--gray-500); margin: .5rem 0; }
.drop-hint  { font-size: .78rem; color: var(--gray-500); margin-top: .75rem; }

.btn-select {
  display: inline-block;
  padding: .5rem 1.25rem;
  background: var(--blue-600);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  transition: background .2s;
}
.btn-select:hover { background: var(--blue-700); }

/* ===== FILE LIST ===== */
.file-list { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .9rem;
  background: var(--gray-100);
  border-radius: 8px;
  gap: .75rem;
}
.file-item-info { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; }
.file-icon { font-size: 1.1rem; flex-shrink: 0; }
.file-name { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: .78rem; color: var(--gray-500); white-space: nowrap; }
.file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  padding: .2rem .4rem;
  border-radius: 4px;
  font-size: .9rem;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.file-remove:hover { color: var(--red-600); background: var(--red-50); }

/* ===== ACTIONS ===== */
.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.25rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-700); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--gray-300); color: var(--gray-500); cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1rem;
  background: none;
  color: var(--gray-500);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--gray-500); color: var(--gray-700); }

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  background: none;
  color: var(--blue-600);
  border: 1px solid var(--blue-500);
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-ghost-sm:hover { background: var(--blue-50); }

/* ===== PROGRESS ===== */
.progress-card { padding: 1.25rem 1.75rem; }
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-700);
}
#progressPct { color: var(--blue-600); font-weight: 600; }

.progress-track {
  background: var(--gray-100);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
  border-radius: 999px;
  width: 0%;
  transition: width .4s ease;
}
.progress-hint { font-size: .8rem; color: var(--gray-500); margin-top: .6rem; }

/* ===== RESULTS ===== */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.results-title { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }

.result-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: .9rem;
  border-left: 3px solid var(--blue-500);
}
.result-card.error { border-left-color: var(--red-600); }

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.result-filename { font-size: .9rem; font-weight: 600; color: var(--gray-900); }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .85rem;
  background: var(--green-50);
  color: var(--green-600);
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: background .2s;
}
.btn-download:hover { background: #dcfce7; }

.result-text {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--gray-700);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  padding: .9rem 1rem;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.error-msg { font-size: .88rem; color: var(--red-600); padding: .5rem 0; }

/* ===== FOOTER ===== */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.footer-inner { max-width: 860px; margin: 0 auto; }
.footer p { font-size: .8rem; }
.footer-tech { margin-top: .3rem; color: var(--gray-500); }
.footer strong { color: var(--gray-300); }

/* ===== UTILS ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .hero-title { font-size: 1.35rem; }
  .card { padding: 1.25rem; }
  .drop-zone { padding: 1.75rem 1rem; }
  .partners { display: none; }
  .header-inner { padding: .75rem 1rem; }
  .actions { flex-direction: column-reverse; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }
}

/* ===== LANGUAGE SELECTOR ===== */
.options-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.option-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--blue-700);
  white-space: nowrap;
}

.lang-select {
  flex: 1;
  min-width: 180px;
  padding: .4rem .75rem;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
  color: var(--gray-700);
  font-size: .88rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.lang-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
