/* Flash Messages - Toast Style */
.flash-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 420px;
  pointer-events: none;
}

.flash-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  animation: slideInRight 0.3s ease-out;
  pointer-events: auto;
  min-width: 300px;
  backdrop-filter: blur(10px);
}

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

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

.flash-message.flash-dismissing {
  animation: slideOutRight 0.3s ease-in;
}

/* Flash Types */
.flash-success {
  background: rgba(34, 197, 94, 0.95);
  color: white;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.flash-error {
  background: rgba(239, 68, 68, 0.95);
  color: white;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.flash-warning {
  background: rgba(245, 158, 11, 0.95);
  color: white;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.flash-info {
  background: rgba(59, 130, 246, 0.95);
  color: white;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Flash Content */
.flash-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.flash-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.flash-text {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.flash-close {
  background: none;
  border: none;
  padding: 0.25rem;
  margin-left: 1rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  color: currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flash-close:hover {
  opacity: 1;
}

.flash-close svg {
  width: 16px;
  height: 16px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .flash-container {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    max-width: none;
  }

  .flash-message {
    min-width: auto;
  }
}

/* Demo mode adjustments */
.demo-mode .flash-container {
  position: absolute;
  top: 60px; /* Below the phone status bar */
  right: 10px;
  max-width: calc(100% - 20px);
}

/* Progress bar for auto-dismiss */
.flash-message[data-flash-message-auto-dismiss-value="true"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 0.5rem 0.5rem;
  animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}