/* Scoped CSS for AI-Generated Face Generator */
.afg-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  line-height: 1.5;
}

.afg-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.afg-hero-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6366f1;
  background-color: #e0e7ff;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.afg-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem;
  letter-spacing: -0.025em;
}

.afg-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  max-width: 650px;
  margin: 0 auto;
}

/* Tabs */
.afg-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.75rem;
  overflow-x: auto;
}

.afg-tab {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.afg-tab:hover {
  color: #0f172a;
}

.afg-tab-active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* Views */
.afg-view {
  display: none;
}

.afg-view-active {
  display: block;
}

/* Workspace Grid */
.afg-workspace {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .afg-workspace {
    grid-template-columns: 1fr;
  }
}

/* Card styles */
.afg-card, .afg-canvas-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.afg-canvas-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.afg-canvas-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 1.25rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  background-color: #f1f5f9;
}

.afg-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.afg-flash {
  position: absolute;
  inset: 0;
  background-color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.afg-flash-active {
  opacity: 0.7;
}

/* Persona metadata */
.afg-persona-box {
  margin-bottom: 1.25rem;
  width: 100%;
}

.afg-persona-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
}

.afg-persona-meta {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 0.5rem;
}

.afg-persona-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4338ca;
  background-color: #e0e7ff;
  border-radius: 0.375rem;
}

/* Action buttons */
.afg-action-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.afg-export-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.afg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #4f46e5;
  border: 1px solid #4f46e5;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.afg-btn:hover {
  background-color: #4338ca;
}

.afg-btn-primary {
  background-color: #4f46e5;
}

.afg-btn-secondary {
  background-color: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}

.afg-btn-secondary:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.afg-btn-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

.afg-btn-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

.afg-btn-icon {
  margin-right: 0.5rem;
}

/* Controls panel */
.afg-section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.afg-control-group {
  margin-bottom: 1.25rem;
}

.afg-control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.afg-control-item {
  display: flex;
  flex-direction: column;
}

.afg-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.375rem;
}

.afg-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  background-color: #ffffff;
  color: #0f172a;
}

.afg-select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.afg-palette {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.afg-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.afg-color-swatch:hover {
  transform: scale(1.1);
}

.afg-color-swatch-active {
  box-shadow: 0 0 0 3px #4f46e5;
  transform: scale(1.08);
}

/* Ad slots */
.afg-ad-slot {
  min-height: 280px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Inspector section */
.afg-section-desc {
  font-size: 0.9375rem;
  color: #64748b;
  margin: 0 0 1.5rem;
}

.afg-inspector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.afg-artifact-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.afg-artifact-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.afg-artifact-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.afg-artifact-desc {
  font-size: 0.875rem;
  color: #475569;
  margin: 0;
  line-height: 1.4;
}

.afg-preview-panel {
  display: flex;
  flex-direction: column;
}

.afg-controls-panel {
  display: flex;
  flex-direction: column;
}

.afg-mt-4 { margin-top: 1.5rem; }
