/* === css_msg.css === */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
               Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: #f9f9f9;
  margin: 0;
}

/* === Force consistent font for all modal elements === */
#approvePopup, 
#rejectPopup, 
#rejectNoReasonPopup, 
.modal-green, 
.modal-red, 
.modal-blue, 
.modal-box, 
.modal-frame,
.modal-frame * {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
               Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
  font-weight: 500;
}

/* === Body scroll lock === */
body.modal-active {
  overflow: hidden;
}

/* === MODAL OVERLAY (NEW - recommended) === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-direct {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999999;
  display: none;
}

.modal-direct.active {
  display: block;
}

/* === MODAL BOX (Reusable style) === */
.modal-box {
  background: #fff;
  padding: 28px 32px;
  border-radius: 10px;
  text-align: center;
  width: 360px;
  max-width: 90%;
  min-width: 320px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18), 
            0 2px 6px rgba(0,0,0,0.08),
            0 0 0 1px rgba(0,0,0,0.03);
  border: 2px solid var(--modal-color, #1E90FF);
  /*animation: slideIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);*/
  animation: fadeIn 0.2s ease;
  /*animation: slideIn 0.2s ease;*/
}

.modal-box h2 {
  color: var(--modal-color, #1E90FF);
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
}

.modal-box p {
  font-size: 14px;
  color: #444;
  margin-bottom: 20px;
}

.modal-box h3 {
  letter-spacing: 0.3px;
}

.modal-box p {
  color: #555;
}

/* === Default buttons inside modal === */
.modal-box a,
.modal-box button {
  display: inline-block;
  padding: 8px 18px;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
}

/* === Input fields === */
.modal-box input[type="text"],
.modal-box input[type="password"],
.modal-box input[type="email"],
.modal-box textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* === EXISTING POPUP (KEEP COMPATIBLE) === */
#approvePopup,
#rejectPopup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.3);
  width: 360px;
  max-width: 90%;
  z-index: 999999;
  text-align: center;
  border: 2px solid var(--modal-color, #1E90FF);
}

#approvePopup h3,
#rejectPopup h3 {
  margin-bottom: 16px;
}

#rejectPopup textarea {
  width: 100%;
  height: 80px;
  margin-bottom: 12px;
  font-size: 14px;
  padding: 8px;
  resize: none;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.popup-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.popup-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* === COLOR THEMES === */
.modal-green { --modal-color: #00B482; }
.modal-red   { --modal-color: #dc3545; }
.modal-blue  { --modal-color: #1E90FF; }
.modal-orange { --modal-color: #ff9800; }

/* === BUTTON STYLE === */
.modal-button {
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  min-width: 140px;
  min-height: 36px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* === YES BUTTON === */
.modal-btn-yes {
  background: linear-gradient(135deg, #00B482, #00A472);
  box-shadow: 0 2px 6px rgba(0,180,130,0.25);
  color: #fff;
}

/* === NO / CLOSE BUTTON === */
.modal-btn-no {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  box-shadow: 0 2px 6px rgba(108,117,125,0.25);
  color: #fff;
}

.modal-btn-reject {
  background: linear-gradient(135deg, #dc3545, #c82333);
  box-shadow: 0 2px 6px rgba(220,53,69,0.25);
  color: #fff;
}

.modal-btn-info {
  background: linear-gradient(135deg, #1E90FF, #007BFF);
  box-shadow: 0 2px 6px rgba(30,144,255,0.25);
  color: #fff;
}

/* === HOVER === */
.modal-btn-yes:hover {
  background: linear-gradient(135deg, #00C896, #00B482);
  transform: translateY(-1px);
}

.modal-btn-no:hover {
  background: linear-gradient(135deg, #7d868d, #6c757d);
  transform: translateY(-1px);
}

.modal-btn-reject:hover {
  background: linear-gradient(135deg, #e04b59, #dc3545);
  transform: translateY(-1px);
}

.modal-btn-info:hover {
  background: linear-gradient(135deg, #2ea3ff, #1E90FF);
  transform: translateY(-1px);
}

/* === ACTIVE === */
.modal-button:active {
  transform: scale(0.97);
}

/* === IFRAME MODAL (KEEP) === */
.modal-frame {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  z-index: 999999;
}

.modal-frame .modal-content {
  background: #fff;
  border-radius: 8px;
  width: 700px;
  max-width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-frame .modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

/* === ANIMATION === */
@keyframes slideIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}