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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
}

.container {
  width: 400px;
  padding: 16px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a73e8;
}

h2 {
  font-size: 14px;
  font-weight: 600;
  color: #555;
}

/* Preview Section */
.preview-section {
  margin-bottom: 16px;
}

#preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

#preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

.silhouette {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  margin-bottom: 8px;
  position: relative;
}

.silhouette::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50px 50px 0 0;
}

.hint {
  font-size: 12px;
  color: #888;
  text-align: center;
}

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

#overlay-container .overlay-preview {
  position: absolute;
  pointer-events: auto;
  cursor: move;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  background: rgba(0,0,0,0.3);
}

#overlay-container .overlay-preview:hover,
#overlay-container .overlay-preview.dragging {
  border-color: #1a73e8;
}

#overlay-container .overlay-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

#overlay-container .resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #1a73e8;
  border: 2px solid #fff;
  border-radius: 2px;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.15s;
}

#overlay-container .overlay-preview:hover .resize-handle,
#overlay-container .overlay-preview.dragging .resize-handle {
  opacity: 1;
}

#overlay-container .resize-handle.se {
  bottom: -7px;
  right: -7px;
  cursor: se-resize;
}

#overlay-container .delete-handle {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: #d93025;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: auto;
}

#overlay-container .overlay-preview:hover .delete-handle {
  opacity: 1;
}

/* Overlay Section */
.overlay-section {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#overlay-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.overlay-item .thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: #eee;
}

.overlay-item .info {
  flex: 1;
  min-width: 0;
}

.overlay-item .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-item .position {
  font-size: 12px;
  color: #888;
}

.overlay-item .opacity-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.overlay-item .opacity-control label {
  font-size: 11px;
  color: #888;
}

.overlay-item .opacity-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  border-radius: 2px;
  outline: none;
}

.overlay-item .opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #1a73e8;
  border-radius: 50%;
  cursor: pointer;
}

.overlay-item .opacity-value {
  font-size: 11px;
  color: #888;
  width: 32px;
}

.overlay-item .duplicate-btn,
.overlay-item .delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
}

.overlay-item .duplicate-btn {
  color: #1a73e8;
}

.overlay-item .duplicate-btn:hover {
  background: #e8f0fe;
}

.overlay-item .delete-btn {
  color: #d93025;
}

.overlay-item .delete-btn:hover {
  background: #fce8e6;
}

.empty-state {
  color: #888;
  text-align: center;
  padding: 20px;
  font-size: 13px;
}

.empty-state.hidden {
  display: none;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
}

.btn-primary:hover {
  background: #1557b0;
}

.btn-secondary {
  background: #e8eaed;
  color: #333;
}

.btn-secondary:hover {
  background: #dadce0;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 350px;
}

.modal-content h3 {
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #555;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #1a73e8;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Status */
.status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

.status.success {
  background: #e6f4ea;
  color: #137333;
}

.status.error {
  background: #fce8e6;
  color: #d93025;
}

.status:empty {
  display: none;
}

.hidden {
  display: none !important;
}

/* Add buttons container */
.add-buttons {
  display: flex;
  gap: 8px;
}

/* Effect button */
.btn-effect {
  background: linear-gradient(135deg, #ff6b35 0%, #f7c531 100%);
  color: #fff;
}

.btn-effect:hover {
  background: linear-gradient(135deg, #e55a25 0%, #e5b320 100%);
}

/* Effect item styles */
.overlay-item.effect-item {
  border-color: #ff6b35;
  background: linear-gradient(135deg, #fff5f0 0%, #fffbf0 100%);
}

.overlay-item.effect-item.active {
  border-color: #f7c531;
  background: linear-gradient(135deg, #fff8e6 0%, #fffbf0 100%);
  box-shadow: 0 0 8px rgba(247, 197, 49, 0.4);
}

/* Trigger button */
.trigger-btn {
  padding: 6px 12px;
  border-radius: 16px;
  border: 2px solid #ccc;
  background: #f5f5f5;
  color: #666;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.trigger-btn:hover {
  border-color: #ff6b35;
  background: #fff5f0;
  color: #ff6b35;
}

.trigger-btn.active {
  border-color: #f7c531;
  background: linear-gradient(135deg, #ff6b35 0%, #f7c531 100%);
  color: #fff;
  box-shadow: 0 0 8px rgba(247, 197, 49, 0.5);
}

/* Modal hint text */
.modal-hint {
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Drag handle for reordering */
.drag-handle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px;
  cursor: grab;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.drag-handle:hover {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #888;
  border-radius: 1px;
}

/* Dragging state for overlay items */
.overlay-item.dragging {
  opacity: 0.5;
  background: #e3f2fd;
  border-color: #1a73e8;
}

.overlay-item.drag-over {
  border-color: #1a73e8;
  border-style: dashed;
}

/* Layer indicator badge */
.layer-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
  margin-left: 4px;
}

.layer-badge.foreground {
  background: #e8f5e9;
  color: #2e7d32;
}

.layer-badge.background {
  background: #fff3e0;
  color: #ef6c00;
}

/* Order indicator */
.order-indicator {
  font-size: 11px;
  color: #888;
  margin-right: 4px;
}

/* Bundled section styling */
.bundled-section {
  margin-top: 12px;
  background: #f0f4f8;
}

.bundled-section h2 {
  color: #5f6368;
}

/* Overlay list container */
.overlay-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Controls row for opacity + layer toggle */
.controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* Layer toggle buttons */
.layer-toggle {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.layer-toggle .layer-btn {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  border: none;
  background: #f5f5f5;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}

.layer-toggle .layer-btn:first-child {
  border-right: 1px solid #ddd;
}

.layer-toggle .layer-btn:hover {
  background: #e8e8e8;
}

.layer-toggle .layer-btn.active {
  background: #1a73e8;
  color: #fff;
}

.layer-toggle .layer-btn.active[data-layer="background"] {
  background: #ef6c00;
}

.layer-toggle .layer-btn.active[data-layer="foreground"] {
  background: #2e7d32;
}

/* Danger button for confirmations */
.btn-danger {
  background: #d93025;
  color: #fff;
}

.btn-danger:hover {
  background: #b71c1c;
}

/* Confirmation dialog styling */
.confirm-dialog {
  max-width: 300px;
}

.confirm-dialog h3 {
  color: #d93025;
}

.confirm-dialog p {
  color: #555;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Selection state for overlay items */
.overlay-item.selected {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
  background: #e8f4fd;
}

/* Enhanced drag feedback */
.overlay-item.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  transition: transform 0.15s ease, opacity 0.15s ease;
  background: #e3f2fd;
  border-color: #1a73e8;
}

.overlay-item.drag-over {
  border: 2px dashed #1a73e8;
  background: #e8f4fd;
  position: relative;
}

.overlay-item.drag-over::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: #1a73e8;
  border-radius: 2px;
}

.overlay-list.dragging-active .overlay-item {
  transition: transform 0.15s ease;
}

.overlay-list.dragging-active .overlay-item:not(.dragging) {
  opacity: 0.8;
}

/* ==================== Effect Preview Hover ==================== */

.effect-preview {
  position: fixed;
  z-index: 200;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  padding: 8px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.effect-preview.visible {
  opacity: 1;
  transform: scale(1);
}

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

.effect-preview-img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.effect-preview-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.effect-preview-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7c531 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Thumbnail hover effect for effects */
.overlay-item.effect-item .thumb {
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.overlay-item.effect-item .thumb:hover {
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.5);
  transform: scale(1.05);
  cursor: zoom-in;
}

/* ==================== Text Banner & Timer Buttons ==================== */

.btn-text {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
}

.btn-text:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
}

.btn-timer {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
}

.btn-timer:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

/* Smaller add buttons to fit 4 */
.add-buttons .btn {
  padding: 6px 10px;
  font-size: 12px;
}

/* ==================== Text Banner Item Styles ==================== */

.overlay-item.text-banner-item {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%);
}

.overlay-item.text-banner-item.active {
  border-color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

/* Text banner icon */
.text-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
}

/* ==================== Timer Item Styles ==================== */

.overlay-item.timer-item {
  border-color: #059669;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.overlay-item.timer-item.active {
  border-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Timer icon */
.timer-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

/* Timer controls in list item */
.timer-controls {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.timer-controls .timer-ctrl-btn {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.timer-controls .timer-ctrl-btn:hover {
  background: #f0f0f0;
}

.timer-controls .timer-ctrl-btn.play {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

.timer-controls .timer-ctrl-btn.play:hover {
  background: #047857;
}

.timer-controls .timer-ctrl-btn.pause {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}

.timer-controls .timer-ctrl-btn.pause:hover {
  background: #d97706;
}

/* ==================== Modal Enhancements ==================== */

.modal-wide {
  max-width: 380px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group-half {
  flex: 1;
}

.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.form-group textarea:focus {
  outline: none;
  border-color: #1a73e8;
}

.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

.form-group select:focus {
  outline: none;
  border-color: #1a73e8;
}

.form-group input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: #1a73e8;
}

.form-group input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
}

.form-group input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
}

.form-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #1a73e8;
  border-radius: 50%;
  cursor: pointer;
}

/* Duration inputs for timer */
.duration-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.duration-inputs input {
  width: 70px;
  text-align: center;
}

.duration-inputs span {
  font-weight: bold;
  color: #666;
}

.duration-presets {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn-small {
  padding: 4px 8px;
  font-size: 11px;
  background: #e8eaed;
  color: #333;
}

.btn-small:hover {
  background: #dadce0;
}

/* Position grid for timer */
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 150px;
}

.position-btn {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.position-btn:hover {
  background: #e8e8e8;
  border-color: #1a73e8;
}

.position-btn.active {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

/* Text banner preview in list */
.text-preview {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Edit text button */
.edit-text-btn {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #7c3aed;
  background: #fff;
  color: #7c3aed;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.edit-text-btn:hover {
  background: #f5f3ff;
}

/* ==================== Wall Art Section ==================== */

.wall-art-section {
  margin-top: 12px;
}

.wall-art-buttons {
  display: flex;
  gap: 8px;
}

.btn-wall-art {
  background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
  color: #fff;
}

.btn-wall-art:hover {
  background: linear-gradient(135deg, #d13a52 0%, #e55a85 100%);
}

/* Wall Art Item Styles */
.overlay-item.wall-art-item {
  border-color: #e94560;
  background: linear-gradient(135deg, #fff5f7 0%, #fff0f5 100%);
}

.overlay-item.wall-art-item.active {
  border-color: #ff6b9d;
  box-shadow: 0 0 8px rgba(233, 69, 96, 0.4);
}

/* Wall Art icon */
.wall-art-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  position: relative;
}

/* Paint indicator */
.wall-art-icon .paint-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* Segmentation Panel */
.segmentation-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.segmentation-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-label {
  font-weight: 500;
  color: #333;
}

.toggle-hint {
  font-size: 11px;
  color: #888;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 22px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.segmentation-options {
  margin-top: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 6px;
}

/* ==================== Wall Art Modal ==================== */

.wall-art-modal {
  max-width: 400px;
}

.wall-art-region-editor {
  margin-bottom: 16px;
}

.wall-art-region-editor canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  cursor: crosshair;
}

.wall-art-region-editor .hint {
  margin-top: 6px;
}

/* Wall Art Tabs */
.wall-art-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.wall-art-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: #f5f5f5;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 6px 6px 0 0;
}

.wall-art-tab:hover {
  background: #e8e8e8;
}

.wall-art-tab.active {
  background: linear-gradient(135deg, #e94560 0%, #ff6b9d 100%);
  color: #fff;
}

.wall-art-tab-content {
  padding: 12px;
  background: #f9f9f9;
  border-radius: 0 0 6px 6px;
}

/* Toggle inline */
.toggle-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.toggle-inline span {
  font-weight: 500;
  color: #333;
}

/* ==================== Setup Wizard ==================== */

/* Wizard Trigger Section */
.wizard-trigger-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-top: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 8px;
  border: 1px solid #bae6fd;
}

.wizard-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-status-icon {
  font-size: 18px;
}

.wizard-status-text {
  font-size: 12px;
  color: #0369a1;
}

.wizard-status.complete .wizard-status-text {
  color: #059669;
}

.btn-wizard {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: #fff;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-wizard:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
}

/* Wizard Modal */
.modal-wizard {
  max-width: 420px;
  padding: 0;
  overflow: hidden;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: #fff;
}

.wizard-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.wizard-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
  line-height: 1;
}

.wizard-close-btn:hover {
  opacity: 1;
}

/* Progress Steps */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.wizard-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.wizard-step.active .wizard-step-circle {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: #fff;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

.wizard-step.completed .wizard-step-circle {
  background: #10b981;
  color: #fff;
}

.wizard-step.completed .wizard-step-circle::after {
  content: '✓';
}

.wizard-step-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-step.active .wizard-step-label {
  color: #0ea5e9;
}

.wizard-step.completed .wizard-step-label {
  color: #10b981;
}

.wizard-step-line {
  width: 30px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 8px;
  margin-bottom: 20px;
  transition: background 0.3s;
}

.wizard-step-line.completed {
  background: #10b981;
}

/* Wizard Content */
.wizard-content {
  padding: 24px;
  min-height: 200px;
}

.wizard-content.hidden {
  display: none;
}

/* Step 1: Countdown */
.wizard-countdown-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wizard-countdown-number {
  font-size: 72px;
  font-weight: 700;
  color: #0ea5e9;
  line-height: 1;
  animation: countdown-pulse 1s ease-in-out infinite;
}

@keyframes countdown-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.wizard-countdown-text {
  font-size: 18px;
  color: #334155;
  margin-top: 12px;
  font-weight: 500;
}

.wizard-hint {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* Step 2: Tasks */
.wizard-tasks {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

.wizard-task.active {
  background: #eff6ff;
  border-color: #60a5fa;
}

.wizard-task.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.wizard-task.error {
  background: #fef2f2;
  border-color: #fca5a5;
}

.wizard-task-icon {
  font-size: 20px;
}

.wizard-task.active .wizard-task-icon::after {
  content: '';
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

.wizard-task.completed .wizard-task-icon {
  color: #10b981;
}

.wizard-task.error .wizard-task-icon {
  color: #ef4444;
}

.wizard-task-text {
  font-size: 13px;
  color: #334155;
}

/* Step 3: Region Editor */
.wizard-region-editor {
  text-align: center;
}

.wizard-region-editor canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  cursor: crosshair;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Step 4: Summary */
.wizard-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
}

.wizard-summary-label {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.wizard-summary-value {
  font-size: 13px;
  color: #10b981;
  font-weight: 600;
}

.wizard-benchmark-results {
  padding: 16px;
  background: #f1f5f9;
  border-radius: 8px;
}

.wizard-benchmark-results .wizard-hint {
  margin: 0;
}

.wizard-benchmark-results p {
  font-size: 12px;
  color: #475569;
  margin: 4px 0;
}

.wizard-benchmark-results .benchmark-stat {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.wizard-benchmark-results .benchmark-stat span:first-child {
  color: #64748b;
}

.wizard-benchmark-results .benchmark-stat span:last-child {
  font-weight: 600;
  color: #0ea5e9;
}

/* Wizard Actions */
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.wizard-actions .btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

.wizard-actions .btn-primary:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
}

.wizard-actions .btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* Wizard preset select */
#wizard-preset-select {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

#wizard-preset-select:focus {
  outline: none;
  border-color: #0ea5e9;
}

/* ==================== Performance Warning Badges ==================== */

.warnings-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.warnings-container.hidden {
  display: none;
}

.warning-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 170, 0, 0.15);
  border: 1px solid rgba(255, 170, 0, 0.3);
  border-radius: 6px;
  font-size: 12px;
  color: #b87a00;
  transition: all 0.2s;
  cursor: default;
}

.warning-badge.hidden {
  display: none;
}

.warning-badge:hover {
  background: rgba(255, 170, 0, 0.25);
}

.warning-badge.critical {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.3);
  color: #c92a2a;
}

.warning-badge.critical:hover {
  background: rgba(220, 53, 69, 0.25);
}

.warning-icon {
  font-size: 14px;
}

.warning-text {
  font-weight: 500;
}

/* Warning badge pulse animation for critical warnings */
@keyframes warning-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.warning-badge.critical {
  animation: warning-pulse 2s ease-in-out infinite;
}

/* Region editor actions */
.region-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* ==================== Wall Region Picker ==================== */

.wall-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.wall-region-card {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.wall-region-card:hover {
  border-color: #e94560;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.2);
}

.wall-region-preview {
  width: 100%;
  height: 60px;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wall-region-score {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.wall-region-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  gap: 2px;
}

.wall-region-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.wall-region-size {
  font-size: 10px;
  color: #64748b;
}

/* ==================== Tutorial Modal ==================== */

.modal-tutorial {
  max-width: 400px;
  text-align: center;
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tutorial-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1e293b;
}

.tutorial-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.tutorial-close-btn:hover {
  color: #334155;
}

/* Tutorial Progress Steps */
.tutorial-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}

.tutorial-step {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: all 0.3s;
}

.tutorial-step.active .tutorial-step-dot {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.tutorial-step.completed .tutorial-step-dot {
  background: #10b981;
}

.tutorial-step-line {
  width: 24px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 4px;
}

/* Tutorial Content */
.tutorial-content {
  padding: 8px 0 24px;
}

.tutorial-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.tutorial-content h4 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #1e293b;
}

.tutorial-content p {
  margin: 0 0 16px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

/* Tutorial Features Grid */
.tutorial-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.tutorial-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
}

.feature-icon {
  font-size: 18px;
}

/* Tutorial Tip */
.tutorial-tip {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 3px solid #3b82f6;
  padding: 12px;
  border-radius: 0 8px 8px 0;
  text-align: left;
  font-size: 13px;
  color: #1e40af;
}

.tutorial-tip strong {
  color: #1e3a8a;
}

/* Tutorial CTA */
.tutorial-cta {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  padding: 16px;
  border-radius: 8px;
  margin-top: 8px;
}

.tutorial-cta p {
  margin: 0;
  font-weight: 600;
  color: #065f46;
}

/* Tutorial Actions */
.tutorial-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.tutorial-nav {
  display: flex;
  gap: 8px;
}

/* ==================== Wall Art Gallery ==================== */

.art-source-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
}

.art-source-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.art-source-tab:hover {
  color: #334155;
}

.art-source-tab.active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.art-source-content {
  min-height: 120px;
}

.art-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* Gallery Categories */
.gallery-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.gallery-category-btn {
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 16px;
  cursor: pointer;
  font-size: 11px;
  color: #64748b;
  transition: all 0.2s;
}

.gallery-category-btn:hover {
  border-color: #e94560;
  color: #e94560;
}

.gallery-category-btn.active {
  background: #e94560;
  border-color: #e94560;
  color: #fff;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
}

.gallery-item {
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.gallery-item:hover {
  border-color: #e94560;
  transform: scale(1.02);
}

.gallery-item.selected {
  border-color: #e94560;
  box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3);
}

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

.gallery-item-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 9px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

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

/* Gallery scrollbar */
.gallery-grid::-webkit-scrollbar {
  width: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==================== Slideshow Image List ==================== */

.slideshow-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 40px;
  padding: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.slideshow-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
}

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

.slideshow-thumb .remove-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

/* ==================== Live Tab Capture ==================== */

.livetab-status {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.livetab-badge {
  display: inline-block;
  background: #e53e3e;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 1px;
  animation: livetab-pulse 2s infinite;
}

@keyframes livetab-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.livetab-reconnect {
  margin-top: 10px;
}
