/* style.css */

/* 1. 디자인 시스템 토큰 & 리셋 */
:root {
  --font-main: 'Outfit', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* 테마 컬러 (어두운 글래스모피즘 어두운 모드) */
  --bg-app: #080c14;
  --bg-sidebar: rgba(13, 20, 35, 0.75);
  --bg-card: rgba(22, 31, 54, 0.6);
  --bg-card-hover: rgba(30, 42, 73, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-active: rgba(99, 102, 241, 0.4);
  
  /* 텍스트 컬러 */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #4b5563;

  /* 악센트 컬러 (그라데이션 및 네온 효과) */
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #a855f7; /* Purple */
  --accent-cyan: #06b6d4; /* Cyan */
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  --accent-glow: 0 0 15px rgba(99, 102, 241, 0.4);
  
  /* 반응형 규격 */
  --sidebar-width: 400px;
  --header-height: 0px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 2. 레이아웃 구조 */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
}

.workspace {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

/* 3. 모바일 탭 바 (기본적으로 숨김) */
.mobile-tabs {
  display: none;
  background-color: rgba(13, 20, 35, 0.95);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  z-index: 10;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn.active {
  color: var(--text-main);
  background-color: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* 4. 왼쪽 설정 사이드바 */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  gap: 24px;
  z-index: 2;
  box-shadow: 5px 0 25px rgba(0,0,0,0.25);
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.sidebar-header p {
  font-size: 12px;
  color: var(--text-muted);
}

/* 업로드 컨테이너 */
.upload-container {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background-color: var(--bg-card);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.upload-container:hover, .upload-container.dragover {
  border-color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.05);
  box-shadow: var(--accent-glow);
}

.upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  color: var(--accent-cyan);
  transition: transform 0.3s ease;
}

.upload-container:hover .upload-icon {
  transform: translateY(-4px);
}

.upload-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.upload-tip {
  font-size: 11px;
  color: var(--text-muted);
}

/* 파일 로딩 후의 정보 카드 */
.source-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  position: relative;
}

.source-thumbnail-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background-color: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
}

.source-thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.source-filename {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.source-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-btn:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

/* 5. 옵션 설정 폼 */
.options-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.3s ease;
}

.options-panel.disabled {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

/* 모드 선택 격자 */
.mode-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mode-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.mode-option:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.mode-option.active {
  background-color: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.mode-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.mode-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.mode-option.active .mode-name {
  color: #a5b4fc;
}

/* 모드별 동적 설정 구역 */
.mode-settings-wrapper {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.mode-settings {
  display: none;
  padding: 16px;
  flex-direction: column;
  gap: 16px;
}

.mode-settings.active {
  display: flex;
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-item label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.field-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* 슬라이더 영역 헤더 */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  background-color: rgba(6, 182, 212, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* 슬라이더 인풋 스타일링 */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  margin: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

#settings-smooth input[type="range"]::-webkit-slider-thumb {
  background: var(--accent-primary);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
}

/* 체크박스 디자인 */
.checkbox-item {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-item label {
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

/* 컬러 피커 커스텀 */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border-color);
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.color-hex-label {
  font-size: 13px;
  font-family: monospace;
  color: var(--text-muted);
}

/* 배경 선택 라디오단추 그룹 */
.bg-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.bg-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.bg-option:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.bg-option.active {
  border-color: var(--accent-cyan);
  background-color: rgba(6, 182, 212, 0.08);
}

.bg-preview {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-block;
}

.transparent-preview {
  background-image: 
    linear-gradient(45deg, #ccc 25%, transparent 25%), 
    linear-gradient(-45deg, #ccc 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #ccc 75%), 
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 6px 6px;
  background-position: 0 0, 0 3px, 3px -3px, -3px 0px;
  background-color: white;
}

#custom-bg-input {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  cursor: pointer;
}

#custom-bg-input::-webkit-color-swatch {
  border-radius: 4px;
  border: 1px solid #fff;
}

.divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* 메인 실행 버튼 */
.convert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  font-family: var(--font-main);
  margin-top: 10px;
}

.convert-btn:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.convert-btn:active {
  transform: translateY(1px);
}

.convert-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-icon {
  font-size: 16px;
  animation: pulse 1.5s infinite alternate;
}

/* 6. 오른쪽 결과/미리보기 영역 */
.preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #0c111e;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* 상단 툴바 */
.toolbar {
  height: 56px;
  min-height: 56px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(13, 20, 35, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.toolbar-tabs {
  display: flex;
  gap: 6px;
}

.tool-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.tool-tab:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.04);
}

.tool-tab.active {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.tool-tab-icon {
  font-size: 14px;
}

/* 미리보기 격자배경 대비 컨트롤러 */
.view-bg-controller {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.bg-control-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}

.bg-control-dot.active {
  transform: scale(1.2);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.bg-control-dot[data-view-bg="grid"] {
  background-image: 
    linear-gradient(45deg, #777 25%, transparent 25%), 
    linear-gradient(-45deg, #777 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #777 75%), 
    linear-gradient(-45deg, transparent 75%, #777 75%);
  background-size: 4px 4px;
  background-color: #333;
}

/* 미리보기 뷰포트 */
.preview-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0c111e;
  transition: background 0.25s ease;
}

/* 뷰포트 배경 모드들 */
.preview-viewport.bg-grid {
  background-image: 
    linear-gradient(45deg, rgba(0,0,0,0.1) 25%, transparent 25%), 
    linear-gradient(-45deg, rgba(0,0,0,0.1) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.1) 75%), 
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.1) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #121829;
}
.preview-viewport.bg-white {
  background-color: #ffffff;
}
.preview-viewport.bg-grey {
  background-color: #7f7f7f;
}
.preview-viewport.bg-black {
  background-color: #05070c;
}

/* 7. 비교 드래그 슬라이더 */
.comparison-slider-container {
  position: relative;
  width: 90%;
  height: 90%;
  max-width: 800px;
  max-height: 500px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  user-select: none;
  background-color: rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.layer-original {
  z-index: 1;
}

.layer-original canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.layer-vector {
  z-index: 2;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: transparent;
  clip-path: inset(0 0 0 50%); /* 초기 슬라이드 50% 잘라냄 */
}

/* 잘린 레이어 내부의 자식은 전체 너비(100%)를 온전히 유지하여 원본 이미지와 픽셀 정렬이 정확히 일치하도록 합니다. */
.layer-vector .svg-render-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layer-vector svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* 뷰 모드에 따른 오버라이드 (비교가 아닐 때) */
.view-only-vector .layer-vector {
  clip-path: none !important;
}
.view-only-vector .layer-original, 
.view-only-vector .slider-handle {
  display: none !important;
}

/* 배지 */
.layer-badge {
  position: absolute;
  bottom: 16px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
}

.layer-original .layer-badge {
  left: 16px;
  background-color: rgba(15, 23, 42, 0.75);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.08);
}

.layer-vector .layer-badge {
  right: 16px;
  background-color: rgba(99, 102, 241, 0.85);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 슬라이더 드래그 핸들 */
.slider-handle {
  position: absolute;
  top: 0;
  left: 50%; /* 슬라이더 조절 시 바뀜 */
  width: 2px;
  height: 100%;
  background-color: white;
  z-index: 3;
  cursor: ew-resize;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

.slider-handle-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.slider-handle-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #0c111e;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5), inset 0 2px 5px rgba(255,255,255,0.1);
  transition: transform 0.1s;
}

.slider-handle:hover .slider-handle-button, 
.slider-handle:active .slider-handle-button {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: var(--accent-cyan);
  color: #0c111e;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.8);
}

/* 8. 소스 코드 뷰어 */
.code-viewer-container {
  width: 90%;
  height: 90%;
  max-width: 800px;
  max-height: 500px;
  background-color: rgba(5, 8, 15, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  overflow: auto;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.code-viewer-container pre {
  margin: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #38bdf8; /* 연한 블루 코드 컬러 */
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 9. 초기 빈 대기 화면 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  animation: fadeIn 0.5s ease-out;
}

.empty-graphic {
  color: var(--text-dark);
  margin-bottom: 20px;
  animation: float 4s ease-in-out infinite;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  max-width: 360px;
}

/* 10. 로더 오버레이 */
.loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 12, 20, 0.65);
  backdrop-filter: blur(8px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-loader {
  background-color: rgba(22, 31, 54, 0.85);
  border: 1px solid var(--border-color-active);
  box-shadow: var(--accent-glow);
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 280px;
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-cyan);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.loader-message {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

/* 프로그레스 바 */
.progress-bar-container {
  width: 100%;
  height: 4px;
  background-color: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-primary));
  border-radius: 2px;
  transition: width 0.15s ease-out;
}

/* 11. 하단 통계 패널 */
.stats-panel {
  height: 64px;
  min-height: 64px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(13, 20, 35, 0.4);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 12px;
  align-items: center;
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}

.stats-panel.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--border-color);
  padding: 4px;
}

.stat-card:last-child {
  border-right: none;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

/* 12. 하단 액션 버튼 푸터 */
.action-footer {
  height: 72px;
  min-height: 72px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(13, 20, 35, 0.8);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  gap: 12px;
}

.action-footer.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn {
  background: var(--accent-gradient);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.secondary-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.secondary-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.action-btn:active {
  transform: translateY(1px);
}

/* 13. 애니메이션 정의 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

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

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* 14. 반응형 레이아웃 미디어 쿼리 */
@media (max-width: 900px) {
  .workspace {
    flex-direction: column;
    overflow-y: auto;
  }
  
  .mobile-tabs {
    display: flex;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    display: none; /* 탭 전환용 */
  }
  
  .preview-area {
    width: 100%;
    height: calc(100vh - 110px); /* 탭바 및 뷰포트 높이 보정 */
    display: none; /* 탭 전환용 */
  }

  /* 활성화된 탭만 보여줌 */
  .sidebar.active, .preview-area.active {
    display: flex;
  }

  .comparison-slider-container {
    width: 95%;
    height: 90%;
    aspect-ratio: 4/3;
  }

  .stats-panel {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    padding: 8px;
    gap: 8px;
  }

  .stat-card {
    border-right: none;
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
  }

  .action-footer {
    padding: 12px;
    height: auto;
    min-height: auto;
    flex-wrap: wrap;
    justify-content: center;
  }

  .action-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 10px;
    font-size: 12px;
  }
}
