/* --- Root Variables --- */
:root {
  --ecomlabs-blue: #0077cc;
  --ecomlabs-navy: #14213d;
  --ecomlabs-light-gray: #f5f7fa;
  --border-color: #e5e7eb;
  --text-secondary: #6b7280;
  --font-family: 'Inter', sans-serif;
  --radius: 0.5rem;
}

/* --- Base & Layout --- */
body {
  font-family: var(--font-family);
  background-color: var(--ecomlabs-light-gray);
  color: var(--ecomlabs-navy);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 540px;
  padding: 1rem;
}

/* --- Card --- */
.card {
  background-color: #ffffff;
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ecomlabs-navy);
  margin: 0 0 0.5rem 0;
}

header p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* --- Form Elements --- */
form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.file-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: calc(var(--radius) - 2px);
  width: 100%;
  overflow: hidden;
}

.file-upload-label {
  background-color: #f9fafb;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  border-right: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
  user-select: none;
}

.file-upload-label:hover {
  background-color: #f3f4f6;
}

#file-name {
  padding: 0 1rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Primary Button --- */
.btn-primary {
  background-color: var(--ecomlabs-blue);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* --- Footer Logo --- */
.footer-logo { margin-top: 2rem; }
.footer-logo img {
  max-width: 150px;
  opacity: 0.6;
  margin: 0 auto;
  display: block;
}

/* --- Loading Overlay --- */
#loading-overlay {
  position: fixed; inset: 0;
  background-color: rgba(245,247,250,0.95);
  display: none; /* toggled by JS */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loader { display: flex; gap: 8px; }
.block {
  width: 20px; height: 20px;
  background-color: var(--ecomlabs-navy);
  animation: pulse 1.2s infinite;
}
.block:nth-child(2){ animation-delay: .15s; }
.block:nth-child(3){ animation-delay: .30s; }
.block:nth-child(4){ animation-delay: .45s; }
.block:nth-child(5){ animation-delay: .60s; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.8); opacity: 0.6; }
}
.loading-text {
  margin-top: 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ecomlabs-navy);
}

/* --- Toast (single definitive style) --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #111827; /* dark snackbar */
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  box-shadow: 0 10px 20px rgba(0,0,0,.15);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Error box --- */
.error {
  margin-top: 1rem;
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #7f1d1d;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  text-align: left;
}

/* --- Text logo (fallback image) --- */
.text-logo {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ecomlabs-navy);
  letter-spacing: 0.2px;
}
.text-logo span { color: var(--ecomlabs-blue); }

/* --- Drag & Drop zone --- */
.drop-zone {
  border: 2px dashed rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  margin-bottom: 16px;
  background: rgba(0,0,0,0.02);
  min-height: 110px;
  display: grid;
  place-items: center;
}
.drop-zone:focus-visible {
  box-shadow: 0 0 0 3px rgba(0,120,255,0.25);
}
.drop-zone.dragover {
  border-color: var(--ecomlabs-blue);
  background: rgba(0,119,204,0.06);
  transform: scale(0.995);
}
.drop-zone .dz-inner strong { font-weight: 700; }
.drop-zone .dz-hint { color: #555; }
.drop-zone .dz-types {
  font-size: 12px;
  color: #777;
  margin-top: 6px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Mobile tweaks --- */
@media (max-width: 420px) {
  .card { padding: 1.75rem; }
  header h1 { font-size: 1.65rem; }
  header p { font-size: 0.95rem; }
}

.file-chosen {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
