:root {
  --accent: #3b4cca;          
  --accent-light: #eef0fd;   
  --text: #1c1f33;
  --text-soft: #6b7089;
  --border: #dfe2ee;
  --page-bg: #f4f5fa;
  --danger: #c0392b;
  --success: #1f9d55;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
  color: var(--text);
  min-height: 100vh;
  padding: 60px 20px;
  background-color: var(--page-bg);
  background-image: radial-gradient(#d3d7e8 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- Card ---------- */
.container {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  /* two shadows: a tight one and a wide soft one */
  box-shadow:
    0 1px 2px rgba(28, 31, 51, 0.06),
    0 24px 48px -12px rgba(28, 31, 51, 0.14);
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.header-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 2px;
}
  /* File drop zone  */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  background: #fbfbfe;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone.drag-over {
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 76, 202, 0.25); }
  50%      { box-shadow: 0 0 0 12px rgba(59, 76, 202, 0); }
}

  /* File Drop Zone icon */
.drop-zone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

/* icon turns solid when hover or drag over */
.drop-zone:hover .drop-zone-icon,
.drop-zone.drag-over .drop-zone-icon {
  background: var(--accent);
  color: #fff;
}

.drop-zone p {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
}

.drop-zone .browse {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drop-zone small {
  color: var(--text-soft);
  font-size: 13px;
}

.file-input { display: none; }

/* ---------- Error ---------- */
.error {
  background: #fdecea;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  font-size: 14px;
  border-left: 4px solid var(--danger);
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ---------- Preview Grid ---------- */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

/* the grid is empty until files are added */
.preview-grid:empty { margin-top: 0; }

.file-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  position: relative;
  transition: box-shadow 0.2s;
}

.file-card:hover {
  box-shadow: 0 8px 20px -8px rgba(28, 31, 51, 0.2);
}

.file-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--page-bg);
}

.file-info {
  margin-top: 10px;
  padding: 0 4px;
  font-size: 13px;
}

.file-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  color: var(--text-soft);
  font-size: 12px;
  margin-top: 2px;
}
 
  
  /* File Remove button */
.remove-btn {      
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(28, 31, 51, 0.75);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-btn:hover { background: var(--danger); }

/* ---------- Progress Bar ---------- */
.progress-container {
  margin: 10px 4px 0;
  height: 6px;
  background: #e8eaf4;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.progress-bar.done { background: var(--success); }

.status {
  font-size: 12px;
  color: var(--text-soft);
  margin: 6px 4px 4px;
}

/* ---------- Clear all button ---------- */
.clear-all {
  display: block;
  margin: 24px auto 0;
  padding: 10px 22px;
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.clear-all:hover {
  background: #fdecea;
  border-color: var(--danger);
}

/* ---------- Keyboard focus ---------- */
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Media Queries for smaller screens ---------- */
@media (max-width: 480px) {
  body { padding: 24px 12px; }
  .container { padding: 20px; }
  .header { align-items: flex-start; }
}
