/* EHR-Africa notification system — Phase 1 */

:root {
  --ehr-notify-green: #008753;
  --ehr-notify-green-dark: #006b42;
  --ehr-notify-blue: #4169e1;
  --ehr-notify-coral: #ff7f50;
  --ehr-notify-charcoal: #36454f;
  --ehr-notify-ivory: #fffff0;
  --ehr-notify-danger: #b42318;
  --ehr-notify-danger-bg: #fef3f2;
  --ehr-notify-warning: #b54708;
  --ehr-notify-warning-bg: #fffaeb;
  --ehr-notify-success-bg: #ecfdf3;
  --ehr-notify-info-bg: #eff8ff;
}

.ehr-notify-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100050;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.ehr-notify-toast {
  pointer-events: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(54, 69, 79, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(54, 69, 79, 0.08);
  overflow: hidden;
  animation: ehrNotifySlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ehr-notify-toast.ehr-notify-exit {
  animation: ehrNotifySlideOut 0.28s ease forwards;
}

.ehr-notify-toast-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
}

.ehr-notify-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.ehr-notify-body {
  flex: 1;
  min-width: 0;
}

.ehr-notify-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ehr-notify-charcoal);
  margin: 0 0 4px;
  line-height: 1.3;
}

.ehr-notify-message {
  font-size: 13px;
  color: #5c6670;
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.ehr-notify-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #9aa3ab;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.ehr-notify-close:hover {
  background: rgba(54, 69, 79, 0.08);
  color: var(--ehr-notify-charcoal);
}

.ehr-notify-progress {
  height: 3px;
  background: rgba(0, 0, 0, 0.06);
  transform-origin: left;
}

.ehr-notify-toast[data-type="success"] .ehr-notify-icon {
  background: var(--ehr-notify-success-bg);
  color: var(--ehr-notify-green);
}

.ehr-notify-toast[data-type="success"] .ehr-notify-progress {
  background: linear-gradient(90deg, var(--ehr-notify-green), var(--ehr-notify-green-dark));
}

.ehr-notify-toast[data-type="error"] .ehr-notify-icon {
  background: var(--ehr-notify-danger-bg);
  color: var(--ehr-notify-danger);
}

.ehr-notify-toast[data-type="error"] .ehr-notify-progress {
  background: linear-gradient(90deg, #f04438, var(--ehr-notify-danger));
}

.ehr-notify-toast[data-type="warning"] .ehr-notify-icon {
  background: var(--ehr-notify-warning-bg);
  color: var(--ehr-notify-warning);
}

.ehr-notify-toast[data-type="warning"] .ehr-notify-progress {
  background: linear-gradient(90deg, #f79009, var(--ehr-notify-warning));
}

.ehr-notify-toast[data-type="info"] .ehr-notify-icon {
  background: var(--ehr-notify-info-bg);
  color: var(--ehr-notify-blue);
}

.ehr-notify-toast[data-type="info"] .ehr-notify-progress {
  background: linear-gradient(90deg, var(--ehr-notify-blue), #2e5bcc);
}

/* Inline banner (e.g. lab dashboard load errors) */
.ehr-notify-banner {
  display: none;
  margin-bottom: 24px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #fecdca;
  background: var(--ehr-notify-danger-bg);
  color: var(--ehr-notify-danger);
  font-weight: 600;
  line-height: 1.5;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(180, 35, 24, 0.08);
}

.ehr-notify-banner.visible {
  display: block;
}

.ehr-notify-banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

/* Confirm modal */
.ehr-notify-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 28, 36, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: ehrNotifyFadeIn 0.2s ease;
}

.ehr-notify-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: ehrNotifyModalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.ehr-notify-modal-header {
  padding: 22px 24px 0;
}

.ehr-notify-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ehr-notify-charcoal);
}

.ehr-notify-modal-body {
  padding: 12px 24px 24px;
  font-size: 14px;
  line-height: 1.6;
  color: #5c6670;
  white-space: pre-wrap;
}

.ehr-notify-prompt-message {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.ehr-notify-prompt-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 11px 14px;
  border: 1px solid rgba(54, 69, 79, 0.22);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ehr-notify-charcoal);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ehr-notify-prompt-input:focus {
  border-color: var(--ehr-notify-green);
  box-shadow: 0 0 0 3px rgba(0, 135, 83, 0.18);
}

.ehr-notify-prompt-input.ehr-notify-prompt-invalid {
  border-color: var(--ehr-notify-danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15);
}

.ehr-notify-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 0 24px 24px;
}

.ehr-notify-btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.ehr-notify-btn:active {
  transform: scale(0.98);
}

.ehr-notify-btn-cancel {
  background: #f0f2f5;
  color: var(--ehr-notify-charcoal);
}

.ehr-notify-btn-cancel:hover {
  background: #e4e8ec;
}

.ehr-notify-btn-confirm {
  background: linear-gradient(135deg, var(--ehr-notify-green), var(--ehr-notify-green-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 135, 83, 0.35);
}

.ehr-notify-btn-confirm:hover {
  box-shadow: 0 6px 16px rgba(0, 135, 83, 0.45);
}

.ehr-notify-btn-danger {
  background: linear-gradient(135deg, #f04438, var(--ehr-notify-danger));
  color: #fff;
  box-shadow: 0 4px 12px rgba(180, 35, 24, 0.35);
}

@keyframes ehrNotifySlideIn {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes ehrNotifySlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

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

@keyframes ehrNotifyModalIn {
  from {
    transform: scale(0.94) translateY(8px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .ehr-notify-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}
