/* =====================================================
 * styles.css - HyperFrames 프리미엄 슬라이드 에디터
 * ===================================================== */

/* 1. 디자인 시스템 변수 */
:root {
  --bg-primary: #080c17;
  --bg-secondary: #0d1526;
  --bg-tertiary: #1a2540;
  --bg-accent: #2a3a5c;
  
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-secondary: #8b5cf6;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  
  --text-main: #f0f4ff;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --border-light: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.6);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  
  --header-height: 60px;
  --sidebar-width: 80px;
  --inspector-width: 320px;
  --footer-height: 160px;
  
  --sidebar-bg: linear-gradient(180deg, #0d1526 0%, #0a1020 100%);
}

/* 2. 전역 초기화 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-accent) var(--bg-primary);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

button, input, select, textarea { outline: none; }

/* 3. 앱 전체 레이아웃 */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* 4. 상단 헤더 */
.app-header {
  height: var(--header-height);
  background: linear-gradient(90deg, #0d1526 0%, #111827 100%);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-primary);
  transition: color 0.2s;
}

.logo-link:hover { color: var(--color-secondary); }

.logo-icon {
  font-size: 22px;
}

#project-title {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  width: 180px;
  transition: all 0.2s;
}

#project-title:hover, #project-title:focus {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

.status-indicator {
  font-size: 11px;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.zoom-controls {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.zoom-divider {
  width: 1px;
  height: 16px;
  background: var(--border-light);
  margin: 0 4px;
}

.btn-tool-sm {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.btn-tool-sm:hover { background: var(--bg-accent); }

#select-zoom {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  font-weight: 600;
}

#select-zoom option { background: var(--bg-secondary); }

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
  margin: 0 6px;
}

.guideline-toggles {
  display: flex;
  gap: 4px;
}

.btn-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-toggle:hover { background: var(--bg-accent); color: var(--text-main); }

.btn-toggle.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.undo-redo-controls { display: flex; gap: 3px; }

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 17px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-icon:hover:not(:disabled) { background: var(--bg-accent); }
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }

.header-right {
  display: flex;
  gap: 6px;
  min-width: 300px;
  justify-content: flex-end;
  align-items: center;
}

/* 버튼 스타일 */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), #7c3aed);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-presentation {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-presentation:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover { background-color: var(--bg-accent); }

/* 5. 메인 레이아웃 */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* 6. 좌측 도구 바 */
.left-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-light);
  padding: 12px 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  /* 좌측 사이드바 배경 - 미묘한 그라데이션 포인트 */
  box-shadow: inset -1px 0 0 rgba(99, 102, 241, 0.1);
}

.tool-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0 8px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  width: 62px;
  height: 58px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.tool-btn i { font-size: 22px; }
.tool-btn span { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }

.tool-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-main);
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

/* 7. 중앙 작업 영역 */
.canvas-workspace {
  flex: 1;
  background-color: #060a14;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 미묘한 배경 패턴 제거됨 */
}

.canvas-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.15s ease-out;
}

/* 1920x1080 캔버스 */
.slide-canvas {
  background-color: #1a2130;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(99, 102, 241, 0.1);
  position: relative;
  overflow: hidden;
  transform-origin: top left;
  transition: background-color 0.2s;
}

/* 격자 오버레이 */
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* 격자 패턴 제거됨 */
}

.slide-canvas.no-grid .grid-overlay {
  display: none;
}

/* 안전 영역 */
.safe-area-guide {
  position: absolute;
  top: 60px; left: 60px; right: 60px; bottom: 60px;
  border: 1px dashed rgba(99, 102, 241, 0.3);
  pointer-events: none;
  z-index: 9999;
}

.safe-area-guide.hidden { display: none !important; }

/* 스냅 가이드선 */
.snap-guide-line {
  position: absolute;
  background-color: rgba(99, 102, 241, 0.8);
  pointer-events: none;
  z-index: 10000;
}

.snap-guide-line.horizontal { left: 0; width: 100%; height: 1px; }
.snap-guide-line.vertical { top: 0; height: 100%; width: 1px; }

/* 8. 캔버스 오브젝트 */
.canvas-object {
  position: absolute;
  transform-origin: center center;
  cursor: move;
  box-sizing: border-box;
}

.canvas-object:hover {
  outline: 1px dashed rgba(99, 102, 241, 0.5);
}

.canvas-object.selected {
  outline: 2px solid var(--color-primary);
}

.canvas-object.multi-selected {
  outline: 2px solid var(--color-warning);
}

/* 텍스트 요소 */
.text-element-inner {
  width: 100%;
  height: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
  display: flex;
}

/* 도형 요소 */
.shape-element-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 표 요소 */
.table-element-inner {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  overflow: hidden;
  table-layout: fixed;
}

.table-element-inner th, .table-element-inner td {
  padding: 10px;
  text-align: center;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: middle;
  cursor: pointer;
  transition: background 0.15s;
  word-break: break-word;
  overflow: hidden;
}

.table-element-inner td:hover {
  background: rgba(99, 102, 241, 0.1) !important;
}

.table-element-inner td.cell-selected {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

/* 이미지 요소 */
.image-element-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 아이콘 요소 */
.icon-element-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-element-inner i { line-height: 1; }

/* 차트 요소 */
.chart-element-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 그룹 요소 */
.group-element {
  border: 1px dashed rgba(139, 92, 246, 0.3) !important;
}

.group-element.selected {
  outline: 2px solid var(--color-secondary) !important;
}

/* 9. 리사이즈/회전 핸들 */
.transform-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: #ffffff;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  z-index: 10001;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }

/* 크기 조절 핸들 (상하좌우 중간 핸들) */
.handle-n { top: -7px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.handle-s { bottom: -7px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.handle-e { right: -7px; top: 50%; transform: translateY(-50%); cursor: e-resize; }
.handle-w { left: -7px; top: 50%; transform: translateY(-50%); cursor: w-resize; }

.handle-rotate {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--color-warning);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: grab;
  z-index: 10001;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.handle-rotate-line {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 14px;
  background: var(--color-primary);
  pointer-events: none;
}

/* 10. 우측 인스펙터 */
.right-sidebar {
  width: var(--inspector-width);
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 90;
  flex-shrink: 0;
}

.inspector-tabs {
  display: flex;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 4px;
  gap: 2px;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover { background: var(--bg-tertiary); color: var(--text-main); }
.tab-btn.active { background: var(--bg-secondary); color: var(--color-primary); }

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 속성 그룹 */
.properties-group h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-main);
  border-left: 3px solid var(--color-primary);
  padding-left: 8px;
}

.properties-group h4 {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-row { margin-bottom: 14px; }

.property-row label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.styled-select {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.styled-select:focus { border-color: var(--color-primary); }

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

.flex-inputs-sm {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flex-inputs-sm span {
  font-size: 11px;
  font-weight: 600;
  width: 36px;
  text-align: right;
  color: var(--color-primary);
}

.input-unit {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0 8px;
  flex: 1;
  transition: border-color 0.2s;
}

.input-unit:focus-within { border-color: var(--border-focus); }

.input-unit input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  padding: 7px 0;
  text-align: right;
}

.input-unit span {
  font-size: 10px;
  color: var(--text-dark);
  margin-left: 4px;
  white-space: nowrap;
}

.x-divider { color: var(--text-dark); font-size: 12px; }

.grid-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.label-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dark);
  margin-right: 4px;
  background: rgba(255,255,255,0.05);
  padding: 1px 4px;
  border-radius: 3px;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 4px;
  width: 100%;
}

.color-picker-wrapper input[type="color"] {
  border: none;
  background: transparent;
  width: 30px;
  height: 26px;
  cursor: pointer;
  border-radius: 4px;
}

.color-picker-wrapper.mini {
  width: auto;
  display: inline-flex;
}

.hex-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding-left: 8px;
}

/* 슬라이더 */
.slider-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-wrapper span {
  font-size: 10px;
  color: var(--text-dark);
}

.slider-wrapper input[type="range"],
.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--color-primary);
  cursor: pointer;
  height: 4px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.slider-row span { color: var(--text-muted); }

.flex-row-justify {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rot-input { flex: 0 0 auto; width: 80px; }

/* 이미지 업로드 박스 */
.image-upload-box {
  border: 2px dashed var(--border-light);
  border-radius: 8px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.image-upload-box:hover {
  border-color: var(--color-primary);
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.04);
}

.image-upload-box i { font-size: 22px; }
.image-upload-box span { font-size: 11px; }

.bg-img-controls {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255,255,255,0.02);
  padding: 8px;
  border-radius: 6px;
}

/* 배경 그라데이션 컨트롤 */
.gradient-toggle-row {
  margin-bottom: 10px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
}

.switch-label input[type="checkbox"] { display: none; }

.switch-track {
  width: 32px;
  height: 18px;
  background: var(--bg-accent);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.switch-label input:checked ~ .switch-track {
  background: var(--color-primary);
}

.switch-label input:checked ~ .switch-track::after {
  transform: translateX(14px);
}

.gradient-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gradient-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.gradient-colors label {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.gradient-colors input[type="color"] {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.gradient-preview {
  width: 40px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
  background: linear-gradient(-225deg, #B6CEE8 0%, #F578DC 100%);
}

/* 버튼들 */
.btn-danger {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--color-danger);
  padding: 9px 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-danger:hover { background: var(--color-danger); color: #fff; }

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--color-danger);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-danger-sm:hover { background: var(--color-danger); color: #fff; }

.btn-secondary-sm {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.btn-secondary-sm:hover { background: var(--bg-accent); }

.btn-primary-sm {
  background: var(--color-primary);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

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

.panel-divider {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: 14px 0;
}

/* 정렬 버튼 그룹 */
.btn-group-align {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  padding: 2px;
  border-radius: 6px;
}

.btn-align {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-align.active { background: var(--bg-accent); color: var(--text-main); }

.align-tool-grid, .z-index-tool-grid, .group-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.z-index-tool-grid, .group-tool-grid {
  grid-template-columns: repeat(2, 1fr);
}

.btn-align-action {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 10px;
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.2s;
}

.btn-align-action:hover:not(:disabled) {
  background: var(--bg-accent);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-align-action:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-align-action i { font-size: 16px; }

/* 표 데이터 textarea */
#table-paste-data {
  width: 100%;
  height: 70px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 11px;
  padding: 6px;
  resize: none;
}

/* 텍스트 내용 textarea */
.text-content-textarea {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 13px;
  padding: 8px;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.2s;
  user-select: text;
}

.text-content-textarea:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* 아이콘 검색 */
.icon-search-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.icon-search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 12px;
  padding: 8px 30px 8px 10px;
  border-radius: 6px;
  transition: border-color 0.2s;
}

.icon-search-input:focus { border-color: var(--color-primary); }

.icon-search-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  font-size: 16px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: none;
  margin-bottom: 12px;
}

.icon-grid-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 22px;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-grid-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.icon-grid-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.icon-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* 애니메이션 패널 */
.panel-info-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  background: rgba(255,255,255,0.02);
  padding: 8px;
  border-radius: 6px;
}

.timeline-quick-preview { margin-top: 8px; }

.full-timeline-controls {
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border-light);
}

.play-btn-group { display: flex; gap: 5px; }
.play-btn-group button { flex: 1; }

.timeline-seek-bar-row { display: flex; flex-direction: column; gap: 5px; }
.timeline-seek-bar-row span {
  font-size: 10px;
  color: var(--text-dark);
  font-weight: 700;
  text-align: right;
}

/* 레이어 리스트 */
.layers-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 350px;
  overflow-y: auto;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.layer-item:hover { border-color: var(--color-primary); background: var(--bg-accent); }
.layer-item.active { border-color: var(--color-primary); background: rgba(99, 102, 241, 0.08); }

.layer-item-left {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
}

.layer-item-left i { font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.layer-item-left span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

.layer-item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.btn-layer-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: color 0.2s;
}

.btn-layer-action:hover { color: var(--text-main); }

/* 11. 하단 슬라이드 내비게이터 */
.slide-navigator-footer {
  height: var(--footer-height);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 100;
  flex-shrink: 0;
}

.nav-header {
  height: 38px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.nav-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.nav-action-buttons { display: flex; gap: 5px; }

.thumbnails-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

/* 썸네일 카드 */
.slide-thumbnail-card {
  width: 160px;
  height: 90px;
  background: #1e293b;
  border: 2px solid var(--border-light);
  border-radius: 6px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  transition: all 0.2s;
}

.slide-thumbnail-card:hover {
  border-color: var(--bg-accent);
  transform: translateY(-2px);
}

.slide-thumbnail-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.thumb-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(0,0,0,0.5);
  padding: 2px 5px;
  border-radius: 3px;
  align-self: flex-start;
  z-index: 2;
  position: relative;
}

.thumb-number {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-dark);
  z-index: 2;
  position: relative;
}

.thumb-background-preview {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1;
  background-size: cover;
  background-position: center;
  opacity: 0.8;
}

.thumb-foreground-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 12. 모달 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  width: 600px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalFadeIn 0.25s ease-out;
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-close-modal:hover { color: var(--text-main); }

.modal-body { padding: 20px; }

.modal-body p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

#import-code-area {
  width: 100%;
  height: 240px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: #10b981;
  font-family: monospace;
  font-size: 11px;
  padding: 10px;
  resize: none;
}

.textarea-export-wrapper { margin-top: 12px; }
.textarea-export-wrapper span { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; }

#export-code-area {
  width: 100%;
  height: 110px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 10px;
  padding: 8px;
  resize: none;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-primary);
  display: flex;
  justify-content: flex-end;
}

/* 표 스타일 프리셋 */
.table-preset-modern-navy th { background: #1e3a5f; color: #fff; }
.table-preset-modern-navy td { background: rgba(30, 58, 95, 0.3); color: #e2e8f0; }

.table-preset-dark-zebra th { background: #1a1a2e; color: #e2e8f0; }
.table-preset-dark-zebra tr:nth-child(even) td { background: rgba(255,255,255,0.04); }
.table-preset-dark-zebra td { color: #e2e8f0; }

.table-preset-flat-border th { background: transparent; color: #fff; border-bottom: 2px solid #6366f1; }
.table-preset-flat-border td { background: transparent; color: #e2e8f0; }

.table-preset-simple-line th { background: transparent; color: #94a3b8; border: none; border-bottom: 1px solid rgba(255,255,255,0.15); }
.table-preset-simple-line td { background: transparent; color: #e2e8f0; border: none; border-bottom: 1px solid rgba(255,255,255,0.06); }

/* ===============================================
 * 13. 프리젠테이션 뷰어
 * =============================================== */
.presentation-viewer {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: #000;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
}

.presentation-viewer:hover { cursor: default; }

.presentation-slide-container {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 프리젠테이션 컨트롤 */
.pv-controls {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}

.pv-controls.visible { opacity: 1; }

.pv-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.pv-btn:hover { background: rgba(255,255,255,0.25); }

.pv-btn-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.pv-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 600;
}

.pv-btn-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
  z-index: 20;
  opacity: 0;
}

.pv-btn-close:hover { background: rgba(239,68,68,0.8); }
.pv-btn-close.visible { opacity: 1; }

/* 슬라이드 전환 애니메이션 */
.pv-slide-transition {
  animation: pvSlideIn 0.4s ease-out;
}

@keyframes pvSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===============================================
 * 14. 선택 박스 (다중 선택 드래그)
 * =============================================== */
#selection-box {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.5) inset;
}

/* prop sub section spacing */
.prop-sub-section {
  margin-top: 8px;
}


/* Number Input Spinners CSS */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  height: 100%;
  width: 18px;
  cursor: ns-resize;
  background-color: var(--bg-tertiary);
  border-left: 1px solid var(--border-light);
  margin-left: 4px;
  transition: all 0.2s;
}
input[type="number"]:hover::-webkit-inner-spin-button {
  background-color: var(--bg-accent);
  border-left-color: var(--color-primary);
}

/* 애니메이션 시퀀스 리스트 */
.anim-sequence-list {
  list-style: none;
  padding: 0; margin: 0;
}
.anim-sequence-list li {
  background: var(--bg-tertiary);
  margin-bottom: 4px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  cursor: grab;
  border: 1px solid var(--border-light);
}
.anim-sequence-list li:active {
  cursor: grabbing;
}
.anim-sequence-list li .seq-num {
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: bold;
  margin-right: 10px;
}
.anim-sequence-list li .seq-title {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.anim-sequence-list li.drag-over {
  border-top: 2px solid var(--color-primary);
}

/* 캔버스 뱃지 */
.anim-badge {
  position: absolute;
  top: -10px; left: -10px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  z-index: 9999;
  pointer-events: none;
}

