/* File drop zone */
.drop-zone {
  border: 2px dashed #cfe0f0;
  border-radius: 10px;
  background: #f8fbff;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragging {
  border-color: #0078d4;
  background: #eef6ff;
}
.drop-icon { font-size: 30px; line-height: 1; }
.drop-text { margin-top: 10px; font-size: 15px; color: #333; font-weight: 600; }
.drop-link { color: #0078d4; text-decoration: underline; }
.drop-note { margin-top: 6px; font-size: 12px; color: #999; }

.file-info {
  display: none;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0078d4;
  word-break: break-all;
}
.organize-hint {
  display: none;
  margin-top: 14px;
  font-size: 13px;
  color: #555;
}
.organize-hint.show { display: block; }

/* Thumbnail grid */
.page-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.page-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  text-align: center;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.page-card:hover { border-color: #0078d4; }
.page-card.dragging { opacity: 0.4; }
.page-card.drop-target { border-color: #0078d4; box-shadow: 0 0 0 2px #cfe0f0; }
.page-card img {
  width: 100%;
  height: auto;
  border: 1px solid #eee;
  border-radius: 4px;
  display: block;
  pointer-events: none;
  background: #fafafa;
}
.page-card .pg-label { margin-top: 6px; font-size: 12px; color: #666; }
.page-card .pg-ctrl { margin-top: 6px; display: flex; justify-content: center; gap: 6px; }
.page-card .pg-ctrl button {
  width: 30px;
  height: 26px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.page-card .pg-ctrl button:hover:not(:disabled) { background: #f0f6ff; border-color: #0078d4; color: #0078d4; }
.page-card .pg-ctrl button:disabled { opacity: 0.35; cursor: default; }

/* Action */
.btn-merge {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-merge:hover:not(:disabled) { background: #005fa3; }
.btn-merge:disabled { opacity: 0.6; cursor: default; }

.pdf-status {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-word;
}
.pdf-status.show { display: block; }
.pdf-status.error { background: #fdecea; border: 1px solid #f5c6c0; color: #c0392b; }
.pdf-status.busy { background: #f0f6ff; border: 1px solid #c5ddf9; color: #0078d4; }

.result-box {
  display: none;
  margin-top: 14px;
  background: #f0f6ff;
  border: 1px solid #c5ddf9;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.result-box.show { display: block; }
.btn-download {
  display: inline-block;
  padding: 11px 22px;
  background: #fff;
  color: #0078d4;
  border: 1px solid #0078d4;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-download:hover { background: #e8f2fc; }
