/* Alert Component Styles.
   Text uses dark-on-tint combinations (Bootstrap's own palette) so body copy
   clears the 4.5:1 WCAG AA threshold; the raw status colors only tint the
   background and paint the left border. */

.alert {
  border-radius: var(--radius-md);
  border: none;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background-color: rgba(var(--bels-success-rgb), 0.08);
  color: #0f5132;
  border-left: 4px solid var(--bels-success);
}

.alert-danger {
  background-color: rgba(var(--bels-accent-rgb), 0.08);
  color: #58151c;
  border-left: 4px solid var(--bels-danger);
}

.alert-warning {
  background-color: rgba(var(--bels-warning-rgb), 0.12);
  color: #664d03;
  border-left: 4px solid var(--bels-warning);
}

.alert-info {
  background-color: rgba(var(--bels-info-rgb), 0.08);
  color: #084298;
  border-left: 4px solid var(--bels-info);
}

.alert-dismissible .btn-close {
  opacity: 0.7;
  transition: opacity var(--transition-base);
}

.alert-dismissible .btn-close:hover {
  opacity: 1;
}

/* Toast notifications created by showAlert(). Positioned by the
   #live-alert-container wrapper instead of per element, so several stack
   instead of landing on top of each other at the same coordinates. */
.toast-notification {
  width: min(90vw, 320px);
}

#live-alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

#live-alert-container > * {
  pointer-events: auto;
}

.toast-container-center {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem;
  z-index: 1055;
}

/* Server-rendered flash toasts (shared/_flash_toast) */
.flash-toast-container {
  position: fixed;
  top: calc(var(--navbar-height, 72px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1055;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 420px);
}

/* Bootstrap adds 1.5rem between stacked toasts; the flex gap already handles
   spacing, so cancel it out. */
.flash-toast-container > :not(:last-child) {
  margin-bottom: 0;
}

.flash-toast {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.95);
}

.flash-toast[data-style="success"] {
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.flash-toast[data-style="danger"] {
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-toast[data-style="success"] .toast-header {
  background: rgba(34, 197, 94, 0.1);
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.flash-toast[data-style="danger"] .toast-header {
  background: rgba(239, 68, 68, 0.1);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

[data-bs-theme="dark"] .flash-toast {
  background: rgba(25, 30, 35, 0.95);
  color: #e8f0fe;
  border-color: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .flash-toast .toast-header {
  background: rgba(45, 55, 65, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e8f0fe;
}

[data-bs-theme="dark"] .flash-toast .toast-body {
  color: #e8f0fe;
}

