/* Beautiful Auto-Hiding Alerts System */
.alert-container {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 10000;
  max-width: 400px;
  width: auto;
}

.custom-alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  position: relative;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.custom-alert.show {
  opacity: 1;
  transform: translateX(0);
}

.custom-alert.hide {
  opacity: 0;
  transform: translateX(400px);
}

.custom-alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: progress-bar var(--duration, 5s) linear;
}

@keyframes progress-bar {
  0% { width: 100%; }
  100% { width: 0%; }
}

.custom-alert.success {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.98) 0%, rgba(25, 135, 84, 0.98) 100%);
  color: white;
  border-left: 4px solid #28a745;
}

.custom-alert.error {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.98) 0%, rgba(176, 42, 55, 0.98) 100%);
  color: white;
  border-left: 4px solid #dc3545;
}

.custom-alert.warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.98) 0%, rgba(255, 158, 0, 0.98) 100%);
  color: #333;
  border-left: 4px solid #ffc107;
}

.custom-alert.info {
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.98) 0%, rgba(3, 169, 244, 0.98) 100%);
  color: white;
  border-left: 4px solid #0dcaf0;
}

.alert-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.alert-message {
  font-weight: 500;
  margin: 0;
  display: inline-block;
  max-width: calc(100% - 40px);
}

.alert-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.alert-close:hover {
  opacity: 1;
}

/* Mobile responsive alerts */
@media (max-width: 576px) {
  .alert-container {
    left: 15px;
    right: 15px;
    top: 70px;
    max-width: none;
  }
  
  .custom-alert {
    transform: translateY(-100px);
  }
  
  .custom-alert.show {
    transform: translateY(0);
  }
  
  .custom-alert.hide {
    transform: translateY(-100px);
  }
}

/* Alert stacking animation */
.custom-alert:nth-child(1) { animation-delay: 0s; }
.custom-alert:nth-child(2) { animation-delay: 0.1s; }
.custom-alert:nth-child(3) { animation-delay: 0.2s; }
.custom-alert:nth-child(4) { animation-delay: 0.3s; }
.custom-alert:nth-child(5) { animation-delay: 0.4s; }

/* Pulse effect for important alerts */
.custom-alert.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: translateX(0) scale(1); }
  50% { transform: translateX(0) scale(1.02); }
  100% { transform: translateX(0) scale(1); }
}