*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Header */
.header {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
  color: #fff;
  padding: 1.5rem 1rem;
  text-align: center;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo span {
  font-weight: 400;
  opacity: 0.85;
}

.tagline {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-top: 0.25rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Main */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* Sections */
.section {
  display: none;
}

.section.active {
  display: block;
}

#section-results.active {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* Results layout */
.result-columns {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 1rem;
  align-items: start;
}

.result-col-left,
.result-col-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cta-banner {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  text-align: center;
}

.cta-text {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.btn-cta {
  background: #fff;
  color: #1a56db;
  white-space: nowrap;
  text-decoration: none;
}

.btn-cta:hover {
  background: #e0e7ff;
}

.result-btn-another {
  grid-column: 1 / -1;
  max-width: 300px;
  justify-self: center;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .result-columns {
    grid-template-columns: 1fr;
  }

  .result-btn-another {
    grid-column: auto;
  }
}

/* Cards */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone:hover {
  border-color: #1a56db;
  background: #f0f5ff;
}

.drop-zone.drag-over {
  border-color: #1a56db;
  background: #e8effd;
}

.drop-icon {
  width: 48px;
  height: 48px;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.drop-zone:hover .drop-icon {
  color: #1a56db;
}

.drop-text {
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.25rem;
}

.drop-hint {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* File Info */
.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f0f5ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-top: 1rem;
}

.file-info.hidden {
  display: none;
}

.file-icon {
  width: 24px;
  height: 24px;
  color: #1a56db;
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.75rem;
  color: #64748b;
}

.file-remove {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.file-remove:hover {
  color: #ef4444;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: #1a56db;
  color: #fff;
  width: 100%;
  margin-top: 1rem;
}

.btn-primary:hover:not(:disabled) {
  background: #1e40af;
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
  width: 100%;
  margin-top: 1.5rem;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-small {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  font-weight: 500;
}

.btn-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #334155;
  color: #e2e8f0;
  border-radius: 6px;
  z-index: 1;
}

.btn-copy:hover {
  background: #475569;
}

.btn-copy.copied {
  background: #16a34a;
  color: #fff;
}

/* Loading */
.loading-card {
  text-align: center;
  padding: 3rem 2rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #1a56db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-weight: 500;
  color: #334155;
  transition: opacity 0.3s;
}

.loading-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Results */
.result-header {
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, #1e3a5f, #1a56db);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.result-description {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.7;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1e293b;
}

/* JSON Viewer */
.json-viewer-wrapper {
  position: relative;
  margin-bottom: 1.75rem;
}

.json-viewer {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.65;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
}

.json-viewer code {
  font-family: inherit;
}

.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fbbf24; }
.json-boolean { color: #c084fc; }
.json-null { color: #94a3b8; }
.json-punctuation { color: #64748b; }

/* Usage Examples */
.usage-examples {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.usage-card {
  border-left: 3px solid #1a56db;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}

.usage-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
  color: #1e293b;
}

.usage-card-desc {
  font-size: 0.825rem;
  color: #64748b;
  line-height: 1.55;
}

/* Error */
.error-card {
  text-align: center;
  padding: 2.5rem 2rem;
}

.error-icon {
  width: 48px;
  height: 48px;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-message {
  color: #dc2626;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.footer-tagline {
  margin-bottom: 0.35rem;
  font-style: italic;
}

.footer a {
  color: #64748b;
  text-decoration: none;
}

.footer a:hover {
  color: #1a56db;
}

.footer strong {
  font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
  .header {
    padding: 1.25rem 1rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .card {
    padding: 1.25rem;
  }

  .drop-zone {
    padding: 2rem 1rem;
  }

  .json-viewer {
    font-size: 0.7rem;
    padding: 1rem;
  }
}
