@charset "UTF-8";

/* ===========================
   Overlay
=========================== */
.ch-modal {
  position: fixed;
  inset: 0;
  display: flex;
  min-width: 200px;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  pointer-events: auto;
  animation: fade-bg 0.25s ease;
}

/* ===========================
   Modal Container
=========================== */
.ch-modal-content {
  position: relative;
  z-index: 1010;
  background: #fff;
  border-radius: 8px;
  min-width: 200px;
  max-width: 92%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
  animation: fade-in 0.25s ease;
}

/* ===========================
   Header
=========================== */
.ch-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #005bac;
  color: #fff;
  padding: 10px 14px;
  user-select: none;
}

.ch-modal-title {
  font-weight: bold;
  font-size: 16px;
}

.ch-modal-close {
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.ch-modal-close:hover {
  opacity: 1;
}

/* ===========================
   Body
=========================== */
.ch-modal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-size: 15px;
  color: #222;
  line-height: 1.5;
}

/* ===========================
   Footer
=========================== */
.ch-modal-footer {
  padding: 10px 15px 15px;
  background: #f7f7f7;
  border-top: 1px solid #ddd;
}

.modal-btn-area {
  text-align: center;
  margin-top: 6px;
}

#modal-result {
  text-align: left;
  font-size: 14px;
  min-height: 22px;
  color: #b00020;
  font-weight: bold;
}

/* ===========================
   Buttons
=========================== */
.ch-modal-btn {
  margin: 4px 6px 0;
  padding: 7px 15px;
  border: none;
  border-radius: 4px;
  background: #0c4ca4;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.05s ease;
  pointer-events: auto;
}

.ch-modal-btn:hover:not(.disabled):not(:disabled) {
  background: #0d56c0;
}

.ch-modal-btn:active:not(.disabled):not(:disabled) {
  transform: scale(0.97);
}

.ch-modal-btn.disabled,
.ch-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #7a97c9;
}

.ch-modal-btn.cancel, .ch-modal-btn.del {
  background: #888;
}
.ch-modal-btn.cancel:hover:not(.disabled):not(:disabled), .ch-modal-btn.del:hover:not(.disabled):not(:disabled)  {
  background: #666;
}

/* ===========================
   Scrollbar (minimal)
=========================== */
.ch-modal-body::-webkit-scrollbar {
  width: 7px;
}
.ch-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

/* ===========================
   Animations
=========================== */
@keyframes fade-bg {
  from { background: rgba(0,0,0,0); }
  to { background: rgba(0,0,0,0.45); }
}

@keyframes fade-in {
  from { transform: translateY(-15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 480px) {
  .ch-modal-content {
    width: 90%;
    border-radius: 10px;
  }
  .ch-modal-title {
    font-size: 15px;
  }
  .ch-modal-body {
    padding: 16px;
    font-size: 14px;
  }
  .ch-modal-btn {
    font-size: 14px;
    padding: 6px 12px;
  }
}
