/* === Virtual Cinematographer Pro — 3D 카메라 스튜디오 ===
   원본 F:\Download\virtual cinematographer pro 의 Tailwind 스타일을 이식.
   카메라 앵글 버튼 → 스테이지 전체 오버레이 (미리보기 영역까지 확장). */

.nk-camstudio-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(2, 6, 10, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 14px;
}

.nk-camstudio {
  position: relative;
  flex: 1;
  display: flex;
  min-width: 0;
  max-width: 1760px;
  background: #0e0e0e;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  user-select: none;
  font-family: inherit;
}

.nk-camstudio-icon { flex: none; }

/* ===== 좌측: 뷰포트 + 갤러리 ===== */
.nk-camstudio-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.nk-camstudio-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(to bottom, #022d26, #011a14);
}

.nk-camstudio-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.nk-camstudio-mode-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.nk-camstudio-mode-btn {
  min-width: 64px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nk-camstudio-mode-btn:hover { color: #fff; }

.nk-camstudio-mode-btn.active {
  background: #37C68D;
  color: #000;
  box-shadow: 0 6px 18px rgba(55, 198, 141, 0.35);
}

/* POV 프레이밍 오버레이 (16:9 마스크 + 크로스헤어) */
.nk-camstudio-pov-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nk-camstudio-pov-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  border: 1px solid rgba(55, 198, 141, 0.2);
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4);
}

.nk-camstudio-pov-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  opacity: 0.4;
}

.nk-camstudio-pov-crosshair i {
  position: absolute;
  background: #37C68D;
}

.nk-camstudio-pov-crosshair i:first-child {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
}

.nk-camstudio-pov-crosshair i:last-child {
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
}

/* HUD */
.nk-camstudio-hud {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-family: 'Consolas', 'SFMono-Regular', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.nk-camstudio-hud > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.nk-camstudio-hud span {
  opacity: 0.3;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.nk-camstudio-hud strong { color: #37C68D; font-weight: 700; }
.nk-camstudio-hud strong.is-gold { color: #FFD700; }

/* 그리드 토글 (뷰포트 우측 하단) */
.nk-camstudio-grid-toggle {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #37C68D;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nk-camstudio-grid-toggle:hover {
  background: rgba(55, 198, 141, 0.16);
  border-color: rgba(55, 198, 141, 0.4);
}

.nk-camstudio-grid-toggle.is-off { color: rgba(255, 255, 255, 0.4); }

.nk-camstudio-grid-toggle.is-off:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
}

/* 갤러리 */
.nk-camstudio-gallery-wrap {
  height: 172px;
  flex: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nk-camstudio-gallery {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.nk-camstudio-gallery::-webkit-scrollbar { height: 4px; }
.nk-camstudio-gallery::-webkit-scrollbar-track { background: transparent; }
.nk-camstudio-gallery::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.nk-camstudio-gallery-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.14);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nk-camstudio-shot {
  position: relative;
  flex: none;
  width: 208px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.nk-camstudio-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nk-camstudio-shot-hover {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #37C68D;
  text-align: center;
}

.nk-camstudio-shot:hover .nk-camstudio-shot-hover { opacity: 1; }

.nk-camstudio-shot-hover p {
  margin: 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Consolas', monospace;
}

/* ===== 우측 사이드바 ===== */
.nk-camstudio-sidebar {
  width: 320px;
  flex: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #111111;
  overflow-y: auto;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.nk-camstudio-sidebar::-webkit-scrollbar { width: 4px; }
.nk-camstudio-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.nk-camstudio-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nk-camstudio-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(218, 220, 224, 0.9);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  padding: 0 2px;
}

/* Pill 버튼 (VCP Primitives.PillButton) */
.nk-camstudio-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 0;
}

.nk-camstudio-pill.is-solid {
  background: #fff;
  color: #000;
}

.nk-camstudio-pill.is-solid:hover { background: #e2e2e2; }

.nk-camstudio-pill.is-outline {
  background: transparent;
  border: 1px solid #595959;
  color: #fff;
  backdrop-filter: blur(40px);
}

.nk-camstudio-pill.is-outline:hover { background: rgba(255, 255, 255, 0.05); }
.nk-camstudio-pill.is-outline:active { background: rgba(255, 255, 255, 0.1); }

.nk-camstudio-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.nk-camstudio-ref-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.nk-camstudio-ref-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  cursor: pointer;
}

.nk-camstudio-ref-menu button:hover { background: rgba(255, 255, 255, 0.08); }

/* 슬라이더 카드 */
.nk-camstudio-slider-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}

.nk-camstudio-slider { display: flex; flex-direction: column; gap: 4px; }

.nk-camstudio-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(218, 220, 224, 0.9);
}

.nk-camstudio-slider-value {
  color: #c7c9cd;
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.nk-camstudio-slider input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  padding: 8px 0;
  margin: 0;
}

.nk-camstudio-slider input[type='range']::-webkit-slider-runnable-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}

.nk-camstudio-slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #37C68D;
  margin-top: -5px;
  box-shadow: 0 0 10px rgba(55, 198, 141, 0.4);
}

.nk-camstudio-slider input[type='range']::-moz-range-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}

.nk-camstudio-slider input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #37C68D;
  box-shadow: 0 0 10px rgba(55, 198, 141, 0.4);
}

/* 프리셋 그리드 (3열) */
/* 약자 라벨이라 4열에 들어간다 — 각 프리셋이 2행을 넘지 않아 생성 버튼이 화면에 남는다 */
.nk-camstudio-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.nk-camstudio-preset {
  text-align: center;
  padding: 9px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.nk-camstudio-preset:hover { background: rgba(255, 255, 255, 0.1); }

/* 초기화 + 스타일 행 */
.nk-camstudio-row {
  display: flex;
  gap: 8px;
  position: relative;
}

.nk-camstudio-half { min-width: 108px; width: auto; flex: none; }

.nk-camstudio-style-wrap { position: relative; flex: 1; min-width: 0; }

.nk-camstudio-style-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  z-index: 40;
  animation: nkCamstudioSlideUp 0.2s ease-out;
}

.nk-camstudio-style-menu.hidden { display: none; }

.nk-camstudio-style-menu-head {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(218, 220, 224, 0.9);
}

.nk-camstudio-style-menu-list {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nk-camstudio-style-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.nk-camstudio-style-option:hover { background: rgba(255, 255, 255, 0.1); }

.nk-camstudio-style-option.active {
  background: #37C68D;
  color: #000;
  font-weight: 700;
}

/* 프롬프트 미리보기 */
.nk-camstudio-prompt-preview {
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-family: 'Consolas', monospace;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  word-break: break-word;
  user-select: text;
  /* 프롬프트가 길어져도 사이드바를 밀어내지 않게 — 이 블록만 스크롤한다 */
  max-height: 84px;
  overflow-y: auto;
}

/* 생성 버튼 — 어떤 경우에도 화면에서 사라지지 않도록 사이드바 하단에 고정 */
.nk-camstudio-generate-wrap {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
  padding-top: 16px;
  padding-bottom: 4px;
  background: #111111;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nk-camstudio-generate {
  height: 54px;
  min-width: 100%;
  border: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  background: #37C68D;
  color: #000;
  box-shadow: 0 0 20px rgba(55, 198, 141, 0.3);
  transition: transform 0.12s ease, background 0.15s ease;
}

.nk-camstudio-generate:hover:not(.is-disabled) { transform: scale(1.02); }
.nk-camstudio-generate:active:not(.is-disabled) { transform: scale(0.98); }

.nk-camstudio-generate.is-disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  box-shadow: none;
}

.nk-camstudio-spin { display: inline-flex; animation: nkCamstudioSpin 1s linear infinite; }

.nk-camstudio-error {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  color: #ef4444;
  text-align: center;
}

/* 닫기 버튼 */
.nk-camstudio-close {
  position: absolute;
  top: 12px;
  right: 332px;
  z-index: 20;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nk-camstudio-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

/* ===== 샷 프리뷰 모달 (VCP PreviewModal) ===== */
.nk-camstudio-modal {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(4px);
}

.nk-camstudio-modal-box {
  display: flex;
  width: 100%;
  max-width: 1100px;
  max-height: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  animation: nkCamstudioSlideUp 0.2s ease-out;
}

.nk-camstudio-modal-media {
  flex: 1;
  min-width: 0;
  min-height: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nk-camstudio-modal-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.nk-camstudio-modal-side {
  width: 320px;
  flex: none;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  background: #111;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nk-camstudio-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.nk-camstudio-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #37C68D;
}

.nk-camstudio-close-mini {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.nk-camstudio-close-mini:hover { background: rgba(255, 255, 255, 0.05); }

.nk-camstudio-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}

.nk-camstudio-meta-grid > div { display: flex; flex-direction: column; gap: 2px; }
.nk-camstudio-meta-wide { grid-column: span 2; padding-top: 4px; }

.nk-camstudio-meta-grid span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

.nk-camstudio-meta-grid strong {
  font-family: 'Consolas', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #37C68D;
}

.nk-camstudio-meta-grid strong.is-gold { color: #FFD700; }
.nk-camstudio-meta-wide strong { font-family: inherit; color: rgba(255, 255, 255, 0.8); }

.nk-camstudio-modal-stamp {
  margin: 0;
  padding: 0 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.nk-camstudio-modal-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
}

.nk-camstudio-modal-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

@keyframes nkCamstudioSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 좁은 화면 */
@media (max-width: 1080px) {
  .nk-camstudio { flex-direction: column; }
  .nk-camstudio-sidebar {
    width: 100%;
    max-height: 44%;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nk-camstudio-close { right: 12px; }
  .nk-camstudio-gallery-wrap { height: 132px; }
  .nk-camstudio-modal-box { flex-direction: column; overflow-y: auto; }
  .nk-camstudio-modal-side { width: 100%; border-left: 0; }
}
