/* Overlay */
.custom-alert {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

/* Box */
.custom-alert-box {
  background: #f1f1f1;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  animation: bounceIn 0.6s ease;
}
/* Animations */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  80% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* Header */
.custom-alert-header {
  color: #fff;
  padding: 10px 15px;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Close button */
.custom-alert-header .close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* Body */
.custom-alert-body {
  padding: 20px;
  color: #333;
  font-size: 16px;
  text-align: center;
}

/* Footer */
.custom-alert-footer {
  padding: 15px;
  text-align: center;
  background: #f9f9f9;
}

.custom-alert-footer .btn-ok {
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
}

.custom-alert-footer .btn-ok:hover {
  background: #798c9d;
}

/* Icon base */
.alert-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 15px auto;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
}

/* Success */
.alert-icon.success {
  background: #28a745;
}
.alert-icon.success::after {
  content: "";
  width: 20px;
  height: 40px;
  border-right: 5px solid #fff;
  border-bottom: 5px solid #fff;
  transform: rotate(45deg);
  position: absolute;
}

/* Error */
.alert-icon.error {
  background: #dc3545;
}
.alert-icon.error::before,
.alert-icon.error::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 6px;
  background: #fff;
}
.alert-icon.error::before {
  transform: rotate(45deg);
}
.alert-icon.error::after {
  transform: rotate(-45deg);
}

/* Info */
.alert-icon.info {
  background: #17a2b8;
}
.alert-icon.info::before {
  content: "i";
  font-size: 36px;
  font-weight: bold;
  color: #fff;
  position: absolute;
}

/* Animations */
.alert-icon.success {
  animation: popIn 0.4s ease forwards;
}
.alert-icon.success::after {
  animation: drawCheck 0.6s ease forwards;
}

@keyframes drawCheck {
  from {
    width: 0;
    height: 0;
    opacity: 0;
  }
  to {
    width: 20px;
    height: 40px;
    opacity: 1;
  }
}

/* Error animation (cross shake) */
.alert-icon.error {
  animation: shake 0.9s ease;
}
.alert-icon.error::before,
.alert-icon.error::after {
  animation: fadeInCross 0.4s ease forwards;
}

@keyframes fadeInCross {
  from { opacity: 0; transform: scale(0.5) rotate(0deg); }
  to   { opacity: 1; transform: scale(1) rotate(var(--angle, 0deg)); }
}

/* Info animation (pulse) */
.alert-icon.info {
  animation: pulse 1.2s infinite;
}
