/* ── Layout ─────────────────────────────────────── */
* {
  box-sizing: border-box;
}

body {
  background-color: #ffffff;
  color: #000;
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.app {
  max-width: 1400px;
  height: calc(100vh - 40px);
  margin: 20px auto;
  padding: 0;
  background: #fff;
  border: 4px solid #000;
  box-shadow: 12px 12px 0px #000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-layout {
  display: grid;
  grid-template-columns: 500px 1fr;
  flex: 1;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.left-panel {
  border-right: 4px solid #000;
  padding: 32px;
  background: #fff;
}

.right-panel {
  background: #fff;
  padding: 0;
}

/* ── Panel Components ───────────────────────────── */
.right-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  color: #000;
  border-bottom: 4px solid #000;
}

.count-badge {
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-clear-mini {
  background: #ff3333;
  color: #fff;
  border: 3px solid #fff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.1s;
}

.btn-clear-mini:hover {
  background: #000;
  color: #fff;
}

.btn-clear-mini:active {
  transform: scale(0.95);
}

.btn-clear-mini:disabled {
  background: #ccc;
  color: #888;
  border-color: #888;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Hero Section ───────────────────────────────── */
.hero-section {
  margin-bottom: 32px;
  position: relative;
}

.banana-cat-wrapper {
  position: absolute;
  top: -25px;
  right: 0;
  height: 120px;
  aspect-ratio: 280 / 498;
  z-index: 10;
  overflow: hidden;
}

.banana-cat-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-section h1 {
  font-size: 40px;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 16px 0;
  line-height: 0.95;
  letter-spacing: -2px;
}

.hero-section p {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.4;
}
.drop-container {
  width: 100%;
  flex: 1;
  min-height: 200px;
  margin-bottom: 16px;
}

/* ── Drop zone ──────────────────────────────────── */
.drop-zone {
  width: 100%;
  height: 100%;
  border: 4px dashed #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.1s ease;
  user-select: none;
  padding: 24px;
}

.drop-zone:hover {
  background: #fff;
}

.drop-zone.dragover {
  background: #ff00e6; /* Neon pink on drag over */
  color: #fff;
  border-style: solid;
}

.drop-label {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.browse-link {
  color: #000;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  background: #fff;
  padding: 0 4px;
}
.drop-zone.dragover .browse-link {
  color: #000;
}

.drop-sub {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

/* ── File list items ────────────────────────────── */
.file-list {
  list-style: none;
  padding: 24px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-content: start;
  gap: 20px;
  overflow-y: auto;
  flex: 1;
}

.file-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 4px solid #000;
  background: #fff;
}

.remove-btn {
  width: 28px;
  height: 28px;
  background: #ff3333;
  color: #fff;
  border: 2px solid #000;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  margin-left: auto;
}

.remove-btn:hover {
  background: #cc0000;
}

.remove-btn:active {
  transform: scale(0.9);
}

.previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preview-box {
  position: relative;
  aspect-ratio: 1;
  border: 3px solid #000;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Checkered background for AFTER preview */
.preview-box.after {
  background-image:
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0px;
  background-color: #fff;
}

.preview-box .placeholder {
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
  color: #000;
}

.preview-box .label {
  position: absolute;
  top: 0;
  left: 0;
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  z-index: 1;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
}

.file-item .file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.file-item .file-size {
  color: #000;
  font-size: 12px;
  background: #00ffbb;
  padding: 2px 6px;
  border: 2px solid #000;
}

/* Status styling removed */

/* Status state classes applied by JS */
.file-item.done {
  background: #00ffbb;
}
.file-item.error {
  background: #ff3333;
  color: #fff;
}

/* ── Controls ───────────────────────────────────── */
.controls {
  margin-top: 16px;
  padding: 16px;
  border: 3px solid #000;
  background: #fff;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 16px;
}

.control-value {
  font-weight: 700;
  background: #000;
  color: #fff;
  padding: 4px 8px;
}

input[type="range"] {
  width: 100%;
  accent-color: #000;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  text-transform: uppercase;
}

/* ── Checkbox Styling ───────────────────────────── */
.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  user-select: none;
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 28px;
  height: 28px;
  border: 3px solid #000;
  background: #fff;
  position: relative;
  transition: all 0.1s;
}

.checkbox-container:hover .checkmark {
  background: #eee;
}

.checkbox-container input:checked + .checkmark {
  background: #00ffbb;
}

.checkbox-container input:checked + .checkmark:after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #000;
}

/* ── Action bar ─────────────────────────────────── */
.action-bar {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.btn-primary {
  flex: 2;
  padding: 16px 24px;
  background: #000;
  color: #fff;
  border: 3px solid #000;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.1s;
  font-family: inherit;
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: none !important;
}

.btn-primary:focus-visible {
  outline: 3px dashed #ff00e6;
  outline-offset: 4px;
}

.btn-primary:disabled {
  background: #ccc;
  color: #666;
  border-color: #666;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none;
}

.btn-ghost {
  flex: 1;
  padding: 16px 24px;
  background: #fff;
  color: #000;
  border: 3px solid #000;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 4px 4px 0px #000;
  transition: all 0.1s;
  font-family: inherit;
}

.btn-ghost:active {
  box-shadow: 0px 0px 0px #000;
  transform: translate(4px, 4px);
}

#process-btn {
  background: #00ffbb;
  color: #000;
  box-shadow: 6px 6px 0px #000;
}
#process-btn:active {
  box-shadow: 0px 0px 0px #000 !important;
  transform: translate(6px, 6px);
}
#process-btn:hover:not(:disabled) {
  background: #00e6a8;
}

/* ── Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: #fff;
  border: 6px solid #000;
  padding: 40px;
  max-width: 450px;
  width: 90%;
  text-align: center;
}

.modal-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  color: #ff3333;
  line-height: 1.2;
  letter-spacing: normal;
}

.modal-card p {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 32px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 16px;
}

.btn-ghost-mini,
.btn-danger-mini {
  flex: 1;
  padding: 16px;
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  border: 4px solid #000;
  text-transform: uppercase;
  transition: all 0.1s;
}

.btn-ghost-mini {
  background: #fff;
}

.btn-danger-mini {
  background: #ff3333;
  color: #fff;
}

.btn-ghost-mini:hover,
.btn-danger-mini:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000;
}

.btn-ghost-mini:active,
.btn-danger-mini:active {
  transform: scale(0.97);
}

/* ── Progress ───────────────────────────────────── */
.progress-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 500px;
  border: 4px solid #000;
  padding: 32px;
  background: #fff;
  box-shadow: 12px 12px 0px #000;
  z-index: 100;
}

.progress-track {
  height: 24px;
  background: #fff;
  border: 3px solid #000;
  width: 100%;
}

.progress-bar {
  height: 100%;
  background: #ff00e6; /* vibrant brutalist progress */
  width: 0%;
  transition: width 0.25s ease;
  border-right: 3px solid #000;
}

.progress-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-top: 12px;
  text-align: center;
  text-transform: uppercase;
}

.sidebar-footer {
  padding: 24px 32px;
  border-top: 4px solid #000;
  background: #fff;
  z-index: 20;
}

.download-area {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* ── Responsiveness ─────────────────────────────── */
@media (max-width: 900px) {
  .app {
    height: auto;
    min-height: 100dvh;
    margin: 0;
    border: none;
    box-shadow: none;
    overflow-x: hidden;
  }

  .app.is-empty {
    overflow: hidden;
    height: 100dvh;
  }

  .main-layout {
    grid-template-columns: 1fr;
    display: block;
    height: auto;
    overflow: visible;
  }

  .panel {
    overflow: visible;
    height: auto;
  }

  .left-panel {
    border-right: none;
    border-bottom: 4px solid #000;
    padding: 16px;
    height: auto;
  }

  .hero-section h1 {
    font-size: 32px;
  }

  .drop-container {
    min-height: 100px;
  }

  .controls {
    margin-top: none;
  }

  .banana-cat-wrapper {
    height: 85px;
    top: -30px;
    right: -5px;
  }

  .right-panel {
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .file-list {
    grid-template-columns: 1fr;
    padding: 16px;
    max-height: none;
    overflow: visible;
  }

  .sidebar-footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    border-top: 4px solid #000;
    padding: 16px;
    background: #fff;
  }

  .progress-wrap {
    width: 90%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  /* Force Centering when no images uploaded */
  .app.is-empty .main-layout {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 24px !important;
    overflow: hidden;
  }

  .app.is-empty .right-panel,
  .app.is-empty .sidebar-footer {
    display: none !important;
  }

  .app.is-empty .left-panel {
    padding: 0 !important;
    border: none !important;
    text-align: center;
    width: 100%;
    max-width: 400px;
  }

  .app.is-empty .hero-section {
    text-align: center;
  }

  .app.is-empty .banana-cat-wrapper {
    right: -5px;
    top: -45px;
  }
}

#download-btn {
  background: #ffe600;
  color: #000;
  padding: 20px;
  font-size: 20px;
}

#download-btn:active {
  transform: scale(0.98);
}

.download-hint {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  background: #000;
  color: #fff;
  padding: 8px;
}

/* Reset hidden items beautifully */
[hidden] {
  display: none !important;
}
