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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #888;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

#upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

#drop-zone {
  border: 2px dashed #333;
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

#drop-zone:hover,
#drop-zone.dragover {
  border-color: #666;
}

.drop-text {
  color: #666;
  font-size: 1.1rem;
}

#preview {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
}

#preview:not([hidden]) + .drop-text,
#preview:not([hidden]) ~ .drop-text {
  display: none;
}

#analyze-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #5a3ec8;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
  align-self: flex-start;
}

#analyze-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#analyze-btn:not(:disabled):hover {
  opacity: 0.85;
}

#loading {
  text-align: center;
  padding: 3rem 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #5a3ec8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

#error-msg {
  background: #2a1010;
  border: 1px solid #5a2020;
  color: #f08080;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

#analysis-text {
  background: #151515;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

#results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #151515;
  border-radius: 12px;
  overflow: hidden;
}

.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.card-body {
  padding: 1rem;
}

.card-body h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.card-body p {
  font-size: 0.875rem;
  color: #999;
  line-height: 1.5;
}

.card-error {
  padding: 2rem 1rem;
  text-align: center;
  color: #f08080;
}
