/* Container */
#flash-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  /*
   * If we want it below the top header
  top: 75px;
  right: 20px;
  */
  z-index: 10000;
  pointer-events: none;
  min-width: 420px;
  width: auto;
  max-width: 600px;
}

@media (max-width: 768px) {
  #flash-container {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    width: auto;
    min-width: 0;
  }
}

/* Notification base */
.flash-notification {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  overflow: hidden;
  border-left: 8px solid;
  min-width: 420px;
  width: auto;
  max-width: 600px;
}

@media (max-width: 768px) {
  .flash-notification {
    min-width: 0;
    max-width: none;
  }
}

.flash-notification.flash-show {
  opacity: 1;
  transform: translateX(0);
}

.flash-notification.flash-hiding {
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-in;
}

/* Content layout */
.flash-content {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.flash-icon {
  flex-shrink: 0;
  font-size: 30px;
  display: flex;
  align-items: center;
}

.flash-message {
  flex: 1;
  font-size: 16px;
  line-height: 1.5;
  color: #363636;
}

.flash-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #999;
  transition: color 0.2s;
  font-size: 16px;
}

.flash-close:hover {
  color: #363636;
}

/* Progress bar */
.flash-progress {
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: 0.3;
  transition: width 0.1s linear;
}

/* Type variants */
.flash-notification.is-success {
  border-left-color: #48c78e;
}

.flash-notification.is-success .flash-icon {
  color: #48c78e;
}

.flash-notification.is-danger {
  border-left-color: #f14668;
}

.flash-notification.is-danger .flash-icon {
  color: #f14668;
}

.flash-notification.is-warning {
  border-left-color: #ffe08a;
}

.flash-notification.is-warning .flash-icon {
  color: #ffb84d;
}

.flash-notification.is-info {
  border-left-color: #3e8ed0;
}

.flash-notification.is-info .flash-icon {
  color: #3e8ed0;
}

/* Actions */
.flash-actions {
  padding: 0 16px 12px 48px;
  display: flex;
  gap: 8px;
}

/* Dark mode */
[data-theme="dark"] .flash-notification {
  background: #2b2b2b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .flash-message {
  color: #f5f5f5;
}

[data-theme="dark"] .flash-close {
  color: #999;
}

[data-theme="dark"] .flash-close:hover {
  color: #f5f5f5;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #flash-container {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    width: auto;
  }

  .flash-notification {
    transform: translateY(-100%);
  }

  .flash-notification.flash-show {
    transform: translateY(0);
  }

  .flash-notification.flash-hiding {
    transform: translateY(-100%);
  }
}

/* Animation for stacking effect */
.flash-notification:not(:last-child) {
  margin-bottom: 8px;
  transform-origin: bottom;
}

/* Hover effect */

/* Working, but I just don't like it...
.flash-notification:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateX(-4px);
}
*/

/* Ensure visibility over modals */
.modal.is-active ~ #flash-container {
  z-index: 10001;
}

/* Support for traditional notification system (Rails flash[] messages) */
.notification {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Faster animation for manual dismissals */
.notification.is-dismissing-fast {
  transition:
    opacity 0.1s ease,
    transform 0.1s ease;
}

/* Light mode notifications - consistent colors */
.notification.is-primary.is-light {
  background-color: #ebfffc;
  color: #00947e;
  border-color: #00d1b2;
}

.notification.is-info {
  background-color: #eff5fb;
  color: #296fa8;
  border-color: #3e8ed0;
}

.notification.is-success,
.notification.is-success.is-light {
  background-color: #effaf5;
  color: #257953;
  border-color: #48c78e;
}

.notification.is-danger.is-light {
  background-color: #feecf0;
  color: #cc0f35;
  border-color: #f14668;
}

.notification.is-warning.is-light {
  background-color: #fffaeb;
  color: #946c00;
  border-color: #ffe08a;
}

/* Dark mode notification backgrounds and borders */
[data-theme="dark"] .notification.is-primary.is-light {
  background-color: #1a3a3a;
  color: #00d1b2;
  border-color: #00d1b2;
}

[data-theme="dark"] .notification.is-info {
  background-color: #1a3a52;
  color: #8fc4e8;
  border-color: #8fc4e8;
}

[data-theme="dark"] .notification.is-success,
[data-theme="dark"] .notification.is-success.is-light {
  background-color: #1a4a2e;
  color: #72dda4;
  border-color: #72dda4;
}

[data-theme="dark"] .notification.is-danger,
[data-theme="dark"] .notification.is-danger.is-light {
  background-color: #4a1e28;
  color: #ff6b8a;
  border-color: #ff6b8a;
}

[data-theme="dark"] .notification.is-warning.is-light {
  background-color: #4a3a1a;
  color: #ffe08a;
  border-color: #ffe08a;
}
