.messageOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  backdrop-filter: blur(8px);
  background-color: rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  animation: fadeIn 0.3s ease-out forwards;
}

.messageOverlay.closing {
  animation: fadeOut 0.3s ease-out forwards;
  pointer-events: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

.messageContainer {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px;
  pointer-events: none;
}

.messageContent {
  border-radius: var(--object-radius-large);
  padding: 30px;
  max-width: 500px;
  width: 100%;
  position: relative;
  border: 2px solid;
  pointer-events: auto;
  animation: slideIn 0.4s ease-out forwards;
}

.messageOverlay.closing .messageContent {
  animation: slideOut 0.3s ease-out forwards;
}

/* Warning Mode */
.warningMode {
  background-color: color-mix(in srgb, var(--color-red) 20%, transparent);
  border-color: var(--color-red);
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.4);
}

/* Error Mode */
.errorMode {
  background-color: color-mix(in srgb, var(--color-red) 20%, transparent);
  border-color: var(--color-red);
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.4);
}

/* Success Mode */
.successMode {
  background-color: color-mix(in srgb, var(--color-green, #16a34a) 90%, black);
  border-color: var(--color-green, #16a34a);
  box-shadow: 0 8px 32px rgba(22, 163, 74, 0.4);
}

/* Info Mode */
.infoMode {
  background-color: color-mix(in srgb, var(--color-blue, #2563eb) 90%, black);
  border-color: var(--color-blue, #2563eb);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
}

.messageHeader {
  font-size: 18px;
  font-weight: 600;
  color: white;
  line-height: 1.4;
}

.messageText {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.closeButton {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-red);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  line-height: 1;
}

.closeButton:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.closeButton:active {
  background: rgba(255, 255, 255, 0.3);
  opacity: 1;
}

/* Responsive design */
@media (max-width: 640px) {
  .messageContainer {
    padding: 15px;
  }
  
  .messageContent {
    padding: 20px;
  }
  
  .messageHeader {
    font-size: 16px;
  }
  
  .messageText {
    font-size: 14px;
  }
  
  .closeButton {
    top: 8px;
    right: 8px;
    font-size: 20px;
    padding: 2px 6px;
  }
}
