:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1f1f1f;
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --border: #2a2a2a;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.dropzone {
  width: 100%;
  max-width: 600px;
  height: 300px;
  border: 2px dashed var(--border);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.dropzone-content {
  text-align: center;
  color: var(--text-secondary);
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.preview-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.75rem;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.btn-small {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary.active {
  background: var(--accent);
  border-color: var(--accent);
}

.results-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-header h2 {
  margin: 0;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

#resultCounter {
  color: var(--text-secondary);
  font-size: 0.875rem;
  min-width: 60px;
  text-align: center;
}

.thumbnails-container {
  width: 100%;
  max-width: 600px;
  margin-top: 1rem;
}

.thumbnails-container h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.thumbnail {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail .remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moodboard-display h2 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.moodboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.moodboard-image {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  overflow: hidden;
}

.moodboard-image img {
  width: 100%;
  display: block;
}

#landmarksCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.moodboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.moodboard-header h2 {
  margin-bottom: 0;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.moodboard-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.score-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
}

.score-card h3 {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.score-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
}

.score-category {
  font-size: 1rem;
  color: var(--success);
  font-weight: 600;
}

.color-palette h3, .keywords h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.colors {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  border: 2px solid var(--border);
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.keyword {
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.json-display {
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  overflow: hidden;
}

.json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.json-header h3 {
  font-size: 1rem;
}

#jsonOutput {
  padding: 1rem;
  max-height: 400px;
  overflow: auto;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: none;
}

#jsonOutput.visible {
  display: block;
}

.loading {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 100;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
  .moodboard-grid {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 1.75rem;
  }
}

.info-card {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.75rem;
}

.info-card h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.color-swatch {
  width: 60px;
  height: 60px;
  border-radius: 0.5rem;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch::after {
  content: attr(data-color);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.color-swatch:hover::after {
  opacity: 1;
}

.lighting-section h3,
.composition-section h3,
.insights-section h3,
.audience-section h3,
.recommendations-section h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  margin-top: 1rem;
}

.lighting-grid,
.composition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.lighting-item,
.composition-item {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.lighting-label,
.composition-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.25rem;
}

.lighting-value,
.composition-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  text-transform: capitalize;
}

.insights-section p,
.audience-section p {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.recommendations-section ul {
  list-style: none;
}

.recommendations-section li {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-left: 3px solid var(--warning);
}

.lighting-section,
.composition-section,
.insights-section,
.recommendations-section {
  margin-top: 0.5rem;
}

.score-breakdown {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.75rem;
}

.score-breakdown h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.breakdown-item {
  background: var(--bg-tertiary);
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
}

.breakdown-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
}

.breakdown-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

