/* Components: Toasts, Skeletons, Loaders, Modals, Status Badges */

/* ===== Status Badges ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}
.badge-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-primary { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-secondary { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }
.badge-light { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* ===== Toast Container & Notification ===== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  border-left: 5px solid #1a3a5c;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s, transform 0.3s;
}
.toast-msg.toast-hide {
  opacity: 0;
  transform: translateX(50px);
}
.toast-msg.toast-success { border-left-color: #10b981; }
.toast-msg.toast-error { border-left-color: #ef4444; }
.toast-msg.toast-warning { border-left-color: #f59e0b; }
.toast-msg.toast-info { border-left-color: #3b82f6; }
.toast-icon { font-size: 1.15rem; font-weight: bold; }
.toast-success .toast-icon { color: #10b981; }
.toast-error .toast-icon { color: #ef4444; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info .toast-icon { color: #3b82f6; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-15px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Button Loading State ===== */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}
.spinner-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Skeleton Loading UI ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  width: 100%;
}
.skeleton-title {
  height: 24px;
  margin-bottom: 12px;
  width: 60%;
}
.skeleton-card {
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.skeleton-timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.skeleton-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Modal Dialog ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: #ffffff;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f2a44;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.modal-body {
  padding: 24px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
}
.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
