/* ==========================================================================
   BEATIO DIALOGS: TOASTER NOTIFICATIONS & BOOTBOX DECISION MODALS
   Universal Design System Component for Clinical & Titanium Dashboards
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOASTER NOTIFICATION SYSTEM
   -------------------------------------------------------------------------- */
#beatio-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 48px);
}

.beatio-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(18, 19, 22, 0.95);
  border: 1px solid rgba(142, 142, 147, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.4);
  color: #FFFFFF;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 320ms ease;
}

.beatio-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.beatio-toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

/* Light Theme Adaptations */
[data-theme="clinical"] .beatio-toast,
body.theme-light .beatio-toast {
  background: rgba(255, 255, 255, 0.98);
  color: #0F172A;
  border: 1px solid #CBD5E1;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.12), 0 0 1px rgba(15, 23, 42, 0.15);
}

/* Toast Icon Wrapper */
.toast-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.toast-content {
  flex-grow: 1;
  min-width: 0;
}

.toast-title {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  color: #FFFFFF;
}

[data-theme="clinical"] .toast-title,
body.theme-light .toast-title {
  color: #0F172A;
}

.toast-message {
  font-size: 12.5px;
  line-height: 1.5;
  color: #A3A3A8;
  word-break: break-word;
}

[data-theme="clinical"] .toast-message,
body.theme-light .toast-message {
  color: #475569;
}

.toast-close-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #78716C;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.toast-close-btn:hover {
  color: #FFFFFF;
}

[data-theme="clinical"] .toast-close-btn:hover,
body.theme-light .toast-close-btn:hover {
  color: #0F172A;
}

/* Toast Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform-origin: left;
}

/* Variants */
.toast-success {
  border-left: 4px solid #10B981;
}
.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}
.toast-success .toast-progress {
  background: #10B981;
}

.toast-error, .toast-danger {
  border-left: 4px solid #EF4444;
}
.toast-error .toast-icon, .toast-danger .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}
.toast-error .toast-progress, .toast-danger .toast-progress {
  background: #EF4444;
}

.toast-warning {
  border-left: 4px solid #F59E0B;
}
.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}
.toast-warning .toast-progress {
  background: #F59E0B;
}

.toast-info {
  border-left: 4px solid #0284C7;
}
.toast-info .toast-icon {
  background: rgba(2, 132, 199, 0.15);
  color: #38BDF8;
}
.toast-info .toast-progress {
  background: #0284C7;
}


/* --------------------------------------------------------------------------
   2. BOOTBOX MODAL CONFIRMATION & DECISION SYSTEM
   -------------------------------------------------------------------------- */
.beatio-bootbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease;
}

.beatio-bootbox-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.beatio-bootbox-dialog {
  background: #16171B;
  border: 1px solid rgba(142, 142, 147, 0.35);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), opacity 250ms ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #FFFFFF;
}

.beatio-bootbox-backdrop.open .beatio-bootbox-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Light Theme Bootbox */
[data-theme="clinical"] .beatio-bootbox-dialog,
body.theme-light .beatio-bootbox-dialog {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
}

.bootbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(142, 142, 147, 0.2);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="clinical"] .bootbox-header,
body.theme-light .bootbox-header {
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.bootbox-title {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  margin: 0;
}

[data-theme="clinical"] .bootbox-title,
body.theme-light .bootbox-title {
  color: #0F172A;
}

.bootbox-close-btn {
  background: transparent;
  border: none;
  color: #78716C;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.bootbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

[data-theme="clinical"] .bootbox-close-btn:hover,
body.theme-light .bootbox-close-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.bootbox-body {
  padding: 24px;
  font-size: 14px;
  line-height: 1.6;
  color: #A3A3A8;
}

[data-theme="clinical"] .bootbox-body,
body.theme-light .bootbox-body {
  color: #334155;
}

.bootbox-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(142, 142, 147, 0.2);
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="clinical"] .bootbox-footer,
body.theme-light .bootbox-footer {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
}

/* Bootbox Buttons */
.bootbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  border: 1px solid transparent;
}

.bootbox-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #D1D1D6;
}

.bootbox-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

[data-theme="clinical"] .bootbox-btn-cancel,
body.theme-light .bootbox-btn-cancel {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #475569;
}

[data-theme="clinical"] .bootbox-btn-cancel:hover,
body.theme-light .bootbox-btn-cancel:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.bootbox-btn-confirm {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #38BDF8;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.bootbox-btn-confirm:hover {
  background: #0369A1;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

.bootbox-btn-danger {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #F87171;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.bootbox-btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.bootbox-btn-success {
  background: #10B981;
  color: #FFFFFF;
  border-color: #34D399;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.bootbox-btn-success:hover {
  background: #059669;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}
