/* Scoped Reset (only inside the tool wrapper) */
.ilc-page, .ilc-page * , .ilc-page *::before, .ilc-page *::after { box-sizing: border-box; }
.ilc-page { 
  min-height: 100%;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #2e2e2e;
  background: transparent; /* prevent grey area expanding with injected ads */
}

.ilc-page {
  max-width: 920px;
  margin: 40px auto 80px;
  padding: 0 16px;
}

.ilc-page .title {
  margin: 0 0 6px;
  text-align: center;
  font-weight: 700;
  font-size: 32px;
  color: #33366e;
}

.ilc-page .subtitle {
  margin: 0 0 20px;
  text-align: center;
  color: #6c6f93;
}

.ilc-page .panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(37, 44, 97, 0.08);
  padding: 20px 20px 12px;
  border: 1px solid #ececf5;
}

.ilc-page .panel-top { display: flex; justify-content: flex-end; }

.ilc-page .dimension-toggle { display: inline-flex; align-items: center; gap: 10px; }
.ilc-page .dimension-toggle .label { color: #6c6f93; font-size: 14px; }

.ilc-page .chip {
  border: none;
  padding: 6px 10px;
  font-size: 13px;
  background: #ececf7;
  color: #4b4f86;
  border-radius: 7px;
  cursor: pointer;
}
.ilc-page .chip.active { background: #5458d4; color: #fff; }

.ilc-page .dropzone {
  margin-top: 12px;
  border: 3px dashed #b5b5de;
  border-radius: 12px;
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
  position: relative;
  outline: none;
}
.ilc-page .dropzone.focus { box-shadow: 0 0 0 4px rgba(84, 88, 212, 0.2); }
.ilc-page .drop-hint { color: #8a8fb0; margin: 8px 0 14px; }

.ilc-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.ilc-page .btn.primary { background: #198754; color: #fff; }
.ilc-page .btn.action { background: #4c50d7; color: #fff; }
.ilc-page .btn.small { padding: 6px 10px; font-size: 13px; background: #4c50d7; color: #fff; }
.ilc-page .btn:disabled { opacity: 0.6; cursor: not-allowed; }

.ilc-page .controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.ilc-page .size-label { color: #333; }
.ilc-page .size-input {
  width: 100px;
  padding: 8px 10px;
  border: 1px solid #d6d6ec;
  border-radius: 6px;
  outline: none;
}
.ilc-page .unit-select {
  padding: 8px 10px;
  border: 1px solid #d6d6ec;
  border-radius: 6px;
  background: #fff;
  color: #2e2e2e;
}
.ilc-page .unit { color: #6c6f93; }

/* Batch controls */
.ilc-page .batch-controls {
  margin-top: 24px;
  padding: 20px;
  background: #f8f9ff;
  border-radius: 8px;
  border: 1px solid #e0e2ff;
}

.ilc-page .batch-progress {
  margin-top: 15px;
  display: none;
}

.ilc-page .progress-bar {
  height: 8px;
  background: #e0e2ff;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ilc-page .progress-fill {
  height: 100%;
  width: 0%;
  background: #4c50d7;
  transition: width 0.3s ease;
}

.ilc-page .progress-text {
  display: flex;
  justify-content: space-between;
  color: #6c6f93;
  font-size: 14px;
}

.ilc-page #timeRemaining {
  color: #4c50d7;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .ilc-page .batch-controls {
    padding: 15px;
  }
  
  .ilc-page .progress-text {
    flex-direction: column;
    gap: 4px;
  }
  
  .ilc-page #timeRemaining {
    margin-left: 0 !important;
  }
}

/* Completion overlay */
.done-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 16, 45, 0.55);
  display: grid;
  place-items: center;
  z-index: 9999;
}
.done-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(20, 24, 84, 0.25);
  padding: 28px 24px;
  text-align: center;
  max-width: 360px;
}
.done-icon { margin-bottom: 10px; }
.done-card h2 { margin: 6px 0 6px; color: #33366e; }
.done-card p { margin: 0 0 16px; color: #6c6f93; }

.ilc-page .note {
  color: #6c6f93;
  font-size: 13px;
  margin-top: 8px;
}

.ilc-page .queue { margin: 18px 0; display: grid; gap: 12px; }
.ilc-page .item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fbfbff;
  border: 1px solid #ececf5;
  border-radius: 10px;
  padding: 10px;
}
.ilc-page .thumb { width: 64px; height: 64px; border-radius: 8px; background: #f0f1ff center/cover no-repeat; }
.ilc-page .meta { display: grid; gap: 4px; }
.ilc-page .name { font-weight: 600; color: #3a3d7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ilc-page .sizes { color: #6c6f93; font-size: 12px; }
.ilc-page .actions { display: grid; gap: 8px; justify-items: end; }
.ilc-page progress { width: 120px; height: 10px; accent-color: #4c50d7; }

.ilc-page .batch-controls {
  background: #f4f6ff;
  border: 1px solid #e1e5ff;
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

.ilc-page #batchButtons {
  justify-content: center;
  align-items: center;
  gap: 10px;
}

@media (max-width: 560px) {
  .ilc-page .controls { flex-wrap: wrap; }
  .ilc-page .item { grid-template-columns: 48px 1fr; }
  .ilc-page .actions { justify-items: stretch; }
  .ilc-page progress { width: 100%; }
}
