@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

* { 
  box-sizing: border-box; 
}

body {
  margin: 0; 
  background: #E9ECF3; 
  font-family: 'Pretendard', sans-serif; 
  font-weight: 700;
  display: flex; 
  justify-content: center; 
  align-items: center;
  width: 100vw; 
  height: 100vh; 
  overflow: hidden;
}

#app { 
  width: 96vw; 
  height: 94vh; 
  display: flex; 
  gap: 20px; 
}

/* 왼쪽 메인 패널 조립 영역 (가로 너비 와이드 확보) */
#mainArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

#workspace { 
  flex: 1;
  display: flex; 
  justify-content: center; 
  align-items: center; 
  background: rgba(0, 0, 0, 0.03);
  border-radius: 24px;
  padding: 10px;
}

#editorWrap {
  position: relative;
  width: 960px;
  height: 540px;
  border-radius: 20px;
  box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;
  border: 2px solid rgba(138, 199, 228, 0.925);
  background: #72afe9;
  overflow: hidden;
}

#canvasContainer {
  width: 100%;
  height: 100%;
}

#canvas { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
}

/* 하단 고정 와이드 타임라인 패널 전용 세팅 */
.timeline-panel {
  width: 100%;
  flex-shrink: 0;
  padding: 12px 20px !important;
}

#timelineWrapper {
  position: relative; 
  width: 100%; 
  padding-bottom: 12px; 
  margin-top: 6px;
}

#timeline {
  width: 100%; 
  margin: 0; 
  position: relative; 
  z-index: 2;
}

#keyframesContainer {
  position: absolute; 
  bottom: 0; 
  left: 0; 
  width: 100%; 
  height: 6px; 
  background: rgba(14, 75, 145, 0.4); 
  border-radius: 3px; 
  z-index: 1;
}

/* ✨ 우측 사이드바 패널 (양옆으로 긴 패널 폭을 250px로 콤팩트하게 슬림화 축소) */
#sidebar {
  width: 250px; 
  display: flex; 
  flex-direction: column; 
  gap: 12px;
  max-height: 100%; 
  overflow-y: auto; 
  padding-right: 4px;
  flex-shrink: 0;
}

#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-thumb { background: #00D8FF; border-radius: 3px; }

.panel {
  background: #002A58; 
  border-radius: 18px; 
  padding: 12px 14px;
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  color: #F7F7F7;
  box-shadow: rgba(3, 102, 214, 0.2) 0px 0px 0px 3px; 
  flex-shrink: 0;
}

.title { 
  font-size: 13px; 
  font-weight: 800; 
  color: #FFFFFF;
  border-bottom: 2px solid rgba(255,255,255,0.1); 
  padding-bottom: 4px; 
}

#layerPanel {
  background: #0E4B91; 
  border-radius: 10px; 
  padding: 4px; 
  overflow-y: auto;
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  min-height: 80px; 
  max-height: 110px;
}

.layer-item { 
  padding: 5px 8px; 
  background: rgba(255,255,255,0.07); 
  border-radius: 6px; 
  cursor: pointer; 
  font-size: 11px; 
  transition: 0.15s; 
  user-select: none; 
}
.layer-item:hover { background: rgba(255,255,255,0.15); }
.layer-item.selected { background: #00D8FF; color: #002A58; font-weight: 800; }

button, input[type="file"]::file-selector-button {
  border: none; 
  border-radius: 10px; 
  background: #0E4B91; 
  color: #F7F7F7;
  padding: 8px 10px; 
  font-family: 'Pretendard'; 
  font-weight: 700; 
  cursor: pointer; 
  transition: 0.2s;
  font-size: 12px;
}
button:hover { background: #1562BB; }

label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #dcdde1; }
.compact-label { flex-direction: row; align-items: center; justify-content: space-between; }
.compact-label input[type="number"] { width: 50px; padding: 4px; font-size: 11px; }

input[type="number"] { 
  border: none; 
  border-radius: 6px; 
  padding: 4px; 
  font-family: 'Pretendard'; 
  font-weight: 700; 
  background: #E9ECF3;
  color: #002A58;
}
input[type="range"] { width: 100%; cursor: pointer; margin: 2px 0; }
input[type="color"] { width: 100%; height: 26px; border: none; border-radius: 6px; background: none; cursor: pointer; }

.styled-select { 
  border: none; 
  border-radius: 6px; 
  padding: 4px; 
  font-family: 'Pretendard'; 
  font-weight: 700; 
  background: #E9ECF3; 
  color: #002A58; 
  outline: none; 
}

.fx-section {
  margin-top: 2px;
  background: rgba(0,0,0,0.15);
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

#topMenu { position: absolute; top: 0; left: 0; display: flex; gap: 16px; padding: 8px 16px; user-select: none; z-index: 99999; }
.menuItem { position: relative; font-weight: 800; color: #002A58; cursor: pointer; padding: 6px 10px; font-size: 13px; }
.dropdown {
  position: absolute; 
  top: calc(100% + 4px); 
  left: 0; 
  min-width: 200px; 
  background: rgba(0,42,88,0.98);
  border: 1px solid #00D8FF;
  border-radius: 12px; 
  padding: 12px; 
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  opacity: 0; 
  visibility: hidden; 
  transform: translateY(-6px);
  transition: 0.2s ease;
  z-index: 9999;
}
.dropdown label { color: #fff; }
.dropdown input { background: #fff; }
.menuItem:hover .dropdown, .dropdown:hover { opacity: 1; visibility: visible; transform: translateY(0); }
.menuItem::after { content: ""; position: absolute; left: 0; top: 100%; width: 100%; height: 12px; }

#contextMenu { position: fixed; display: none; flex-direction: column; background: #002A58; padding: 8px; border-radius: 12px; z-index: 99999; box-shadow: 0 0 10px #00D8FF; gap: 4px; border: 1px solid #00D8FF; }
#contextMenu button { background: transparent; border: none; padding: 8px 14px; border-radius: 6px; text-align: left; font-size: 12px; }
#contextMenu button:hover { background: rgba(255,255,255,0.1); }

.timeline-marker {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ff4757;
  border-radius: 50%;
  transform: translateX(-50%);
  top: 1px;
}