@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #0b0f14;
  --panel: #121822;
  --panel-2: #0f141d;
  --text: #e8eef6;
  --muted: #9aa7b7;
  --accent: #4fd1c5;
  --accent-2: #38a3c4;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #111827 0%, #0b0f14 55%, #0a0c11 100%);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

h1 {
  font-size: 48px;
  margin: 0 0 12px;
}

.subhead {
  color: var(--muted);
  max-width: 480px;
}

.badge {
  background: linear-gradient(120deg, rgba(79, 209, 197, 0.2), rgba(56, 163, 196, 0.2));
  border: 1px solid rgba(79, 209, 197, 0.4);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dropzone {
  border: 2px dashed rgba(79, 209, 197, 0.35);
  border-radius: 18px;
  background: var(--panel-2);
  min-height: 260px;
  position: relative;
  transition: border 0.2s ease, transform 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: left;
}

.drop-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(79, 209, 197, 0.2);
  color: var(--accent);
  font-size: 24px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toggle {
  display: flex;
  background: var(--panel-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.toggle.multi {
  flex-wrap: wrap;
  border-radius: 16px;
  gap: 8px;
  padding: 6px;
}

.toggle button {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.toggle button.active {
  background: linear-gradient(120deg, rgba(79, 209, 197, 0.35), rgba(56, 163, 196, 0.35));
  color: var(--text);
}

.toggle.multi button {
  flex: 1 1 120px;
}

select,
input[type="number"],
input[type="range"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
}

input[type="range"] {
  padding: 0;
}

.resize-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary,
.ghost {
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #041017;
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.results {
  margin-top: 28px;
  display: none;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.results.active {
  display: grid;
}

.comparison {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
}

.compare-images {
  position: relative;
  height: 360px;
  overflow: hidden;
  border-radius: 16px;
  background: #0a0f15;
}

.compare-images img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.after {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
}

#compareSlider {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
}

.stats {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  display: grid;
  gap: 16px;
}

.stats h3 {
  margin: 6px 0 0;
  font-size: 22px;
}

.actions {
  display: grid;
  gap: 12px;
}

.formats {
  display: grid;
  gap: 10px;
}

.format-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.format-item span {
  color: var(--muted);
  font-size: 13px;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.lightbox.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.8);
  backdrop-filter: blur(6px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  z-index: 1;
}

.lightbox-content img {
  max-width: 85vw;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .panel,
  .results {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: 36px;
  }
}

@media (max-width: 640px) {
  .toggle.multi {
    padding: 8px;
  }

  .toggle.multi button {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
}
