/* Shorts Make - Additional Styles */

/* 스텝 컨테이너 기본 설정 */
.step-container {
  transition: opacity 0.3s ease;
}

.step-container.active {
  opacity: 1;
}

/* 진행 바 애니메이션 */
.progress-bar {
  transition: width 0.3s ease;
}

/* 템플릿 카드 호버 효과 */
.template-card {
  transition: all 0.2s ease;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 음악 아이템 호버 효과 */
.music-item {
  transition: all 0.2s ease;
}

.music-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 버튼 호버 효과 */
.btn-primary:hover {
  background: #FFD966 !important;
  box-shadow: 0 4px 12px rgba(255, 224, 134, 0.4);
}

.btn-secondary:hover {
  background: #F7F7F7 !important;
}

.btn-save:hover,
.btn-reset:hover {
  background: #F7F7F7 !important;
}

.play-btn:hover {
  transform: scale(1.1);
}

/* 토글 스위치 애니메이션 */
.toggle-switch {
  transition: background 0.3s ease;
}

.toggle-knob {
  transition: left 0.3s ease;
}

/* 워터마크 설정 페이드 인 */
.watermark-settings {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 슬라이드 카드 호버 효과 */
.slide-card {
  transition: all 0.2s ease;
}

.slide-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 슬라이드 콘텐츠 레이아웃 - 데스크톱 */
.slide-content-wrapper {
  display: flex;
  gap: 24px;
}

.slide-preview-area {
  flex: 0 0 280px;
}

.slide-script-area {
  flex: 1;
}

/* 업로드 박스 호버 효과 */
.upload-box:hover {
  border-color: #FFE086;
  background: #FFFDF5;
}

/* 영상 생성 버튼 강조 효과 */
.btn-create {
  transition: all 0.2s ease;
}

.btn-create:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(255, 224, 134, 0.5);
}

.btn-create:active {
  transform: scale(0.98);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: 1fr !important;
  }

  .button-group {
    flex-wrap: wrap;
  }

  .button-group button {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
  }

  .main-title {
    font-size: 28px !important;
  }

  .sub-title {
    font-size: 16px !important;
  }

  /* slide-card 반응형 */
  .slide-card {
    padding: 16px !important;
  }

  /* slide-header 반응형 */
  .slide-header > div:first-child {
    gap: 12px !important;
  }

  .slide-header > div:first-child img {
    width: 60px !important;
    height: 60px !important;
  }

  .slide-header > div:first-child > div > div:first-child span:first-child {
    font-size: 16px !important;
  }

  /* slide-content 레이아웃을 세로로 변경 */
  .slide-content-wrapper {
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* 미리보기 영역 - 전체 너비 */
  .slide-preview-area {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 자막 편집 영역 - 전체 너비 */
  .slide-script-area {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  /* preview-canvas 컨테이너 반응형 */
  .slide-content .preview-canvas {
    width: 100% !important;
    height: auto !important;
  }

  /* 미리보기 영역 컨테이너에 max-width 추가 */
  .slide-content > div:first-child > div:first-child > div:nth-child(2) {
    max-width: 320px !important;
    margin: 0 auto !important;
  }

  /* 이미지 교체 버튼 반응형 */
  .image-replace-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }

  .image-replace-btn span {
    font-size: 13px !important;
  }

  /* 효과 재생 버튼 반응형 */
  .play-effect-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }

  /* 자동 효과 토글 스위치 */
  .toggle-switch-small {
    width: 40px !important;
    height: 22px !important;
  }

  .toggle-knob {
    width: 18px !important;
    height: 18px !important;
  }

  /* 사진 효과 설정 박스 */
  .effect-type-select {
    font-size: 13px !important;
    padding: 8px !important;
  }

  .effect-intensity-slider {
    width: 100% !important;
  }

  /* 오른쪽 자막 편집 영역 */
  .slide-content > div:first-child > div:last-child {
    flex: none !important;
    width: 100% !important;
  }

  /* script-item 내부 그리드를 세로로 변경 */
  .script-item .tab-content-mini > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* 스타일 탭 - 가로 스크롤 가능하게 */
  .script-item > div:nth-child(3) > div {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }

  /* 자막 텍스트 입력창 */
  .script-text-input {
    font-size: 14px !important;
    min-height: 100px !important;
  }

  /* TTS 버튼들 */
  .btn-tts-preview,
  .btn-record-voice,
  .btn-upload-voice {
    font-size: 12px !important;
    padding: 8px 6px !important;
  }

  /* 사용자 음성 파일 표시 영역 */
  .custom-voice-status > div {
    flex-wrap: wrap !important;
  }

  /* 버튼 그룹들 */
  .btn-add-script,
  .btn-add-silent {
    font-size: 13px !important;
    padding: 10px 8px !important;
  }
}

/* 탭 버튼 애니메이션 */
.tab-btn,
.music-tab {
  transition: all 0.2s ease;
}

.tab-btn:hover,
.music-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 라디오 카드 애니메이션 */
.radio-card {
  transition: all 0.2s ease;
}

.radio-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 인풋 포커스 효과 */
input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #FFE086;
  box-shadow: 0 0 0 3px rgba(255, 224, 134, 0.2);
}

/* 슬라이더 스타일 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #E5E7EB;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0B1215;
  cursor: pointer;
  border: 3px solid #FFE086;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0B1215;
  cursor: pointer;
  border: 3px solid #FFE086;
}

/* 다크 모드 대응 */
[data-theme="dark"] .template-card,
[data-theme="dark"] .music-item,
[data-theme="dark"] .slide-card,
[data-theme="dark"] .watermark-toggle-section,
[data-theme="dark"] .watermark-type-section,
[data-theme="dark"] .watermark-text-section,
[data-theme="dark"] .preview-section,
[data-theme="dark"] .size-style-section,
[data-theme="dark"] .ai-section {
  background: var(--bg-card);
  border-color: #374151;
}

[data-theme="dark"] .upload-box:hover {
  background: #1F2937;
  border-color: #FFE086;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #1F2937;
  color: #F9FAFB;
  border-color: #374151;
}

[data-theme="dark"] .tab-btn:not(.active),
[data-theme="dark"] .music-tab:not(.active) {
  background: #374151;
  color: #D1D5DB;
}

[data-theme="dark"] .radio-card {
  background: #1F2937;
}

[data-theme="dark"] .radio-card.active {
  background: #1F2937;
}

/* 썸네일 리스트 스타일 */
.thumbnail-list-container {
  display: flex;
  gap: 10px;
  padding: 20px 20px;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg-card);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 140px;
  position: relative;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.15);
  scroll-behavior: smooth;
}

.thumbnail-list-container::-webkit-scrollbar {
  height: 8px;
}

.thumbnail-list-container::-webkit-scrollbar-track {
  background: #E5E7EB;
  border-radius: 4px;
}

.thumbnail-list-container::-webkit-scrollbar-thumb {
  background: #FFE086;
  border-radius: 4px;
}

.thumbnail-list-container::-webkit-scrollbar-thumb:hover {
  background: #FFD966;
}

.thumbnail-scroll-btn {
  width: 40px;
  height: 40px;
  border: 2px solid #E5E7EB;
  background: var(--bg-card);
  color: var(--main-text-color, #0B1215);
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.thumbnail-scroll-btn:hover {
  background: #FFE086;
  border-color: #FFE086;
  color: #0B1215;
  transform: scale(1.1);
}

.thumbnail-scroll-btn:active {
  transform: scale(0.95);
}

#thumbnailWrapper {
  display: flex;
  gap: 10px;
  flex: 1;
  overflow-x: auto;
  scroll-behavior: smooth;
}

#thumbnailWrapper::-webkit-scrollbar {
  height: 12px;
}

#thumbnailWrapper::-webkit-scrollbar-track {
  background: #E5E7EB;
  border-radius: 6px;
}

#thumbnailWrapper::-webkit-scrollbar-thumb {
  background: #FFE086;
  border-radius: 6px;
}

#thumbnailWrapper::-webkit-scrollbar-thumb:hover {
  background: #FFD966;
}

.thumbnail-item {
  position: relative;
  width: 80px;
  height: 80px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
  cursor: move;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.thumbnail-item.dragging {
  opacity: 0.5;
  transform: scale(0.9);
}

.thumbnail-item.drag-over {
  border-color: #FFE086;
  transform: scale(1.05);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-number {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 12px;
  font-weight: 600;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.add-image-btn {
  width: 80px;
  height: 80px;
  border: 2px dashed #E5E7EB;
  border-radius: 8px;
  background: #F7F7F7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.add-image-btn:hover {
  border-color: #FFE086;
  background: #FFFDF5;
}

.add-image-btn span {
  font-size: 32px;
  color: #666;
  font-weight: 300;
}

.thumbnail-divider {
  width: 1px;
  height: 60px;
  background-color: #FFE086;
  align-self: center;
  flex-shrink: 0;
}

/* 다크 모드 썸네일 스타일 */
[data-theme="dark"] .thumbnail-list-container {
  background: #1F2937;
  border-color: #374151;
}

[data-theme="dark"] .thumbnail-scroll-btn {
  background: #1F2937;
  border-color: #374151;
  color: #D1D5DB;
}

[data-theme="dark"] .thumbnail-scroll-btn:hover {
  background: #FFE086;
  border-color: #FFE086;
  color: #0B1215;
}

[data-theme="dark"] .thumbnail-item {
  border-color: #374151;
}

[data-theme="dark"] .add-image-btn {
  background: #1F2937;
  border-color: #374151;
}
