* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fafafa;
  color: #111;
}

.gen-header {
  padding: 32px 24px 16px;
  max-width: 780px;
  margin: 0 auto;
}

.gen-header h1 { margin: 0 0 8px; font-size: 24px; }
.gen-subtitle { color: #666; font-size: 14px; margin: 0; }

.gen-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.gen-step[hidden] { display: none; }
.gen-step { margin-top: 24px; }

.gen-button-primary {
  padding: 12px 20px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  background: #111;
  color: #fff;
  cursor: pointer;
}
.gen-button-primary:hover { background: #333; }
.gen-button-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.gen-button-secondary {
  padding: 10px 18px;
  font-size: 14px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #fff;
  color: #111;
  cursor: pointer;
}
.gen-button-secondary:hover { background: #f0f0f0; }

.gen-hint { color: #777; font-size: 13px; margin-top: 10px; }
.gen-hint code { background: #eee; padding: 1px 5px; border-radius: 4px; }

.gen-warning {
  color: #a33;
  font-size: 13px;
  margin-top: 10px;
}

.gen-warning-box {
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid #e8d7a3;
  background: #fdf8ea;
  border-radius: 8px;
}
.gen-warning-box strong { font-size: 14px; }
.gen-warning-box .gen-hint { margin-top: 8px; }
.gen-warning-box ol { margin: 8px 0; padding-left: 20px; }
.gen-warning-box li { margin-bottom: 4px; }

.gen-header a { color: #111; }
.gen-header a:hover { color: #555; }

/* --- Liste des galeries a configurer --- */

.gallery-config-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.gallery-config-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gallery-config-header h3 { margin: 0; font-size: 16px; }
.gallery-config-meta { font-size: 13px; color: #888; }

.gallery-config-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-config-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #444;
}

.gallery-config-form input,
.gallery-config-form select {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
}

.gallery-config-form input[type="color"] { padding: 2px; height: 36px; }

.gallery-config-form textarea {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
}

.hover-effects-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  background: #fafafa;
}

.hover-effects-title { margin: 0 0 2px; font-size: 13px; color: #444; }

.hover-effect-row {
  display: grid;
  grid-template-columns: 18px 1fr 100px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #333;
}

.hover-effect-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.hover-effect-row input[type="range"] { width: 100px; }
.hover-effect-row input[type="range"]:disabled { opacity: 0.35; }

.gallery-config-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .gallery-config-row { grid-template-columns: 1fr 1fr; }
}

.gen-generate-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.gen-status { font-size: 13px; color: #666; }

.gen-progress-bar {
  width: 100%;
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

.gen-progress-fill {
  height: 100%;
  width: 0%;
  background: #111;
  transition: width 0.15s ease;
}

/* --- Gestion de l'ordre des photos --- */
.photo-order-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 4px;
  background: #f9f9f9;
}

.photo-order-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: grab;
  font-size: 13px;
  transition: background 0.15s ease;
}
.photo-order-item:hover { background: #f0f0f0; }
.photo-order-item:active { cursor: grabbing; }
.photo-order-item .drag-handle {
  color: #aaa;
  font-size: 16px;
  cursor: grab;
}
.photo-order-item .photo-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-order-item .photo-index {
  color: #999;
  font-size: 11px;
  min-width: 24px;
  text-align: right;
}
.photo-order-thumb {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  background: #ddd;
  flex-shrink: 0;
}
.photo-order-arrows {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.photo-order-arrow {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  color: #444;
}
.photo-order-arrow:hover:not(:disabled) { background: #eee; }
.photo-order-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.photo-order-item.dragging {
  opacity: 0.5;
  background: #e8e8e8;
}
.photo-order-item.drag-over {
  border-color: #111;
  border-style: dashed;
}

.photo-order-toggle {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
}
.photo-order-toggle:hover {
  background: #eee;
  color: #111;
}

.photo-order-container {
  margin-top: 8px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}