/**
 * Maintenance Mode Floating Modal
 * File: assets/css/maintenance-modal.css
 */

body.maintenance-lock {
  overflow: hidden !important;
}

.maintenance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background-color: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: maintenanceFadeIn 0.3s ease-out forwards;
}

.maintenance-modal-card {
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
  border: 1.5px solid #fde68a;
  border-radius: 20px;
  max-width: 620px;
  width: 100%;
  padding: 32px 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 158, 11, 0.2);
  text-align: left;
  animation: maintenanceScaleUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
}

.maintenance-header-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.maintenance-icon-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 16px -2px rgba(217, 119, 6, 0.35);
}

.maintenance-title-group {
  flex-grow: 1;
}

.maintenance-badge-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.maintenance-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: #92400e;
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.3;
}

.maintenance-status-pill {
  background: #ffffff;
  color: #b45309;
  border: 1px solid #f59e0b;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.maintenance-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #f59e0b;
  border-radius: 50%;
  display: inline-block;
  animation: maintenancePulse 1.8s infinite ease-in-out;
}

.maintenance-thai-text {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #b45309;
  font-weight: 500;
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

.maintenance-en-box {
  background: #ffffff;
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 22px;
}

.maintenance-en-text {
  margin: 0;
  font-size: 13.5px;
  color: #78350f;
  line-height: 1.5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.maintenance-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #fef3c7;
  padding-top: 18px;
}

.maintenance-btn-refresh {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-family: 'Prompt', sans-serif;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
  transition: all 0.2s ease;
}

.maintenance-btn-refresh:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.35);
  color: #ffffff;
}

.maintenance-btn-refresh:active {
  transform: translateY(0);
}

.maintenance-btn-refresh:disabled,
.maintenance-btn-refresh.is-cooldown {
  background: #e2e8f0 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
  opacity: 0.9;
}

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

@keyframes maintenanceScaleUp {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes maintenancePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.6;
  }
}

@media (max-width: 767px) {
  .maintenance-modal-card {
    padding: 24px 20px;
  }
  .maintenance-header-row {
    flex-direction: column;
    gap: 14px;
  }
  .maintenance-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .maintenance-title {
    font-size: 18px;
  }
  .maintenance-actions {
    justify-content: stretch;
  }
  .maintenance-btn-refresh {
    width: 100%;
    justify-content: center;
  }
}

/* Ensure SweetAlert2 modal sits cleanly above the maintenance overlay and backdrop */
.swal2-container,
.swal2-container.swal2-high-priority {
  z-index: 10000000 !important;
}


