:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.16);
  --text: #e8ecf3;
  --muted: #9aa4b2;
  --accent: linear-gradient(135deg, #7c3aed, #06b6d4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.25), transparent 35%),
    radial-gradient(circle at right, rgba(6, 182, 212, 0.18), transparent 30%),
    var(--bg);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.hero h1 {
  margin-top: 0;
  font-size: 42px;
}

.hero p {
  color: var(--muted);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1.5px dashed rgba(255,255,255,0.28);
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  margin: 20px 0;
}

.dropzone.is-dragover {
  border-color: #67e8f9;
  background: rgba(103, 232, 249, 0.08);
}

textarea,
pre {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(10, 14, 28, 0.7);
  color: var(--text);
  padding: 16px;
  font: inherit;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.action-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.format-toggle {
  display: inline-flex;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  gap: 6px;
}

.toggle-option,
.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}

.toggle-option {
  position: relative;
}

.toggle-option input,
.checkbox-option input {
  margin: 0;
}

.toggle-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.toggle-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-option input:checked + span {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.checkbox-option {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.checkbox-option input {
  accent-color: #67e8f9;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-weight: 600;
  transition:
    transform 140ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.2);
}

button:hover {
  filter: brightness(1.06);
  box-shadow: 0 16px 36px rgba(124, 58, 237, 0.28);
}

button:active {
  transform: translateY(1px) scale(0.985);
}

button.is-working,
button.is-success,
button.is-error {
  animation: buttonPulse 320ms ease;
}

button.is-working {
  opacity: 0.92;
  box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.18);
}

button.is-success {
  background: linear-gradient(135deg, #059669, #34d399);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

button.is-error {
  background: linear-gradient(135deg, #dc2626, #fb7185);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.18);
}

@keyframes buttonPulse {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(0.97);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .actions,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .action-controls {
    width: 100%;
  }

  .format-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .toggle-option {
    flex: 1 1 0;
  }

  .toggle-option span,
  button {
    width: 100%;
  }

  .checkbox-option {
    justify-content: center;
    width: 100%;
  }
}
