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

/* ─── Design Tokens (Dark – Blue palette from logo) ─────────────────────── */
:root {
  --bg: #060a14;
  --surface: rgba(10, 18, 40, 0.92);
  --surface-2: rgba(16, 26, 56, 0.85);
  --border: rgba(10, 179, 217, 0.22);
  --border-hover: rgba(10, 179, 217, 0.60);
  --accent: #0ab3d9;
  --accent-2: #0891b2;
  --accent-3: #1a3e72;
  --glow-sm: 0 0 18px rgba(10, 179, 217, 0.20);
  --glow-md: 0 0 40px rgba(10, 179, 217, 0.28);
  --text: #e8f4ff;
  --muted: #7a90b8;
  --success: #0ab3d9;
  --error: #ef4444;
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --text-gradient: linear-gradient(135deg, #bfefff 0%, #0ab3d9 60%, #0891b2 100%);
  --card-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

[data-theme='light'] {
  --bg: #f0f7ff;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-2: rgba(224, 240, 255, 0.85);
  --border: rgba(10, 179, 217, 0.30);
  --border-hover: rgba(10, 179, 217, 0.65);
  --accent: #0891b2;
  --accent-2: #0e7490;
  --accent-3: #1a3e72;
  --glow-sm: 0 0 18px rgba(10, 179, 217, 0.12);
  --glow-md: 0 0 40px rgba(10, 179, 217, 0.18);
  --text: #0f2848;
  --muted: #4a6a8a;
  --success: #0891b2;
  --error: #dc2626;
  --text-gradient: linear-gradient(135deg, #1a3e72 0%, #0891b2 60%, #0ab3d9 100%);
  --card-shadow: 0 20px 40px rgba(10, 60, 120, 0.10);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Radial glow background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(10, 179, 217, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(26, 62, 114, 0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem 4rem;
}

/* ─── Theme Toggle Button ────────────────────────────────────────────────── */
.theme-toggle {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.theme-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-hover);
  background: var(--surface);
  transform: scale(1.08);
  box-shadow: var(--glow-sm);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Logo JPG: fondo blanco desaparece en modo oscuro con multiply */
.hero-logo {
  max-width: 280px;
  height: auto;
  margin: 0 auto 1.25rem auto;
  display: block;
  mix-blend-mode: multiply;
  border-radius: 8px;
}

/* Modo claro: el fondo blanco encaja perfecto, desactivamos el blend */
[data-theme='light'] .hero-logo {
  mix-blend-mode: normal;
}

.hero h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--card-shadow);
}

/* ─── Drop Zone ──────────────────────────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  background: var(--surface-2);
  text-align: center;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--border-hover);
  background: rgba(10, 179, 217, 0.06);
  box-shadow: var(--glow-md);
  transform: translateY(-2px);
}

.drop-zone.dragover {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(10, 179, 217, 0.4); }
  70%  { box-shadow: 0 0 0 15px rgba(10, 179, 217, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 179, 217, 0); }
}

#file-input {
  display: none;
}

.upload-icon {
  width: 56px;
  height: 56px;
  background: rgba(10, 179, 217, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background var(--transition), transform var(--transition);
}

.drop-zone:hover .upload-icon,
.drop-zone.dragover .upload-icon {
  background: rgba(10, 179, 217, 0.22);
  transform: scale(1.08);
}

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

.drop-subtext {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -0.4rem;
}

/* ─── Files Section ──────────────────────────────────────────────────────── */
.files-list {
  margin-top: 1.75rem;
}

.files-list h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

#files-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  animation: fadeSlideIn 0.22s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.file-info svg {
  color: var(--accent);
  flex-shrink: 0;
}

.file-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  flex-shrink: 0;
}

.status-uploading { color: var(--accent); background: rgba(10, 179, 217, 0.12); }
.status-done      { color: var(--success); background: rgba(10, 179, 217, 0.12); }
.status-error     { color: var(--error); background: rgba(239, 68, 68, 0.1); }

/* ─── Results Section ────────────────────────────────────────────────────── */
.results-section {
  margin-top: 1.75rem;
  animation: fadeSlideIn 0.3s ease both;
}

.results-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: transparent;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--text);
}

.numeric {
  text-align: right;
  font-family: 'Inter', monospace;
  font-feature-settings: "tnum";
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(10, 179, 217, 0.04);
}

/* ─── Actions ────────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 60%, var(--accent-3) 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 8px 20px rgba(10, 179, 217, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(10, 179, 217, 0.50);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ─── Status Message ─────────────────────────────────────────────────────── */
.status-message {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition);
}

.status-message.success {
  color: var(--success);
  opacity: 1;
}

.status-message.error {
  color: var(--error);
  opacity: 1;
}
