/* css/popup.css */

/* 팝업 창 (다크 테마) */
.popup {
  position: fixed;
  top: 20px;
  right: 95px;
  bottom: auto;
  width: 360px;
  background: #2a2a2a;
  color: #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  border: 1px solid #444;
  overflow: hidden;
  display: none; /* JS로 아이콘 클릭 시 보이도록 초기 숨김 */
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: linear-gradient(145deg, #3c3c3c, #252525);
  color: #ffffff;
  cursor: move;
  border-bottom: 1px solid #444;
}

.popup-header span {
  font-weight: bold;
  font-size: 0.9rem;
}

.popup-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

/* 입력 필드 (다크 테마) */
.popup-body textarea,
.popup-body input[type="text"] {
  padding: 12px;
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

.popup-body textarea::placeholder,
.popup-body input[type="text"]::placeholder {
  color: #888;
}

.popup-body textarea:focus,
.popup-body input[type="text"]:focus {
  outline: none;
  border-color: #777;
  box-shadow: 0 0 0 2px rgba(100, 100, 100, 0.3);
}


/* 안내 문구 (다크 테마) */
.popup-body .note {
  color: #ffcc80;
  font-weight: normal;
  text-align: center;
  font-size: 0.8rem;
  word-break: keep-all;
  line-height: 1.4;
  background-color: rgba(255, 204, 128, 0.1);
  padding: 8px;
  border-radius: 4px;
}

/* 버튼 (다크 테마) */
.purple-button {
  padding: 12px;
  background: linear-gradient(145deg, #5a5a5a, #3a3a3a);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.purple-button:hover {
  background: linear-gradient(145deg, #6a6a6a, #4a4a4a);
}

.purple-button:active {
  transform: translateY(1px);
}

/* 이미지 표시 영역 (다크 테마) */
.image-window {
  position: relative;
  width: 100%;
  height: 200px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.status-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  color: #aaa;
  text-align: center;
  padding: 0 10px;
}

/* 스피너 (다크 테마) */
.spinner {
  width: 35px;
  height: 35px;
  border: 4px solid #555;
  border-top: 4px solid #aaa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.image-window img {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
}

/* 최소화 상태 */
.popup.minimized {
  height: auto;
  top: 20px;
  right: 95px;
  bottom: auto;
}

.popup.minimized .popup-body {
  display: none;
}

/* 구분선 (다크 테마) */
.popup-divider {
  border: 0;
  border-top: 1px solid #555;
  margin: 15px 0;
}

/* 하단 텍스트 (다크 테마) */
.footer {
  font-size: 0.75rem;
  text-align: center;
  color: #888;
}

/* 라이트박스 스타일 (다크 테마) */
.lightbox {
  /* *** 중요: 초기 상태는 숨김 *** */
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1002;
  /* display: flex; */ /* JS에서 클릭 시 flex로 변경 */
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  cursor: pointer;
}

#lightboxImage {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  cursor: default;
}

#lightboxClose {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 35px;
  color: #ccc;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.2s;
  line-height: 1;
}
#lightboxClose:hover {
  color: #fff;
}


/* 반응형 (다크 테마) */
@media (max-width: 480px) {
  .popup {
    width: calc(100% - 20px);
    right: 10px;
    top: auto;
    bottom: 10px;
    max-height: 80vh;
  }
  .popup-body {
     max-height: calc(70vh - 100px);
  }
  .popup.minimized {
     bottom: 10px;
     top: auto;
     right: 10px;
  }
  #lightboxClose {
    top: 15px;
    right: 15px;
    font-size: 30px;
  }
}
