/* ── detail.css — STELLARA Constellation Detail (s3 design) ── */

/* Body */
.dt-body {
  background: #06060e;
  color: #fff;
  height: 100vh;
  overflow: hidden;
}

/* Main layout */
.dt-layout {
  display: flex;
  height: calc(100vh - 120px); /* 상단 nav 60px + 하단 nav 60px */
}

/* Divider */
.dt-divider {
  width: 1px;
  background: #1a1a30;
  flex-shrink: 0;
}

/* ── Left Panel ── */
.dt-left {
  width: 580px;
  min-width: 580px;
  background: radial-gradient(ellipse 140% 140% at 50% 50%, #14093a, #06060e);
  position: relative;
  overflow: hidden;
}

.dt-left-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #7c5cfc00, #7c5cfc99, #7c5cfc00);
  z-index: 10;
  pointer-events: none;
}

/* Left Nav */
.dt-left-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 5;
}

.dt-logo {
  position: absolute;
  top: 22px;
  left: 32px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
}

.dt-live-badge {
  position: absolute;
  top: 22px;
  right: 32px;
  background: #7c5cfc26;
  border: 1px solid #7c5cfc4d;
  border-radius: 4px;
  padding: 5px 12px;
  color: #9d7fff;
  font-size: 10px;
  letter-spacing: 2px;
}

.dt-track-info {
  position: absolute;
  top: 42px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dt-track-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.dt-track-info span:last-child {
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  letter-spacing: 1px;
}

/* Star Map */
.dt-starmap {
  position: absolute;
  top: 200px; /* H1 + badges 공간 확보 */
  left: 0;
  right: 0;
  bottom: 130px;
}

.dt-map-glow {
  position: absolute;
  width: 220px;
  height: 200px;
  border-radius: 50%;
  background: #7c5cfc0f;
  filter: blur(40px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dt-bg-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dt-bstar {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  display: block;
}

.dt-orion-label {
  position: absolute;
  left: 178px;
  top: 18px;
  background: #7c5cfc26;
  border: 1px solid #7c5cfc4d;
  border-radius: 4px;
  padding: 2px 6px;
  color: #9d7fff;
  font-size: 9px;
  letter-spacing: 1px;
  z-index: 2;
}

.dt-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Stats Cards */
.dt-stats {
  position: absolute;
  bottom: 24px;
  left: 32px;
  right: 32px;
  display: flex;
  gap: 8px;
}

.dt-stat-card {
  flex: 1;
  background: #0d0d22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dt-stat-lbl {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dt-stat-val {
  font-size: 14px;
  font-weight: 700;
}

.dt-val-purple { color: #c4b0ff; }
.dt-val-gold   { color: #ffd700; font-size: 13px; }
.dt-val-green  { color: #4ade80; }
.dt-val-violet { color: #9d7fff; }

/* Constellation Info — 좌패널 최상단으로 이동 (H1이 먼저 등장) */
.dt-const-info {
  position: absolute;
  top: 64px;
  left: 32px;
  right: 32px;
  bottom: auto;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(124,92,252,0.14);
}

.dt-const-name {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -.005em;
}

.dt-const-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.52);
  margin: 0 0 8px;
}

.dt-badges {
  display: flex;
  gap: 8px;
}

.dt-badge-purple {
  background: #7c5cfc1f;
  border: 1px solid #7c5cfc40;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 11px;
  color: #c4b0ff;
}

.dt-badge-neutral {
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
}

/* ── Right Panel ── */
.dt-right {
  flex: 1;
  background: #08080f;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 252, 0.25) transparent;
}
.dt-right::-webkit-scrollbar { width: 4px; }
.dt-right::-webkit-scrollbar-track { background: transparent; }
.dt-right::-webkit-scrollbar-thumb { background: rgba(124, 92, 252, 0.25); border-radius: 2px; }

.dt-right-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #7c5cfc00, #7c5cfc66, #7c5cfc00);
  z-index: 10;
  pointer-events: none;
}

/* Right Top Bar */
.dt-right-top {
  height: 60px;
  position: relative;
  display: flex;
  align-items: center;
}

.dt-breadcrumb {
  position: absolute;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dt-bc-btn {
  background: #ffffff0d;
  border: 1px solid #ffffff14;
  border-radius: 6px;
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.dt-bc-btn:hover {
  background: #ffffff18;
  color: #c4b0ff;
}

.dt-bc-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
}

.dt-bc-current {
  color: #c4b0ff;
  font-size: 12px;
  font-weight: 600;
}

.dt-upload-btn {
  position: absolute;
  right: 32px;
  background: #7c5cfc;
  color: #fff;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.dt-upload-btn:hover {
  background: #9d80ff;
  transform: translateY(-1px);
}

/* Photo Grid */
.dt-photo-grid {
  position: relative;
  padding: 0 24px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  align-content: flex-start;
}

.dt-ph {
  flex: 0 0 calc(50% - 6px);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}

.dt-ph:hover {
  transform: scale(1.02);
}

/* 실제 사진 이미지 */
.dt-ph img.dt-ph-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 1;
  transition: transform 0.4s ease;
  z-index: 0;
}

.dt-ph:hover img.dt-ph-photo {
  transform: scale(1.06);
}

/* 하단 그라디언트 오버레이 */
.dt-ph::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(transparent, #00000075);
  border-radius: 0 0 12px 12px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
}

.dt-ph:hover::after {
  opacity: 1;
}

/* 삭제 버튼 */
.dt-ph-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #00000045;
  border: none;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 10;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}

.dt-ph:hover .dt-ph-delete {
  opacity: 1;
}

.dt-ph-delete:hover {
  background: #ff3b3b;
}

/* ── 사진 삭제 중 상태 강화 ── */
.dt-ph--deleting {
  opacity: 0.7;
  pointer-events: none;
}

/* ── 사진 추가 중 상태 ── */
.dt-ph--uploading {
  pointer-events: none;
  background: rgba(124, 92, 252, 0.08);
  border: 2px dashed rgba(124, 92, 252, 0.35);
  min-height: 160px;
}

.dt-ph-uploading-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: #a78bfa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dt-ph-uploading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(167, 139, 250, 0.25);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: dt-spin 0.8s linear infinite;
}

.dt-ph-deleting-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  border-radius: inherit;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}

.dt-ph-deleting-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 107, 107, 0.3);
  border-top-color: #ff6b6b;
  border-radius: 50%;
  animation: dt-spin 0.7s linear infinite;
}

@keyframes dt-spin {
  to { transform: rotate(360deg); }
}

/* ── 드래그 상태 ── */
.ds-holding {
  transform: scale(0.97) !important;
  box-shadow: 0 0 0 2px #7c5cfc, 0 12px 40px #7c5cfc40 !important;
  cursor: grab !important;
  transition: transform 0.18s, box-shadow 0.18s !important;
}

.ds-dragging {
  opacity: 0 !important;
  pointer-events: none !important;
}

.dt-ph1 {
  height: 300px;
  background: linear-gradient(135deg, #2a1560, #0f0a28);
  border: 1px solid #7c5cfc4d;
}
.dt-ph1:hover {
  box-shadow: 0 8px 28px #7c5cfc40;
}

.dt-ph2 {
  height: 200px;
  background: linear-gradient(200deg, #0d1a3d, #1e2d5a);
  border: 1px solid #5078ff33;
}
.dt-ph2:hover {
  box-shadow: 0 8px 24px #5078ff25;
}

.dt-ph3 {
  height: 180px;
  background: linear-gradient(45deg, #1a0d3d, #2d1569);
  border: 1px solid #7c5cfc33;
}
.dt-ph3:hover {
  box-shadow: 0 8px 24px #7c5cfc30;
}

.dt-ph4 {
  height: 320px;
  background: linear-gradient(270deg, #0a1228, #18243c);
  border: 1px solid #5078c833;
}
.dt-ph4:hover {
  box-shadow: 0 8px 24px #5078c825;
}

/* Add Photo */
.dt-add-photo {
  background: #0a0a18;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  flex: 0 0 calc(50% - 6px);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dt-add-photo:hover {
  border-color: #7c5cfc40;
  background: #0d0d20;
}

.dt-add-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 24px;
  transition: border-color 0.2s, color 0.2s;
}
.dt-add-photo:hover .dt-add-icon {
  border-color: #7c5cfc60;
  color: #7c5cfc;
}

.dt-add-title {
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
  transition: color 0.2s;
}
.dt-add-photo:hover .dt-add-title {
  color: #7c5cfc;
}

.dt-add-sub {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  text-align: center;
  max-width: 180px;
  line-height: 1.6;
}

/* ── Bottom Navigation ── */
.dt-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #09091a;
  border-top: 1px solid #1a1a30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}

.dt-bn-prev,
.dt-bn-next {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.dt-bn-prev:hover,
.dt-bn-next:hover {
  background: #ffffff08;
}

.dt-bn-arrow {
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
}

.dt-bn-lbl {
  display: block;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.dt-bn-name {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 600;
}

.dt-bn-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dt-bn-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: inline-block;
  transition: background 0.2s;
}

.dt-bn-dot.active {
  width: 6px;
  height: 6px;
  background: #7c5cfc;
}

/* ── 라이트박스 ── */
.dt-lightbox {
  position: fixed;
  inset: 0;
  background: #000000e0;
  backdrop-filter: blur(12px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.dt-lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.dt-lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 32px 80px #00000080;
  user-select: none;
}
.dt-lb-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: #ffffff80;
  font-size: 30px;
  line-height: 1;
  transition: color 0.2s;
}
.dt-lb-close:hover { color: #fff; }
.dt-lb-prev,
.dt-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff14;
  color: #fff;
  font-size: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.dt-lb-prev:hover,
.dt-lb-next:hover { background: #ffffff2a; }
.dt-lb-prev { left: 24px; }
.dt-lb-next { right: 24px; }

/* ── 모달 공통 ── */
.gl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: #00000094;
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.gl-modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.gl-modal {
  background: #0d0d22;
  border: 1px solid #2a2a48;
  border-radius: 20px;
  width: 480px;
  padding: 32px;
  position: relative;
}
.gl-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #5a5a8a;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.gl-modal-close:hover { color: #fff; }
.gl-modal-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 4px;
  color: #7c5cfc;
  margin: 0 0 6px;
}
.gl-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px;
}
.gl-modal-field { margin-bottom: 16px; }
.gl-modal-label {
  display: block;
  font-size: 11px;
  color: #5a5a8a;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.gl-modal-select {
  width: 100%;
  background: #0a0a1e;
  border: 1px solid #2a2a48;
  border-radius: 8px;
  color: #c4b0ff;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.gl-drop-zone {
  border: 1.5px dashed #2a2a48;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 16px;
}
.gl-drop-zone:hover, .gl-drop-zone.drag-over {
  border-color: #7c5cfc;
  background: #7c5cfc0a;
}
.gl-drop-icon { font-size: 28px; color: rgba(255, 255, 255, 0.35); margin-bottom: 8px; }
.gl-drop-text { color: rgba(255, 255, 255, 0.62); font-size: 13px; margin: 0 0 4px; }
.gl-drop-sub { color: rgba(255, 255, 255, 0.35); font-size: 11px; margin: 0; }
.gl-modal-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.gl-modal-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.gl-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #0000008c;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.gl-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}
.gl-modal-cancel {
  background: transparent;
  border: 1px solid #2a2a48;
  border-radius: 8px;
  color: #5a5a8a;
  padding: 10px 20px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.gl-modal-cancel:hover { border-color: #5a5a8a; color: #9090c0; }
.gl-modal-save {
  background: #7c5cfc;
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.gl-modal-save:disabled { background: #3a3a60; cursor: not-allowed; }
.gl-modal-save:not(:disabled):hover { background: #9d80ff; }

/* ── 사진 삭제 확인 모달 ── */
.dt-delete-modal { width: 360px; }
.dt-delete-thumb-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #0a0a1e;
}
.dt-delete-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.85;
}
.dt-delete-warn {
  font-size: 13px;
  color: rgba(255, 100, 100, 0.8);
  margin: 0 0 20px;
  text-align: center;
}
.dt-delete-confirm-btn {
  background: #c0392b;
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.dt-delete-confirm-btn:hover { background: #e74c3c; }

/* ── Lightbox 메타 풋터 (JS가 동적 주입) ── */
.dt-lb-meta {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  background: rgba(8, 10, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}
.dt-lb-meta__name {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 14px;
  color: #fff;
}
.dt-lb-meta__counter {
  font-family: var(--font-mono, 'Geist Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}
.dt-lb-meta__toggle {
  padding: 6px 14px;
  background: rgba(124, 92, 252, 0.15);
  border: 1px solid rgba(124, 92, 252, 0.4);
  border-radius: 999px;
  color: #c4b0ff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.dt-lb-meta__toggle:hover {
  background: rgba(124, 92, 252, 0.28);
  border-color: rgba(124, 92, 252, 0.6);
}
.dt-lb-meta__toggle[aria-pressed="true"] {
  background: #7c5cfc;
  color: #fff;
  border-color: #7c5cfc;
}
@media (max-width: 480px) {
  .dt-lb-meta {
    flex-wrap: wrap;
    max-width: calc(100vw - 32px);
    justify-content: center;
    gap: 10px;
    padding: 8px 14px;
  }
}

@media (max-width: 768px) {
  .dt-body {
    height: auto;
    overflow: auto;
  }
  .dt-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .dt-left {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 540px;
    padding-bottom: 24px;
  }
  .dt-divider {
    width: 100%;
    height: 1px;
  }
  /* 안전한 흐름을 위해 absolute 제거 + 세로 스택 */
  .dt-const-info {
    position: static;
    margin: 18px 20px 16px;
    padding-top: 8px;
  }
  .dt-starmap {
    position: relative;
    top: auto;
    bottom: auto;
    height: 320px;
    margin: 0 0 16px;
  }
  .dt-stats {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 20px;
  }
  .dt-left-nav {
    position: relative;
    height: 56px;
  }
  .dt-photo-grid {
    padding: 0 16px 24px;
  }
  .dt-right-top {
    padding: 0 16px;
  }
  .dt-bottom-nav {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .dt-stats {
    grid-template-columns: 1fr 1fr;
  }
  .dt-starmap {
    height: 260px;
  }
}
