/* 팝업 오버레이 */
.ksla-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 팝업 컨테이너 */
.ksla-popup-container {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.3s ease;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

/* 팝업 내용 */
.ksla-popup-content {
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  position: relative;
  /* 높이는 JavaScript에서 인라인 스타일로 설정됨 (footer 60px 제외한 크기) */
}

.ksla-popup-image-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  background: transparent;
}

.ksla-popup-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
}

/* 팝업 푸터 */
.ksla-popup-footer {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e0e0e0;
  background: #f9f9f9;
  flex-shrink: 0;
}

.ksla-popup-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  user-select: none;
}

.ksla-popup-checkbox {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ksla-popup-checkbox-label span {
  line-height: 1.5;
}

.ksla-popup-close-btn {
  padding: 8px 20px;
  background-color: #2271b1;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ksla-popup-close-btn:hover {
  background-color: #135e96;
}

.ksla-popup-close-btn:active {
  background-color: #0a4b78;
}

/* 반응형 */
@media screen and (max-width: 768px) {
  .ksla-popup-container {
    max-width: 90vw !important;
    max-height: 90vh !important;
  }

  .ksla-popup-content {
    width: 100% !important;
    flex: 1 1 auto;
    min-height: 0;
  }

  .ksla-popup-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
  }

  .ksla-popup-footer {
    height: auto;
    min-height: 60px;
    padding: 15px;
    gap: 15px;
    align-items: stretch;
    flex-wrap: wrap;
    flex-shrink: 0;
  }

  .ksla-popup-footer .ksla-popup-checkbox-label {
    font-size: 13px;
  }

  .ksla-popup-footer .ksla-popup-close-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}
