/* Offline Icon & UI Runtime Styles (Zero External Network Dependencies) */
.fa,
.fa-solid,
.fa-regular {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.125em;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  flex-shrink: 0;
}

.fa-icon-svg {
  width: 1em;
  height: 1em;
  min-width: 1em;
  min-height: 1em;
  display: inline-block;
  vertical-align: middle;
  pointer-events: none;
}

.fa-spin {
  animation: offlineFaSpin 1s linear infinite;
}

@keyframes offlineFaSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Offline SweetAlert2-Compatible Modal & Toast Styling */
.swal2-container {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(2px);
  font-family: inherit;
}

.swal2-container.swal2-top-end {
  top: 18px !important;
  right: 18px !important;
  bottom: auto !important;
  left: auto !important;
  inset: 18px 18px auto auto !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.swal2-container.swal2-closing {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.swal2-popup {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  padding: 24px 22px 20px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
  border: 1px solid #e2e8f0;
  text-align: center;
  animation: swalOfflinePop 0.18s ease-out;
}

body.dark-mode .swal2-popup {
  background: #111827;
  color: #f8fafc;
  border-color: #334155;
}

.swal2-toast {
  width: auto;
  min-width: 340px;
  max-width: 480px;
  padding: 16px 22px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.34), 0 0 0 1px rgba(37, 99, 235, 0.2);
}

@keyframes swalOfflinePop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.swal2-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.swal2-toast .swal2-icon {
  width: 24px;
  height: 24px;
  margin: 0;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.swal2-icon-success {
  background: #dcfce7;
  color: #15803d;
  border: 2px solid #86efac;
}

.swal2-icon-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 2px solid #fca5a5;
}

.swal2-icon-warning {
  background: #fef3c7;
  color: #b45309;
  border: 2px solid #fcd34d;
}

.swal2-icon-info,
.swal2-icon-question {
  background: #dbeafe;
  color: #1d4ed8;
  border: 2px solid #93c5fd;
}

.swal2-title {
  margin: 0 0 6px;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
}

.swal2-toast .swal2-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.swal2-html-container {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #475569;
}

body.dark-mode .swal2-html-container {
  color: #cbd5e1;
}

.swal2-input,
.swal2-select,
.swal2-textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}

body.dark-mode .swal2-input,
body.dark-mode .swal2-select,
body.dark-mode .swal2-textarea {
  background: #1e293b;
  color: #f8fafc;
  border-color: #475569;
}

.swal2-radio-group {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.swal2-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.swal2-validation-message {
  display: none;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
}

.swal2-validation-message.is-visible {
  display: block;
}

.swal2-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.swal2-confirm,
.swal2-cancel {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.swal2-confirm {
  background: var(--app-accent, #2563eb);
  color: #ffffff;
}

.swal2-cancel {
  background: #e2e8f0;
  color: #1e293b;
}

body.dark-mode .swal2-cancel {
  background: #334155;
  color: #f1f5f9;
}

.swal2-confirm:hover,
.swal2-cancel:hover {
  opacity: 0.92;
}
