/* =============================================
   납입확인서 팝업 스타일
   - 기간선택 팝업 (첫 번째 단계)
   - 결과 테이블 팝업 (두 번째 단계)
============================================= */

/* ========== 기간선택 팝업 ========== */

/* 오버레이 */
.payment-certificate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.payment-certificate-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 모달 */
.payment-certificate-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.payment-certificate-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 컨테이너 */
.payment-certificate-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

/* 헤더 */
.payment-certificate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  border-bottom: 1px solid #2980b9;
}

.payment-certificate-header .popup-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.payment-certificate-header .popup-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.payment-certificate-header .popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 바디 */
.payment-certificate-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* 회원 정보 섹션 */
.member-info-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.member-info-section .info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.member-info-section .info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-info-section .info-item label {
  font-size: 13px;
  font-weight: 600;
  color: #495057;
}

.member-info-section .info-item .info-value {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 500;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

/* 기간 선택 섹션 */
.date-range-section {
  margin-bottom: 16px;
}

.date-range-section .form-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;
}

.date-range-section .form-label {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range-inputs .form-input-date {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 14px;
  color: #2c3e50;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.date-range-inputs .form-input-date:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.date-range-inputs .date-separator {
  color: #6c757d;
  font-weight: 500;
}

/* 푸터 */
.payment-certificate-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.payment-certificate-footer .btn-popup-cancel,
.payment-certificate-footer .btn-popup-save {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-certificate-footer .btn-popup-cancel {
  background: #ffffff;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.payment-certificate-footer .btn-popup-cancel:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.payment-certificate-footer .btn-popup-save {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.payment-certificate-footer .btn-popup-save:hover {
  background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* ========== 결과 테이블 팝업 ========== */

/* 오버레이 */
.payment-certificate-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.payment-certificate-result-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 모달 */
.payment-certificate-result-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 900px;
  max-width: 95%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.payment-certificate-result-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 컨테이너 */
.payment-certificate-result-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

/* 헤더 */
.payment-certificate-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.payment-certificate-result-header .result-tabs {
  display: flex;
  gap: 8px;
}

.payment-certificate-result-header .result-tab {
  padding: 8px 16px;
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  cursor: default;
  transition: all 0.2s;
}

.payment-certificate-result-header .result-tab.active {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #ffffff;
  border-color: #2980b9;
}

.payment-certificate-result-header .payment-certificate-result-close {
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.payment-certificate-result-header .payment-certificate-result-close:hover {
  background: #e9ecef;
  color: #495057;
}

/* 바디 */
.payment-certificate-result-body {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: #ffffff;
}

/* 납입확인서 문서 스타일 */
.certificate-document {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
}

/* 제목 */
.certificate-title {
  text-align: center;
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 20px;
  margin-bottom: 40px;
  padding-left: 20px;
  color: #000000;
}

/* 섹션 */
.certificate-section {
  margin-bottom: 25px;
}

.certificate-section .section-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #000000;
}

/* 테이블 공통 스타일 */
.certificate-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000000;
  margin-bottom: 0;
}

.certificate-table th,
.certificate-table td {
  border: 1px solid #000000;
  padding: 10px 12px;
  font-size: 13px;
  color: #000000;
}

.certificate-table th {
  background-color: #f0f0f0;
  font-weight: bold;
  text-align: center;
}

.certificate-table td {
  text-align: left;
}

.certificate-table td.text-center {
  text-align: center;
}

.certificate-table td.text-right {
  text-align: right;
}

/* 신청인 테이블 */
.applicant-table .label-cell {
  width: 120px;
  background-color: #f0f0f0;
  font-weight: bold;
  text-align: center;
}

/* 발행인 테이블 */
.issuer-table th {
  width: 150px;
  background-color: #f0f0f0;
}

/* 납입기간 테이블 */
.period-table th {
  width: 180px;
  background-color: #f0f0f0;
}

.period-table .amount-cell {
  text-align: right;
}

/* 납입세부내역 */
.detail-section {
  margin-top: 30px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.detail-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  flex: 1;
  color: #000000;
}

.detail-unit {
  text-align: right;
  font-size: 12px;
  color: #000000;
}

.detail-table {
  margin-bottom: 15px;
}

.detail-table th {
  background-color: #f0f0f0;
  text-align: center;
  padding: 10px 8px;
}

.detail-table td {
  padding: 10px 8px;
}

/* 푸터 */
.certificate-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
  color: #000000;
}

.certificate-footer .footer-text {
  margin-bottom: 20px;
}

.certificate-footer .footer-date {
  margin-bottom: 30px;
}

.certificate-footer .footer-company {
  text-align: right;
  font-size: 13px;
}

/* 결과 팝업 푸터 */
.payment-certificate-result-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.payment-certificate-result-footer .btn-popup-print {
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.payment-certificate-result-footer .btn-popup-print:hover {
  background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
  transform: translateY(-1px);
}

.payment-certificate-result-footer .btn-popup-print i {
  font-size: 14px;
}

.payment-certificate-result-footer .btn-popup-close {
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  background: #ffffff;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-certificate-result-footer .btn-popup-close:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

/* 반응형 */
@media (max-width: 768px) {
  .payment-certificate-modal {
    width: 95%;
    max-height: 85vh;
  }

  .payment-certificate-result-modal {
    width: 95%;
    max-height: 85vh;
  }

  .member-info-section .info-row {
    grid-template-columns: 1fr;
  }

  .date-range-section .form-row {
    grid-template-columns: 1fr;
  }

  .date-range-inputs {
    flex-direction: column;
    gap: 12px;
  }

  .date-range-inputs .date-separator {
    display: none;
  }

  .result-info-section {
    flex-direction: column;
    gap: 12px;
  }

  .print-btn-container {
    margin-left: 0;
  }

  .result-table {
    font-size: 12px;
  }

  .result-table thead th,
  .result-table tbody td,
  .result-table tfoot td {
    padding: 8px 10px;
  }
}
