/* Reset et base */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary-color: #7C3AED;
  --primary-dark: #5B21B6;
  --primary-light: #EDE9FE;
  --secondary-color: #6B7280;
  --success-color: #10B981;
  --success-dark: #059669;
  --danger-color: #EF4444;
  --warning-color: #F59E0B;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --border-color: #E5E7EB;
  --border-radius: 12px;
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

.container {
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--surface);
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color);
  cursor: pointer;
}

.beta-badge {
  background: var(--warning-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Progress Bar */
.progress-container {
  background: var(--surface);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #EC4899);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Main Content */
.main-content { flex: 1; padding: 2rem; }

/* Animation */
.animate-in {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Welcome */
.welcome-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.welcome-content h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.subtitle { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 2rem; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.example-preview {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.example-preview h3 { margin-bottom: 1rem; }

.example-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.example-item {
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.example-item:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Step Content */
.step-content { max-width: 600px; margin: 0 auto; }
.step-content h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.step-description { color: var(--text-secondary); margin-bottom: 2rem; font-size: 1.125rem; }

/* Form Elements */
.form-group { margin-bottom: 2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; }

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

textarea { resize: vertical; min-height: 100px; }
small { display: block; color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.25rem; }

/* Radio Cards */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.radio-card { cursor: pointer; }
.radio-card input { display: none; }

.radio-emoji { font-size: 2rem; display: block; margin-bottom: 0.4rem; }

.radio-content {
  padding: 1.25rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
}

.radio-card input:checked + .radio-content {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Model select - wider cards */
.model-select { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.model-select .radio-content { padding: 1rem; text-align: left; }

/* Range Slider */
input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-color);
  outline: none;
  margin: 1rem 0 0.5rem;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 2px solid transparent;
  font-family: inherit;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.btn-secondary { background: transparent; color: var(--text-secondary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--surface); border-color: var(--text-secondary); }

.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: var(--success-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.btn-large { padding: 1rem 2rem; font-size: 1.125rem; }

/* Navigation */
.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* Results */
.result-summary {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
  text-align: left;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.result-item:last-child { border-bottom: none; }

.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.result-display { margin: 2rem 0; }

.result-media {
  max-width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.2s;
}

.result-media:hover { transform: scale(1.01); }

.prompt-details {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  text-align: left;
  box-shadow: var(--shadow);
}

.prompt-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
}

.prompt-details pre {
  margin-top: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Suggestion chips */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text-primary);
}

.chip:hover, .chip.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.chip-danger { color: var(--danger-color); border-color: var(--danger-color); }
.chip-danger:hover { background: var(--danger-color); color: white; border-color: var(--danger-color); }

/* Info box */
.info-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
  color: var(--primary-dark);
}

/* Upload zone */
.upload-section { margin-top: 1.5rem; }

.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.upload-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: contain;
}

.upload-placeholder { color: var(--text-secondary); }
.upload-placeholder p { margin-top: 0.5rem; font-size: 0.9rem; }

/* Loader */
.loader {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

/* Gallery */
.gallery-page { max-width: 100%; }

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

.gallery-header h2 { font-size: 1.5rem; }

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--surface);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.gallery-item.broken img { display: none; }
.gallery-item.broken::before {
  content: '🖼️ Image indisponible';
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.gallery-item-overlay {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.gallery-item-type {
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
}

.gallery-item-style {
  background: var(--primary-color);
  color: white;
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
}

.gallery-item-info {
  padding: 0.75rem;
}

.gallery-item-info p {
  font-size: 0.85rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.gallery-item-info small {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.empty-gallery {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-gallery p {
  margin: 1rem 0;
  color: var(--text-secondary);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 1000;
  padding: 2rem;
  cursor: pointer;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--border-radius);
  object-fit: contain;
  cursor: default;
}

.lightbox-dl { cursor: pointer; }

/* Footer */
.footer {
  background: var(--surface);
  padding: 1rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header { padding: 1rem; }
  .main-content { padding: 1rem; }
  .progress-container { padding: 1rem; }
  .welcome-content h1 { font-size: 2rem; }
  .step-content h2 { font-size: 1.5rem; }
  .radio-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .features { grid-template-columns: 1fr 1fr; }
  .navigation { flex-direction: column; gap: 1rem; }
  .navigation .btn { width: 100%; justify-content: center; }
  .result-actions { flex-direction: column; align-items: center; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
}

@media (max-width: 480px) {
  .example-items { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
