/**
 * Alerts & Notifications
 * Alert boxes and notification styles
 */

/* ============================================
   BASE ALERT
   ============================================ */
.alert {
  display: flex;
  gap: 1.2rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 1rem;
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
}

.alert-description {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.9;
}

.alert-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: currentColor;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.alert-close:hover {
  opacity: 1;
}

/* ============================================
   ALERT VARIANTS
   ============================================ */
.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
  border-color: rgba(59, 130, 246, 0.3);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: rgb(34, 197, 94);
  border-color: rgba(34, 197, 94, 0.3);
}

.alert-warning {
  background: rgba(251, 191, 36, 0.1);
  color: rgb(251, 191, 36);
  border-color: rgba(251, 191, 36, 0.3);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  pointer-events: auto;
  animation: slide-in-right 0.3s ease;
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
  }
}

/**
 * Alert Notification System
 * Modern toast/alert notifications
 */

/* Alert Container - Fixed under navbar */
.alert-container {
  position: fixed;
  top: 90px; /* Под навбаром (80px высота + 10px отступ) */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 100%;
  max-width: 900px;
  padding: 0 1rem;
  pointer-events: none;
}

.alert-container > * {
  pointer-events: auto;
}

/* Alert Base */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  backdrop-filter: blur(16px);
  animation: slideInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.alert:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

/* Alert Icon */
.alert-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  margin-top: 0.125rem;
}

/* Alert Content */
.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.alert-message {
  /* color: rgba(255, 255, 255, 0.9); */
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
  text-shadow: 0px 1px 5px rgb(0 0 0 / 25%);
}

/* Alert Close Button */
.alert-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.125rem;
}

.alert-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.05);
}

.alert-close:active {
  transform: scale(0.95);
}

/* Alert Types */

/* Error Alert */
.alert-error {
  background: linear-gradient(135deg, rgb(239 68 68 / 45%) 0%, rgb(220 38 38 / 40%) 100%);
  color: white;
}

.alert-error .alert-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Success Alert */
.alert-success {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.95) 0%,
    rgba(22, 163, 74, 0.95) 100%
  );
  color: white;
}

.alert-success .alert-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Info Alert */
.alert-info {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.95) 0%,
    rgba(37, 99, 235, 0.95) 100%
  );
  color: white;
}

.alert-info .alert-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Warning Alert */
.alert-warning {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.95) 0%,
    rgba(217, 119, 6, 0.95) 100%
  );
  color: white;
}

.alert-warning .alert-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Animations */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.alert-closing {
  animation: slideOutUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Progress Bar */
.alert-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 1rem 1rem;
  animation: progress 5s linear forwards;
}

@keyframes progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .alert-container {
    top: 70px; /* Меньший отступ на мобилке */
    max-width: calc(100% - 2rem);
    padding: 0 1rem;
  }

  .alert {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }

  .alert-icon {
    width: 2rem;
    height: 2rem;
  }

  .alert-title {
    font-size: 0.875rem;
  }

  .alert-message {
    font-size: 0.8125rem;
  }
}

/* Multiple alerts stacking */
.alert-container .alert + .alert {
  margin-top: 0.75rem;
}

/* Dark theme adjustments */
[data-theme="light"] .alert {
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

/* Print hide */
@media print {
  .alert-container {
    display: none;
  }
}

