@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #0f1724 0%, #071024 100%);
  color: #eef2ff;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.color-blob {
  position: absolute;
  filter: blur(70px);
  opacity: 0.9;
  transform: scale(1.1);
  mix-blend-mode: screen;
}
.color-blob.b1 {
  width: 420px;
  height: 420px;
  left: -80px;
  top: -50px;
  background: radial-gradient(circle at 30% 30%, #ff7a8a, #ffb86b);
}
.color-blob.b2 {
  width: 520px;
  height: 520px;
  right: -140px;
  top: 40px;
  background: radial-gradient(circle at 60% 40%, #6ad7ff, #6a8bff);
}
.color-blob.b3 {
  width: 360px;
  height: 360px;
  left: 20%;
  bottom: -120px;
  background: radial-gradient(circle at 50% 50%, #9effc6, #5ef1b6);
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 8px;
}
.brand-logo {
  width: 72px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
.site-header h1 {
  font-size: 1.8rem;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #fff 0%, #ffd86b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.95rem;
}

.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 20px auto;
  padding: 20px;
}

.upload-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(8px);
}

.drop-zone {
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
  transition: all 220ms ease;
  width: 100%;
}
.drop-zone.dragover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 18px 50px rgba(106, 139, 255, 0.08),
    inset 0 -8px 30px rgba(90, 220, 255, 0.02);
}
.upload-illu {
  color: #fff;
  opacity: 0.95;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}
.drop-text {
  color: #f8fafc;
  font-size: 1.05rem;
  text-align: center;
}
.link-like {
  color: #ffd86b;
  cursor: pointer;
  text-decoration: underline;
}
.formats {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.auto-hint {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auto-hint input[type="checkbox"] {
  transform: translateY(2px);
  margin-right: 8px;
}

.progress-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: #fff;
  animation: spin 900ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.progress-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.preview-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.preview-header .small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 4px;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#fileInput {
  display: none;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn-primary {
  background: linear-gradient(90deg, #2ea043, #238636);
  color: #fff;
  box-shadow: 0 8px 22px rgba(35, 134, 54, 0.18);
}
.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.preview-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.image-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.img-col {
  width: 48%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.img-title {
  align-self: flex-start;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.9rem;
}
canvas {
  width: 100%;
  max-height: 260px;
  border-radius: 10px;
  background: #0b1220;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
}

.img-meta {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}
.stats-row {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 6px;
}
.stat {
  color: #dbeafe;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

.empty-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 22px;
  text-align: center;
}

.tips {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.75);
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.01),
    rgba(255, 255, 255, 0.006)
  );
  border: 1px solid rgba(255, 255, 255, 0.02);
}

footer {
  margin-top: 28px;
  padding: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}
footer .heart {
  color: #ff7a8a;
}

@media (max-width: 920px) {
  .upload-card {
    grid-template-columns: 1fr;
  }
  .img-col {
    width: 100%;
  }
}

@media (max-width: 600px) {
  @media (max-width: 600px) {
    body {
      background: linear-gradient(180deg, #0b1220 0%, #071024 100%);
    }

    .color-blob.b1 {
      width: 320px;
      height: 320px;
      left: -100px;
      top: -60px;
      background: radial-gradient(circle at 30% 30%, #ff7a8a99, #ffb86b88);
    }
    .color-blob.b2 {
      width: 400px;
      height: 400px;
      right: -120px;
      top: 20px;
      background: radial-gradient(circle at 60% 40%, #6ad7ff99, #6a8bff88);
    }
    .color-blob.b3 {
      width: 280px;
      height: 280px;
      left: 15%;
      bottom: -100px;
      background: radial-gradient(circle at 50% 50%, #9effc699, #5ef1b688);
    }

    .site-header h1 {
      font-size: 1.5rem;
    }
    .tagline {
      font-size: 0.85rem;
    }
    .drop-text {
      font-size: 0.95rem;
    }
    .formats,
    .auto-hint,
    .progress-text,
    .img-meta,
    .stat,
    .empty-preview {
      font-size: 0.8rem;
    }
  }
}
