/**
 * Alerts Component
 * Structure only - colors applied in colors.css
 */

/* Base alert */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border-width: 1px;
  border-style: solid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  position: relative;
  /* Colors applied in colors.css */
}

.alert:last-child {
  margin-bottom: 0;
}

/* Alert icon */
.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

/* Alert content */
.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
  font-size: var(--text-base);
}

.alert-message {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* Alert close button */
.alert-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.alert-close:hover {
  opacity: 1;
  /* Background applied in colors.css */
}

/* Alert variants */
.alert-success {
  /* Success colors applied in colors.css */
}

.alert-warning {
  /* Warning colors applied in colors.css */
}

.alert-danger,
.alert-error {
  /* Danger colors applied in colors.css */
}

.alert-info {
  /* Info colors applied in colors.css */
}

/* Alert with actions */
.alert-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.alert-actions .btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

/* Toast notifications (positioned alerts) */
.toast-container {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  pointer-events: none;
}

.toast-container.top-right {
  top: 0;
  right: 0;
}

.toast-container.top-left {
  top: 0;
  left: 0;
}

.toast-container.bottom-right {
  bottom: 0;
  right: 0;
}

.toast-container.bottom-left {
  bottom: 0;
  left: 0;
}

.toast-container.top-center {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.toast-container.bottom-center {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.toast {
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  box-shadow: var(--shadow-xl);
  animation: slideIn 0.1s ease-out;
  opacity: 1;
  transform: translateX(0);
}

.toast.removing {
  animation: slideOut 0.2s ease-in forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* Toast progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  animation: progress linear forwards;
  /* Background applied in colors.css */
}

@keyframes progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Banner alerts (full width) */
.alert-banner {
  border-radius: 0;
  border-left: none;
  border-right: none;
  margin-bottom: 0;
}

/* Inline alerts (compact) */
.alert-inline {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

/* Responsive */
@media (max-width: 768px) {
  .toast-container {
    width: 100%;
    padding: var(--space-3);
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .alert {
    padding: var(--space-3);
  }

  .alert-actions {
    flex-direction: column;
  }

  .alert-actions .btn {
    width: 100%;
  }
}
