/* Modern Notification System
   ========================
   Positions notifications in the top right corner, aligned with status bubbles
*/

:root {
  /* Notification Colors - Light Mode */
  --notif-bg-info: #f0f9ff;
  --notif-border-info: #3b82f6;
  --notif-text-info: #1e40af;
  --notif-icon-info: #3b82f6;
  
  --notif-bg-success: #f0fdf4;
  --notif-border-success: #10b981;
  --notif-text-success: #166534;
  --notif-icon-success: #10b981;
  
  --notif-bg-warning: #fffbeb;
  --notif-border-warning: #f59e0b;
  --notif-text-warning: #92400e;
  --notif-icon-warning: #f59e0b;
  
  --notif-bg-error: #fef2f2;
  --notif-border-error: #ef4444;
  --notif-text-error: #991b1b;
  --notif-icon-error: #ef4444;
  
  /* Common notification styles */
  --notif-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --notif-transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main notification container - positioned top right */
.notification-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

/* Individual notification */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--notif-shadow);
  opacity: 0;
  transform: translateX(100%);
  animation: slideInRight 300ms forwards;
  pointer-events: auto;
  cursor: default;
  transition: var(--notif-transition);
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
}

/* Notification types */
.notification-item.info {
  background: var(--notif-bg-info);
  border-left-color: var(--notif-border-info);
  color: var(--notif-text-info);
}

.notification-item.success {
  background: var(--notif-bg-success);
  border-left-color: var(--notif-border-success);
  color: var(--notif-text-success);
}

.notification-item.warning {
  background: var(--notif-bg-warning);
  border-left-color: var(--notif-border-warning);
  color: var(--notif-text-warning);
}

.notification-item.error {
  background: var(--notif-bg-error);
  border-left-color: var(--notif-border-error);
  color: var(--notif-text-error);
}

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

.notification-item.info .notification-icon {
  color: var(--notif-icon-info);
}

.notification-item.success .notification-icon {
  color: var(--notif-icon-success);
}

.notification-item.warning .notification-icon {
  color: var(--notif-icon-warning);
}

.notification-item.error .notification-icon {
  color: var(--notif-icon-error);
}

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

.notification-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 2px;
}

.notification-message {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.9;
  word-break: break-word;
}

/* Close button */
.notification-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--notif-transition);
  cursor: pointer;
  opacity: 0.5;
  background: transparent;
  border: none;
  padding: 0;
  color: currentColor;
}

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

/* Progress bar for auto-dismiss */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.2;
  transform-origin: left;
  animation: progressBar var(--notification-duration, 5s) linear forwards;
}

/* Exit animation */
.notification-item.fade-out {
  animation: slideOutRight 300ms forwards;
}

/* Animations */
@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 progressBar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Dark mode support */
.dark-mode {
  --notif-bg-info: #1e3a8a;
  --notif-border-info: #60a5fa;
  --notif-text-info: #dbeafe;
  --notif-icon-info: #60a5fa;
  
  --notif-bg-success: #166534;
  --notif-border-success: #34d399;
  --notif-text-success: #d1fae5;
  --notif-icon-success: #34d399;
  
  --notif-bg-warning: #92400e;
  --notif-border-warning: #fbbf24;
  --notif-text-warning: #fef3c7;
  --notif-icon-warning: #fbbf24;
  
  --notif-bg-error: #991b1b;
  --notif-border-error: #f87171;
  --notif-text-error: #fee2e2;
  --notif-icon-error: #f87171;
  
  --notif-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark-mode .notification-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .notification-stack {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .notification-item {
    font-size: 13px;
  }
  
  .notification-title {
    font-size: 13px;
  }
  
  .notification-message {
    font-size: 12px;
  }
}

/* Integration with existing notification containers */
#server-notification-container {
  display: none !important; /* Hide the old centered notification container */
}

/* Ensure notifications stay on top of status bubbles */
.notification-stack {
  z-index: 10000;
}

.floating-status-container {
  z-index: 9999;
} 
