/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: modalSlideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #868e96;
  font-size: 24px;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: #f1f3f5;
  color: #1a1a1a;
}

.modal-body {
  padding: 32px;
  overflow-y: auto;
  line-height: 1.8;
  font-size: 15px;
  color: #333;
}

.modal-body h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.modal-body h2 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 12px;
  color: #1a1a1a;
}

.modal-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.modal-body p {
  margin-bottom: 12px;
}

.modal-body ol,
.modal-body ul {
  padding-left: 24px;
  margin-bottom: 12px;
}

.modal-body ol {
  list-style: decimal;
}

.modal-body ul {
  list-style: disc;
}

.modal-body li {
  margin-bottom: 6px;
}

.modal-body strong {
  font-weight: 600;
}

.modal-body hr {
  border: none;
  border-top: 1px solid #e9ecef;
  margin: 24px 0;
}

.modal-body blockquote {
  background: #f8f9fa;
  border-left: 3px solid #336B97;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: #495057;
}

.modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.modal-body th,
.modal-body td {
  border: 1px solid #dee2e6;
  padding: 10px 12px;
  text-align: left;
}

.modal-body th {
  background: #f8f9fa;
  font-weight: 600;
}

.modal-body a {
  color: #336B97;
  text-decoration: underline;
}

/* 스크롤바 스타일 */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* body 스크롤 잠금 */
body.modal-open {
  overflow: hidden;
}

/* 반응형 */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 16px;
  }

  .modal {
    max-height: 90vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 20px 24px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-body {
    padding: 24px;
    font-size: 14px;
  }
}
