/* GIF 만들기 전용 스타일 */

/* 이미지 리스트 */
.image-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.image-list:empty {
  display: none;
}

.image-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: grab;
  transition: border-color 0.2s, opacity 0.2s;
  user-select: none;
}

.image-item:active {
  cursor: grabbing;
}

.image-item.dragging {
  opacity: 0.4;
  border-color: var(--primary);
}

.image-item.drag-over {
  border-color: var(--primary);
  border-style: dashed;
}

.drag-handle {
  color: var(--text-sub);
  font-size: 1rem;
  flex-shrink: 0;
  cursor: grab;
  line-height: 1;
}

.image-item .thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

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

.image-item .filename {
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-item .dimensions {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.image-item .order-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(102, 126, 234, 0.1);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 옵션 패널 */
.options-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.options-panel h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.option-field .label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
}

.option-field select,
.option-field input[type="number"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}

.option-field input[type="number"] {
  width: 90px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-row input[type="range"] {
  width: 160px;
  accent-color: var(--primary);
}

.range-row .value {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 5ch;
}

/* 생성 버튼 */
.action-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-generate {
  padding: 0.65rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-generate:hover {
  background: var(--primary-hover);
}

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

.image-count {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* 진행 바 */
.progress-section {
  margin-bottom: 1.5rem;
}

.progress-section[hidden] {
  display: none;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.15s;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 0.5rem;
  text-align: center;
}

/* 미리보기 / 결과 */
.result-section {
  margin-top: 1.5rem;
}

.result-section[hidden] {
  display: none;
}

.result-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.preview-wrap {
  text-align: center;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.preview-wrap img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 6px;
}

.result-info {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 1rem;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* 반응형 */
@media (max-width: 480px) {
  .option-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .range-row input[type="range"] {
    width: 130px;
  }

  .image-item .thumb {
    width: 40px;
    height: 40px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

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