/* ===== MODERN MESSAGE SYSTEM WITH COLORED BACKGROUNDS ===== */
.modern-message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modern-message {
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  animation: slideInRight 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  opacity: 0;
  transform: translateX(120%);
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: none;
}

.modern-message:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Success Message - Modern Green Theme */
.modern-success {
  background: linear-gradient(135deg, #00b894, #00a085);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Error Message - Modern Red Theme */
.modern-error {
  background: linear-gradient(135deg, #e17055, #d63031);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.modern-message-header {
  display: flex;
  align-items: center;
  padding: 18px 20px 10px;
  gap: 12px;
}

.modern-message-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.modern-icon {
  width: 22px;
  height: 22px;
  fill: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.modern-message-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.modern-message-body {
  padding: 0 20px 18px 74px;
  margin-top: -8px;
}

.modern-message-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.95;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.modern-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  flex-shrink: 0;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.modern-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.modern-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.modern-progress-fill {
  height: 100%;
  width: 100%;
  animation: shrinkProgress 10s linear forwards;
  transform-origin: left;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.modern-success .modern-progress-fill {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.6)
  );
}

.modern-error .modern-progress-fill {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.6)
  );
}

/* Glow effects for messages */
.modern-success::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #00b894, #00a085);
  z-index: -1;
  filter: blur(10px);
  opacity: 0.6;
  border-radius: 18px;
  animation: pulseGlow 3s infinite alternate;
}

.modern-error::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #e17055, #d63031);
  z-index: -1;
  filter: blur(10px);
  opacity: 0.6;
  border-radius: 18px;
  animation: pulseGlow 3s infinite alternate;
}

/* Animations */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(120%);
  }
  70% {
    opacity: 1;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  30% {
    opacity: 1;
    transform: translateX(-10px);
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

@keyframes shrinkProgress {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

@keyframes pulseIcon {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes pulseGlow {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 0.7;
  }
}

.modern-message-icon {
  animation: pulseIcon 2s infinite;
}

/* Dismiss animation */
.modern-message.dismissing {
  animation: slideOutRight 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Responsive Design */
@media (max-width: 640px) {
  .modern-message-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .modern-message {
    border-radius: 14px;
  }

  .modern-message-header {
    padding: 16px 18px 8px;
  }

  .modern-message-body {
    padding: 0 18px 16px 68px;
  }

  .modern-message-icon {
    width: 38px;
    height: 38px;
  }

  .modern-icon {
    width: 20px;
    height: 20px;
  }

  .modern-close-btn {
    width: 32px;
    height: 32px;
  }
}

/* Print styles - hide messages when printing */
@media print {
  .modern-message-container {
    display: none;
  }
}
