/* flash-messages.css - Modernes Design mit Auto-Dismiss */

.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
  max-width: 350px;
  width: 100%;
}

.flash-message {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.5s ease-out, fadeOut 0.5s ease-in 4.5s forwards;
  opacity: 0.95;
  backdrop-filter: blur(5px);
  transform-origin: top right;
  overflow: hidden;
}

.flash-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 5px;
}

.flash-message .close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.flash-message .close:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.1);
}

.flash-message .icon {
  margin-right: 12px;
  display: inline-block;
  vertical-align: middle;
}

.flash-message .content {
  display: flex;
  align-items: flex-start;
}

.flash-message .message-text {
  flex-grow: 1;
  padding-right: 20px;
}

.flash-message .title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 16px;
}

.flash-message .description {
  opacity: 0.9;
  font-size: 14px;
}

/* Success message */
.flash-message.success {
  background-color: rgba(240, 255, 240, 0.95);
  color: #155724;
  border-left: none;
}

.flash-message.success::before {
  background-color: #28a745;
}

/* Error message */
.flash-message.error {
  background-color: rgba(255, 240, 240, 0.95);
  color: #721c24;
  border-left: none;
}

.flash-message.error::before {
  background-color: #dc3545;
}

/* Warning message */
.flash-message.warning {
  background-color: rgba(255, 250, 230, 0.95);
  color: #856404;
  border-left: none;
}

.flash-message.warning::before {
  background-color: #ffc107;
}

/* Info message */
.flash-message.info {
  background-color: rgba(240, 249, 255, 0.95);
  color: #0c5460;
  border-left: none;
}

.flash-message.info::before {
  background-color: #17a2b8;
}

/* Progress bar for auto-dismiss */
.flash-message .progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.3);
}

.flash-message .progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: progress 5s linear;
}

.flash-message.success .progress-bar {
  background-color: #28a745;
}

.flash-message.error .progress-bar {
  background-color: #dc3545;
}

.flash-message.warning .progress-bar {
  background-color: #ffc107;
}

.flash-message.info .progress-bar {
  background-color: #17a2b8;
}

/* Animations */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 0.95; }
}

@keyframes fadeOut {
  from { transform: translateX(0) scale(1); opacity: 0.95; }
  to { transform: translateX(10%) scale(0.9); opacity: 0; }
}

@keyframes progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .flash-messages {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}