/*
 * Alerts Component Styles
 * Consolidated alert, notification, and message styles
 */

/* Base Alert Styles */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Alert Variants */
.alert-error,
.alert-danger {
  background-color: hsl(0 100% 97%);
  color: hsl(0 84% 20%);
  border-color: hsl(0 100% 85%);
}

.dark .alert-error,
.dark .alert-danger,
[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger {
  background-color: hsl(0 40% 20%);
  color: hsl(0 84% 80%);
  border-color: hsl(0 60% 40%);
}

.alert-success {
  background-color: hsl(120 100% 97%);
  color: hsl(120 84% 20%);
  border-color: hsl(120 100% 85%);
}

.dark .alert-success,
[data-theme="dark"] .alert-success {
  background-color: hsl(120 40% 20%);
  color: hsl(120 84% 80%);
  border-color: hsl(120 60% 40%);
}

.alert-warning {
  background-color: hsl(45 100% 97%);
  color: hsl(45 84% 20%);
  border-color: hsl(45 100% 85%);
}

.dark .alert-warning,
[data-theme="dark"] .alert-warning {
  background-color: hsl(45 40% 20%);
  color: hsl(45 84% 80%);
  border-color: hsl(45 60% 40%);
}

.alert-info {
  background-color: hsl(200 100% 97%);
  color: hsl(200 84% 20%);
  border-color: hsl(200 100% 85%);
}

.dark .alert-info,
[data-theme="dark"] .alert-info {
  background-color: hsl(200 40% 20%);
  color: hsl(200 84% 80%);
  border-color: hsl(200 60% 40%);
}

/* Alert Icons */
.alert-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
}

.alert-error .alert-icon {
  color: hsl(0 84% 60%);
}

.alert-success .alert-icon {
  color: hsl(120 84% 40%);
}

.alert-warning .alert-icon {
  color: hsl(45 84% 40%);
}

.alert-info .alert-icon {
  color: hsl(200 84% 40%);
}

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

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: inherit;
}

.alert-message {
  color: inherit;
  margin: 0;
}

/* Dismissible Alerts */
.alert-dismissible {
  padding-right: 3rem;
  position: relative;
}

.alert-dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.alert-dismiss:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Notification Styles */
.notification,
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  max-width: 400px;
  z-index: 1000;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
  padding: 1rem;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.notification.show,
.toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* Notification Variants */
.notification-error,
.toast-error {
  border-left: 4px solid hsl(0 84% 60%);
}

.notification-success,
.toast-success {
  border-left: 4px solid hsl(120 84% 40%);
}

.notification-warning,
.toast-warning {
  border-left: 4px solid hsl(45 84% 40%);
}

.notification-info,
.toast-info {
  border-left: 4px solid hsl(200 84% 40%);
}

/* Notification Content */
.notification-header,
.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.notification-title,
.toast-title {
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.notification-close,
.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover,
.toast-close:hover {
  color: hsl(var(--foreground));
}

.notification-message,
.toast-message {
  color: hsl(var(--muted-foreground));
  margin: 0;
  line-height: 1.4;
}

/* Flash Messages */
.flash-message {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.flash-success {
  background-color: hsl(120 100% 97%);
  color: hsl(120 84% 20%);
  border: 1px solid hsl(120 100% 85%);
}

.dark .flash-success,
[data-theme="dark"] .flash-success {
  background-color: hsl(120 40% 15%); /* dark green background */
  color: rgb(255 255 255); /* white text */
  border: 1px solid hsl(120 60% 30%); /* green border */
}

.flash-error {
  background-color: hsl(0 100% 97%);
  color: hsl(0 84% 20%);
  border: 1px solid hsl(0 100% 85%);
}

.dark .flash-error,
[data-theme="dark"] .flash-error {
  background-color: hsl(0 40% 15%); /* dark red background */
  color: rgb(255 255 255); /* white text */
  border: 1px solid hsl(0 60% 30%); /* red border */
}

.flash-warning {
  background-color: hsl(45 100% 97%);
  color: hsl(45 84% 20%);
  border: 1px solid hsl(45 100% 85%);
}

.dark .flash-warning,
[data-theme="dark"] .flash-warning {
  background-color: hsl(45 40% 15%); /* dark amber background */
  color: rgb(255 255 255); /* white text */
  border: 1px solid hsl(45 60% 30%); /* amber border */
}

.flash-info {
  background-color: hsl(200 100% 97%);
  color: hsl(200 84% 20%);
  border: 1px solid hsl(200 100% 85%);
}

.dark .flash-info,
[data-theme="dark"] .flash-info {
  background-color: hsl(200 40% 15%); /* dark blue background */
  color: rgb(255 255 255); /* white text */
  border: 1px solid hsl(200 60% 30%); /* blue border */
}

/* Conflict Warnings */
.conflict-warning {
  background: hsl(45 100% 97%);
  border: 1px solid hsl(45 100% 85%);
  border-radius: 0.375rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.conflict-message {
  color: hsl(45 84% 20%);
  font-size: 0.75rem;
  margin: 0;
}

/* Status Messages */
.status-message {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-success {
  background-color: hsl(120 100% 97%);
  color: hsl(120 84% 20%);
  border: 1px solid hsl(120 100% 85%);
}

.status-error {
  background-color: hsl(0 100% 97%);
  color: hsl(0 84% 20%);
  border: 1px solid hsl(0 100% 85%);
}

.status-warning {
  background-color: hsl(45 100% 97%);
  color: hsl(45 84% 20%);
  border: 1px solid hsl(45 100% 85%);
}

.status-info {
  background-color: hsl(200 100% 97%);
  color: hsl(200 84% 20%);
  border: 1px solid hsl(200 100% 85%);
}

/* Progress Indicators */
.progress-alert {
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background-color: hsl(var(--muted));
  border-radius: 0.25rem;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  background-color: hsl(var(--primary));
  transition: width 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .notification,
  .toast {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
    transform: translateY(-100%);
  }
  
  .notification.show,
  .toast.show {
    transform: translateY(0);
  }
  
  .alert {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  
  .alert-dismissible {
    padding-right: 2.5rem;
  }
  
  .flash-message {
    padding: 0.75rem;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .alert {
    border-width: 2px;
  }
  
  .notification,
  .toast {
    border-width: 2px;
  }
  
  .alert-error,
  .alert-danger {
    border-color: hsl(0 84% 60%);
  }
  
  .alert-success {
    border-color: hsl(120 84% 40%);
  }
  
  .alert-warning {
    border-color: hsl(45 84% 40%);
  }
  
  .alert-info {
    border-color: hsl(200 84% 40%);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .notification,
  .toast {
    transition: none;
  }
  
  .alert-dismiss,
  .notification-close,
  .toast-close {
    transition: none;
  }
  
  .progress-fill {
    transition: none;
  }
}

/* Dark Mode Toast Overrides for accessible_toast helper */
/* These styles specifically target the Tailwind classes used by accessible_toast */

/* Success toast - Green variant */
.dark .bg-green-50,
[data-theme="dark"] .bg-green-50 {
  background-color: rgb(20 83 45) !important; /* green-900 */
}

.dark .text-green-800,
[data-theme="dark"] .text-green-800 {
  color: rgb(187 247 208) !important; /* green-200 */
}

.dark .border-green-200,
[data-theme="dark"] .border-green-200 {
  border-color: rgb(21 128 61) !important; /* green-700 */
}

/* Alternative: dark mode specific classes */
.dark .dark\:bg-green-900\/20,
[data-theme="dark"] .dark\:bg-green-900\/20 {
  background-color: rgba(20 83 45 / 0.2) !important;
}

.dark .dark\:text-green-400,
[data-theme="dark"] .dark\:text-green-400 {
  color: rgb(74 222 128) !important; /* green-400 */
}

.dark .dark\:border-green-800,
[data-theme="dark"] .dark\:border-green-800 {
  border-color: rgb(22 101 52) !important; /* green-800 */
}

/* Error toast - Red variant */
.dark .bg-red-50,
[data-theme="dark"] .bg-red-50 {
  background-color: rgb(127 29 29) !important; /* red-900 */
}

.dark .text-red-800,
[data-theme="dark"] .text-red-800 {
  color: rgb(254 202 202) !important; /* red-200 */
}

.dark .border-red-200,
[data-theme="dark"] .border-red-200 {
  border-color: rgb(185 28 28) !important; /* red-700 */
}

/* Alternative: dark mode specific classes */
.dark .dark\:bg-red-900\/20,
[data-theme="dark"] .dark\:bg-red-900\/20 {
  background-color: rgba(127 29 29 / 0.2) !important;
}

.dark .dark\:text-red-400,
[data-theme="dark"] .dark\:text-red-400 {
  color: rgb(248 113 113) !important; /* red-400 */
}

.dark .dark\:border-red-800,
[data-theme="dark"] .dark\:border-red-800 {
  border-color: rgb(153 27 27) !important; /* red-800 */
}

/* Warning toast - Yellow variant */
.dark .bg-yellow-50,
[data-theme="dark"] .bg-yellow-50 {
  background-color: rgb(113 63 18) !important; /* yellow-900 */
}

.dark .text-yellow-800,
[data-theme="dark"] .text-yellow-800 {
  color: rgb(254 240 138) !important; /* yellow-200 */
}

.dark .border-yellow-200,
[data-theme="dark"] .border-yellow-200 {
  border-color: rgb(161 98 7) !important; /* yellow-700 */
}

/* Alternative: dark mode specific classes */
.dark .dark\:bg-yellow-900\/20,
[data-theme="dark"] .dark\:bg-yellow-900\/20 {
  background-color: rgba(113 63 18 / 0.2) !important;
}

.dark .dark\:text-yellow-400,
[data-theme="dark"] .dark\:text-yellow-400 {
  color: rgb(250 204 21) !important; /* yellow-400 */
}

.dark .dark\:border-yellow-800,
[data-theme="dark"] .dark\:border-yellow-800 {
  border-color: rgb(133 77 14) !important; /* yellow-800 */
}

/* Info toast - Blue variant */
.dark .bg-blue-50,
[data-theme="dark"] .bg-blue-50 {
  background-color: rgb(30 58 138) !important; /* blue-900 */
}

.dark .text-blue-800,
[data-theme="dark"] .text-blue-800 {
  color: rgb(191 219 254) !important; /* blue-200 */
}

.dark .border-blue-200,
[data-theme="dark"] .border-blue-200 {
  border-color: rgb(29 78 216) !important; /* blue-700 */
}

/* Alternative: dark mode specific classes */
.dark .dark\:bg-blue-900\/20,
[data-theme="dark"] .dark\:bg-blue-900\/20 {
  background-color: rgba(30 58 138 / 0.2) !important;
}

.dark .dark\:text-blue-400,
[data-theme="dark"] .dark\:text-blue-400 {
  color: rgb(96 165 250) !important; /* blue-400 */
}

.dark .dark\:border-blue-800,
[data-theme="dark"] .dark\:border-blue-800 {
  border-color: rgb(30 64 175) !important; /* blue-800 */
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
  .alert-error,
  .alert-danger {
    background-color: hsl(0 100% 10%);
    color: hsl(0 84% 80%);
    border-color: hsl(0 100% 30%);
  }
  
  .alert-success {
    background-color: hsl(120 100% 10%);
    color: hsl(120 84% 80%);
    border-color: hsl(120 100% 30%);
  }
  
  .alert-warning {
    background-color: hsl(45 100% 10%);
    color: hsl(45 84% 80%);
    border-color: hsl(45 100% 30%);
  }
  
  .alert-info {
    background-color: hsl(200 100% 10%);
    color: hsl(200 84% 80%);
    border-color: hsl(200 100% 30%);
  }
}

/* Animation Keyframes */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Animation Classes */
.animate-slide-in-right {
  animation: slideInRight 0.3s ease;
}

.animate-slide-out-right {
  animation: slideOutRight 0.3s ease;
}

.animate-slide-in-down {
  animation: slideInDown 0.3s ease;
}

.animate-slide-out-up {
  animation: slideOutUp 0.3s ease;
}