/* ==========================================================================
   Masora Interactive - Modern CSS Styles
   Wizard-style workflow with smooth animations
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
  /* Colors - Dark Theme (Default) */
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1319;
  --bg-card: #151a23;
  --bg-elevated: #1a202c;
  --bg-input: #1e2533;

  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);

  --success: #10b981;
  --success-hover: #34d399;
  --warning: #f59e0b;
  --error: #ef4444;

  --border: #2d3748;
  --border-focus: #6366f1;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* Light Theme */
html[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* ---------- Base Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), #818cf8);
  box-shadow: var(--shadow-glow);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-elevated);
  transform: scale(1.05);
}

/* ---------- Main Content ---------- */
.app-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ---------- Step Sections ---------- */
.step-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.step-section.active {
  display: block;
}

.step-section.hidden {
  display: none;
}

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

/* ---------- Step Header ---------- */
.step-header {
  text-align: center;
  margin-bottom: 32px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: var(--transition-normal);
}

.step-num.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: var(--shadow-glow);
}

.step-num.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  transition: var(--transition-normal);
}

.step-line.done {
  background: var(--success);
}

.step-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.step-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.config-card {
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* TTS Availability Info */
.tts-availability-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: -12px;
  margin-bottom: 16px;
}

.tts-availability-info .form-hint {
  font-size: 0.75rem;
  transition: color var(--transition-fast);
}

/* Disabled select options */
.form-select option:disabled {
  color: var(--text-muted);
  background: var(--bg-secondary);
}

/* ---------- Radio Cards ---------- */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.radio-group.horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-card {
  display: block;
  cursor: pointer;
}

.radio-card input {
  display: none;
}

.radio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: var(--transition-normal);
}

.radio-card input:checked + .radio-content {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.radio-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.radio-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.radio-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Radio Pills */
.radio-pill {
  display: block;
  cursor: pointer;
}

.radio-pill input {
  display: none;
}

.radio-pill span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.radio-pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-input);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-icon {
  font-size: 1.1em;
}

.form-actions {
  margin-top: 32px;
  text-align: center;
}

/* ---------- Options Panel ---------- */
.options-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  animation: slideDown 0.3s ease;
}

.options-panel.hidden {
  display: none;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Items Review (Step 2) ---------- */
.items-container {
  max-width: 800px;
  margin: 0 auto;
}

.items-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-card);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-bar.large {
  height: 12px;
}

/* Item Review Card */
.item-review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.item-number {
  position: absolute;
  top: -16px;
  left: 32px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 50%;
  box-shadow: var(--shadow-glow);
}

.item-content {
  margin-bottom: 24px;
}

.item-field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.item-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.item-input.primary-text {
  font-weight: 600;
  font-size: 1.25rem;
}

.item-input.secondary-text {
  font-style: italic;
  color: var(--text-secondary);
}

.hashtag-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hashtag-prefix {
  padding: 14px;
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
}

.hashtag-input {
  border: none !important;
  border-radius: 0 !important;
}

.item-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Items Thumbnails */
.items-thumbnails {
  margin-bottom: 24px;
}

.thumbs-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thumb-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.thumb-item:hover {
  border-color: var(--accent);
}

.thumb-item.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.thumb-item.approved {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* ---------- Image Picker (Step 3) ---------- */
.images-container {
  max-width: 900px;
  margin: 0 auto;
}

.current-item-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.item-badge {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-weight: 700;
  border-radius: 50%;
}

.preview-primary {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.preview-secondary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Image Grid */
.image-picker {
  margin-bottom: 24px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .image-grid {
    grid-template-columns: 1fr;
  }
}

.image-option {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition-fast);
}

.image-option:hover {
  transform: scale(1.02);
  border-color: var(--accent);
}

.image-option.selected {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

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

.image-option .provider-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.image-option .select-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.image-option.selected .select-check {
  display: flex;
}

/* Image dimension badge - bottom right corner */
.image-option .dimension-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #10b981;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.image-loading {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  gap: 12px;
}

.image-actions {
  text-align: center;
}

/* Selected Preview */
.selected-preview {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
}

.selected-preview.hidden {
  display: none;
}

.selected-preview img {
  width: 120px;
  height: 75px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.selected-badge {
  color: var(--success);
  font-weight: 600;
}

/* ---------- Generate (Step 4) ---------- */
.generate-container {
  max-width: 800px;
  margin: 0 auto;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.summary-card h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-item {
  text-align: center;
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

/* Final Preview */
.final-preview {
  margin-bottom: 32px;
}

.final-preview h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.final-items-list {
  display: grid;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.final-item {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  align-items: center;
}

.final-item-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 50%;
  flex-shrink: 0;
}

.final-item-img {
  width: 60px;
  height: 38px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.final-item-text {
  flex: 1;
  min-width: 0;
}

.final-item-primary {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.final-item-secondary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generate-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Generate Progress */
.generate-progress {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.generate-progress.hidden {
  display: none;
}

.progress-content {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.progress-content h3 {
  margin: 24px 0 16px;
  color: var(--text-primary);
}

.progress-log {
  margin-top: 24px;
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Generate Result */
.generate-result {
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.generate-result.hidden {
  display: none;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.result-files {
  margin: 24px 0;
}

.result-files a {
  display: inline-block;
  padding: 12px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--accent);
  text-decoration: none;
  margin: 4px;
  transition: var(--transition-fast);
}

.result-files a:hover {
  background: var(--accent);
  color: white;
}

/* ---------- Step Navigation ---------- */
.step-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ---------- Spinner ---------- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  transition: opacity 0.2s ease;
}

.toast.ok {
  border-left: 4px solid var(--success);
}

.toast.warn {
  border-left: 4px solid var(--warning);
}

.toast.err {
  border-left: 4px solid var(--error);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Quick Actions Bar - Approve All & Auto-Select
   ========================================================================== */
.quick-actions-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.quick-action-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn-accent {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-accent:hover::before {
  left: 100%;
}

.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 600;
}

.btn-with-icon .btn-icon {
  font-size: 1.2em;
}

/* ==========================================================================
   Selected Images Gallery
   ========================================================================== */
.selected-gallery {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.gallery-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.gallery-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: normal;
}

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

.gallery-item {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.gallery-item:hover {
  border-color: var(--accent);
  transform: scale(1.03);
}

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

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-item-num {
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.gallery-item-change {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-item-change {
  opacity: 1;
}

.gallery-item-change:hover {
  background: var(--accent);
}

/* Gallery item without image */
.gallery-item.no-image {
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   Approved Items Summary (for step-items)
   ========================================================================== */
.approved-summary {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--success);
}

.approved-summary-icon {
  font-size: 1.5rem;
}

.approved-summary-text {
  font-weight: 500;
}

/* Loading state for buttons */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .quick-actions-bar {
    flex-direction: column;
    text-align: center;
  }
  
  .quick-action-hint {
    order: 2;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
