/* Erato.dev 테마 컬러 및 폰트 시스템 구성 */
body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
  background-color: #0b0b0e; 
  background-image: radial-gradient(circle at 50% 0%, #171226 0%, #0b0b0e 80%);
  color: #f8fafc; 
  padding: 40px 24px; 
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Erato.dev 메인 로고 영역 인테리어 */
.header-logo-bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-icon-box {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #60a5fa 0%, #7c3aed 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}
.ghost-svg { width: 18px; height: 18px; color: #ffffff; }
.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}
.logo-dot { color: #60a5fa; }
.logo-link:hover .logo-text { color: #bfdbfe; }
.page-indicator {
  font-size: 14px;
  color: #64748b;
  margin-left: 8px;
  font-weight: 500;
}

/* 💡 대시보드 카드 제어 바 랙 (레이어 순위 최상위 보장 및 간섭 차단) */
.upload-section { 
  position: relative; 
  z-index: 9999 !important; /* 그 어떠한 레이어도 이 영역을 침범하지 못하도록 강제 격리 */
  margin-bottom: 24px; 
  width: 100%; 
  max-width: 1000px; 
  display: flex; 
  flex-direction: column; 
  gap: 10px; 
}
.form-group { display: flex; gap: 10px; width: 100%; position: relative; z-index: 10000; }

/* 입력 필드 디자인 */
.upload-section input {
  background: rgba(30, 27, 46, 0.4);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 6px; 
  padding: 12px 16px; 
  color: #ffffff; 
  font-size: 13px; 
  outline: none; 
  transition: all 0.2s ease;
  position: relative;
  z-index: 10001;
}
#input-filename { flex-grow: 2; }
#input-title { flex-grow: 1; }
.upload-section input:focus { 
  border-color: #7c3aed; 
  background: rgba(30, 27, 46, 0.7);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.2); 
}

/* 버튼 세트 스타일 */
.upload-btn, .share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-weight: 600; white-space: nowrap; transition: all 0.2s ease; box-sizing: border-box;
  position: relative;
  z-index: 10002;
}
.upload-btn { 
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(96, 165, 250, 0.1) 100%);
  color: #a78bfa; 
  border: 1px solid rgba(124, 58, 237, 0.4); 
}
.upload-btn:hover { 
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3) 0%, rgba(96, 165, 250, 0.2) 100%);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.3);
  color: #ffffff;
}
.share-btn { 
  background: #7c3aed; 
  color: #ffffff; 
  border: none; 
  width: 100%; 
  font-size: 13px; 
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); 
}
.share-btn:hover { background: #6d28d9; box-shadow: 0 4px 18px rgba(124, 58, 237, 0.5); }

/* 메인 구도 블록 */
.main-container { display: flex; gap: 20px; width: 100%; max-width: 1000px; position: relative; z-index: 1; }

/* 16:9 비율 유지 비디오 디스플레이 */
.video-container { 
  position: relative; width: 70%; aspect-ratio: 16 / 9; background: #000000; 
  border-radius: 8px; overflow: hidden; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5); 
  border: 1px solid rgba(255, 255, 255, 0.04); display: flex; align-items: center; justify-content: center; 
}
.video { width: 100%; height: 100%; object-fit: contain; }
#speed-badge { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.7); color: #a78bfa; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: bold; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 6; }

/* 고급 아크릴 룩 컨트롤 패널 */
.controls { 
  position: absolute; bottom: 0; left: 0; right: 0; 
  background: rgba(15, 12, 26, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); 
  border-top: 1px solid rgba(124, 58, 237, 0.2); opacity: 0; transition: opacity 0.2s ease; 
  padding: 14px 16px; z-index: 2147483647; 
}
.video-container:hover .controls { opacity: 1; }
.video-container:fullscreen .controls { bottom: 0; padding: 20px; }
.progress-bar { width: 100%; cursor: pointer; margin-bottom: 10px; accent-color: #7c3aed; height: 4px; background: #1e1b2e; }
.buttons { display: flex; align-items: center; gap: 18px; color: #ffffff; width: 100%; }
.buttons button { background: none; border: none; color: #a78bfa; font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: all 0.15s; }
.buttons button:hover { background: rgba(124, 58, 237, 0.15); text-shadow: 0 0 5px #a78bfa; }
.time-display { font-size: 12px; color: #94a3b8; font-family: monospace; }
.volume-bar { width: 70px; accent-color: #7c3aed; height: 4px; cursor: pointer; }

/* 우측 대시보드 카드 레이어 재생 목록 */
.playlist-container { 
  width: 30%; 
  background: rgba(18, 16, 28, 0.6); 
  backdrop-filter: blur(12px); 
  padding: 20px; border-radius: 8px; 
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4); 
  border: 1px solid rgba(124, 58, 237, 0.12); 
  display: flex; flex-direction: column; box-sizing: border-box; 
}
.playlist-header { display: flex; align-items: center; gap: 8px; color: #7c3aed; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 12px; margin-bottom: 6px; }
.playlist-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: #e2e8f0; letter-spacing: 0.5px; }
#playlist { list-style: none; padding: 0; margin: 0; flex-grow: 1; overflow-y: auto; }

/* 💡 리스트 배치 및 개별 엑스 버튼 인터페이스 (간섭 버그 해결) */
#playlist li { 
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px 12px 12px !important; /* 우측에 정렬된 X버튼 영역을 위해 여백 격리 */
  border-radius: 6px; 
  margin-top: 6px; 
  cursor: pointer; 
  font-size: 13px; 
  color: #94a3b8; 
  background: rgba(255, 255, 255, 0.01); 
  border-left: 3px solid rgba(124, 58, 237, 0.2); 
  transition: all 0.2s ease; 
  box-sizing: border-box;
}
#playlist li:hover { background: rgba(124, 58, 237, 0.06); color: #ffffff; border-left-color: #a78bfa; }
#playlist li.active { background: rgba(124, 58, 237, 0.12); color: #a78bfa; border-left-color: #7c3aed; font-weight: bold; }
#playlist::-webkit-scrollbar { width: 4px; }
#playlist::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.3); border-radius: 2px; }

.list-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
  pointer-events: none; /* 텍스트 긁힘으로 인한 버튼 마스킹 현상 해결 */
}

.item-del-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  color: #64748b !important; 
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px !important;
  border-radius: 4px;
  opacity: 0; 
  transition: all 0.15s ease;
  z-index: 50; /* 리스트 클릭보다 우선순위 부여 */
}
#playlist li:hover .item-del-btn { opacity: 1; }
.item-del-btn:hover {
  background: rgba(239, 83, 80, 0.15) !important; 
  color: #ef5350 !important;
  box-shadow: 0 0 8px rgba(239, 83, 80, 0.2);
}
.item-del-btn svg { pointer-events: none; }
/* --- 💡 로딩 스피너 애니메이션 디자인 팩 --- */
.spinner-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4); /* 화면을 살짝 어둡게 마스킹 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0; /* 평소에는 완전히 보이지 않음 */
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* 스피너가 활성화되었을 때 작동할 클래스 */
.spinner-overlay.show {
  opacity: 1;
}

/* 둥근 도넛 형태의 네온 퍼플 스피너 뼈대 */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(124, 58, 237, 0.2); /* 은은한 바탕 원 */
  border-top: 4px solid #7c3aed; /* 회전할 포인트 컬러 */
  border-radius: 50%;
  animation: spin 0.8s linear infinite; /* 무한 회전 애니메이션 */
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

/* 360도 회전 키프레임 설정 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* --- 💡 로딩 스피너 애니메이션 디자인 팩 --- */
.spinner-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4); /* 화면을 살짝 어둡게 마스킹 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0; /* 평소에는 완전히 보이지 않음 */
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* 스피너가 활성화되었을 때 작동할 클래스 */
.spinner-overlay.show {
  opacity: 1;
}

/* 둥근 도넛 형태의 네온 퍼플 스피너 뼈대 */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(124, 58, 237, 0.2); /* 은은한 바탕 원 */
  border-top: 4px solid #7c3aed; /* 회전할 포인트 컬러 */
  border-radius: 50%;
  animation: spin 0.8s linear infinite; /* 무한 회전 애니메이션 */
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

/* 360도 회전 키프레임 설정 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
