/* app.css - UI for uploader & history */

/* Layout polish */
.soft-card {
  border: 1px solid rgba(13,110,253,0.12);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

/* History one-line layout */
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0; /* allow children to shrink */
}
.history-thumb { flex: 0 0 auto; }
.history-img {
  display: block;
  width: 96px;
  height: 72px;
  object-fit: cover;
  cursor: pointer;
  transition: transform .12s ease;
}
.history-img:hover { transform: scale(1.02); }
.history-meta {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.history-text .history-date,
.history-text .history-file {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.history-text .history-count {
  white-space: nowrap;
}

@media (min-width: 576px) {
  .history-img { width: 128px; height: 96px; }
}

@media (max-width: 380px) {
  .history-item { gap: 8px; }
  .history-img { width: 64px; height: 48px; }
  .history-meta { font-size: 12px; }
  .history-text { font-size: 13px; }
  .history-count { font-size: 13px; }
}

/* Fallback Lightbox */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1080; /* above navbar, close to Bootstrap modal */
}
.img-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.img-lightbox__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 95vw;
  max-height: 90vh;
}
.img-lightbox__content img {
  display: block;
  max-width: 95vw;
  max-height: 90vh;
}
.img-lightbox__close {
  display: none; /* hide the X button per request */
}

.tabbar {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #f7f9fc;
}
.tabbar .btn {
  border-radius: 10px !important;
  padding: 8px 16px;
  font-weight: 600;
}
.tabbar .btn.active {
  background: #fff !important;
  border: 1px solid rgba(0,0,0,0.08);
}

/* Dropzone */
.dropzone {
  position: relative;
  min-height: 240px;
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: 12px;
  background: #f9fbff;
  display: grid;
  place-items: center;
  padding: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .1s;
}
.dropzone.is-dragover {
  border-color: #0d6efd;
  background: #eef5ff;
  transform: translateY(-1px);
}
.dz-empty {
  text-align: center;
  color: #6c757d;
}
.dz-actions {
  margin-top: 6px;
}
.dz-action-btn {
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 10px;
  min-width: 140px;
}
.dz-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 6px;
}
.dz-text {
  font-weight: 500;
}

.dz-preview {
  position: relative;
  width: 100%;
}
.dz-preview img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}
.dz-clear {
  position: absolute;
  top: -10px;
  right: -10px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 30px;
}

/* Result panel */
.resultpanel {
  min-height: 240px;
  border: 2px dashed rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #f7fbff;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  color: #3056d3;
}
.resultpanel .spinner-lg {
  font-size: 40px;
  opacity: .3;
}
.resultpanel .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Buttons */
.btn-primary {
  background: #1f6ef3;
  border-color: #1f6ef3;
}
.btn-primary:hover {
  background: #175ee0;
  border-color: #175ee0;
}

/* Gallery grid (history) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.gallery-item {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
