/* Frontend Styles for Message Banner */

.message-banner {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999999;
  padding: 20px 60px 20px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.5s ease-out;
  box-sizing: border-box;
}

.message-banner * {
  box-sizing: border-box;
}

/* Position variants */
.message-banner.mb-top_sticky {
  top: 0;
}

.message-banner.mb-bottom_sticky {
  bottom: 0;
}

.message-banner.mb-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: popupIn 0.4s ease-out;
}

/* Popup overlay */
.message-banner.mb-popup::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
  animation: fadeIn 0.3s ease-out;
}

/* Content */
.message-banner-content {
  line-height: 1.6;
  max-width: 100%;
}

.message-banner-content p {
  margin: 0 0 10px 0;
}

.message-banner-content p:last-child {
  margin-bottom: 0;
}

.message-banner-content a {
  color: inherit;
  text-decoration: underline;
}

.message-banner-content a:hover {
  opacity: 0.8;
}

/* Close button */
.message-banner-close {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  border-radius: 4px;
}

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

.message-banner-close:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

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

@keyframes popupIn {
  from {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

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

/* Responsive */
@media (max-width: 768px) {
  .message-banner {
    padding: 15px 50px 15px 15px;
    font-size: 14px !important;
  }

  .message-banner.mb-popup {
    width: 95%;
    max-width: none;
    padding: 20px 50px 20px 20px;
  }

  .message-banner-close {
    right: 10px;
    padding: 6px;
  }
}

/* Hide when dismissed */
.message-banner.dismissed {
  animation: slideOut 0.3s ease-out forwards;
}

.message-banner.mb-popup.dismissed {
  animation: popupOut 0.3s ease-out forwards;
}

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

@keyframes popupOut {
  to {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
}
