/* public/css/components/alert.css */

.alert {
  position: fixed;
  top: 160px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 500px;
  width: 90%;
  padding: 15px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.alert-message {
  display: inline-block;
  font-size: 16px;
  line-height: 1.4;
  word-break: break-word;
}

/* Alert 類型樣式 */
.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ==================== Laptop: 769px - 1024px ==================== */
@media (max-width: 1024px) {
  .alert {
    top: 100px;
    max-width: 480px;
    width: 88%;
  }
}

/* ==================== Tablet: 481px - 768px ==================== */
@media (max-width: 768px) {
  .alert {
    top: 90px;
    max-width: 460px;
    width: 85%;
    padding: 14px 18px;
  }

  .alert-message {
    font-size: 15px;
  }
}

/* ==================== Mobile: 480px 以下 ==================== */
@media (max-width: 480px) {
  .alert {
    top: calc(70px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    max-width: none;
    padding: 10px 14px;
  }

  .alert-message {
    font-size: 14px;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
