@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&display=swap');

:root {
  --bg: #0a0a0b;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --text: #fafafa;
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #c8ff00;
  --accent-glow: rgba(200, 255, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Syne', sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

/* Animated gradient orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -200px;
  left: -100px;
  animation: float1 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  bottom: -150px;
  right: -100px;
  animation: float2 25s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(80px, 60px) scale(1.1);
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-60px, -40px) scale(1.15);
  }
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card */
.card {
  width: 100%;
  padding: 2.5rem 2.5rem 2rem;
  background: var(--surface);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: 24px;
  animation: fadeUp 0.6s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
.app-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 2rem 0;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: left;
  width: 100%;
  display: block;
}

/* Upload zone */
.upload-zone {
  margin-top: 1rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.btn-upload,
.btn-process {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 1rem 2.5rem;
  font-weight: 700;
  font-size: 1rem;
  min-width: 240px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-upload:hover,
.btn-process:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-upload:active,
.btn-process:active {
  transform: translateY(0);
}

/* Preview area */
.preview-area {
  width: 100%;
  margin-top: 2rem;
}

.single-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.preview-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preview-wrapper img {
  border-radius: 12px;
  max-height: 300px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Results grid */
.results-preview {
  width: 100%;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-grid .preview-wrapper img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

.success-message {
  text-align: center;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 1.2rem;
}

/* Loading spinner */
.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.spinner-circle {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Error message */
.error-message {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: #fca5a5;
  text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
  .card {
    padding: 1.5rem 1.25rem;
    border-radius: 20px;
  }
  
  .app-title {
    font-size: 2rem;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .btn-upload,
  .btn-process {
    min-width: 200px;
    padding: 0.875rem 2rem;
  }
}
