/**
 * Notification System Styles
 * Elegant toast notifications for the top-right corner
 */

/* Container for all notifications */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: 100%;
  pointer-events: none;
}

/* Individual notification */
.notification {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .notification {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

/* Notification icon container */
.notification-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* Notification content */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Close button */
.notification-close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

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

/* Success notification */
.notification-success {
  border-left: 4px solid #10b981;
}

.notification-success .notification-icon {
  color: #10b981;
}

/* Error notification */
.notification-error {
  border-left: 4px solid #ef4444;
}

.notification-error .notification-icon {
  color: #ef4444;
}

/* Warning notification */
.notification-warning {
  border-left: 4px solid #f59e0b;
}

.notification-warning .notification-icon {
  color: #f59e0b;
}

/* Info notification */
.notification-info {
  border-left: 4px solid #3b82f6;
}

.notification-info .notification-icon {
  color: #3b82f6;
}

/* Animation states */
.notification-enter {
  transform: translateX(calc(100% + 20px));
  opacity: 0;
}

.notification-active {
  transform: translateX(0);
  opacity: 1;
}

.notification-exit {
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

/* Hover effect */
.notification:hover {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: 100%;
  }

  .notification {
    min-width: auto;
    max-width: 100%;
    width: 100%;
  }
}

/* Loading spinner animation (for buttons in notifications) */
@keyframes notification-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Progress bar for auto-dismiss */
.notification::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  animation: notification-progress linear;
}

.notification-success::after {
  background: #10b981;
}

.notification-error::after {
  background: #ef4444;
}

.notification-warning::after {
  background: #f59e0b;
}

.notification-info::after {
  background: #3b82f6;
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .notification,
  .notification-enter,
  .notification-active,
  .notification-exit {
    transition: none;
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .notification {
    border-width: 2px;
  }
}
