/* ----- Notification Container - Top Center ----- */
.notification-container.top-center {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px;
  z-index: 99999;
  pointer-events: none;
  width: 100%;
  max-width: 400px;
}

/* ----- Notification Item ----- */
.notification {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.02);
  padding: 16px 20px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  /* ensures title is at top */
  gap: 12px;
  border-left: 4px solid transparent;
  animation: slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

/* ----- Dark Mode Support ----- */
.dark-mode .notification {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
}

/* ----- Notification Types ----- */
.notification.success {
  border-left-color: #10b981;
}

.notification.error {
  border-left-color: #ef4444;
}

.notification.warning {
  border-left-color: #f59e0b;
}

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

.dark-mode .notification.success {
  border-left-color: #34d399;
}

.dark-mode .notification.error {
  border-left-color: #f87171;
}

.dark-mode .notification.warning {
  border-left-color: #fbbf24;
}

.dark-mode .notification.info {
  border-left-color: #60a5fa;
}

/* ----- Notification Icon ----- */
.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.notification.success .notification-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.notification.error .notification-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.notification.warning .notification-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.notification.info .notification-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.dark-mode .notification.success .notification-icon {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.dark-mode .notification.error .notification-icon {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.dark-mode .notification.warning .notification-icon {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.dark-mode .notification.info .notification-icon {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

/* ----- Notification Content ----- */
.notification-content {
  flex: 1;
  min-width: 0;
  /* prevent flex-shrink issues */
  display: flex;
  flex-direction: column;
  /* title on top, message below */
}

.notification-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
  color: #1f2937;
  /* dark for light mode */
}

.dark-mode .notification-title {
  color: #f1f5f9;
}

.notification-message {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.4;
}

.dark-mode .notification-message {
  color: #94a3b8;
}

/* ----- Close Button ----- */
.notification-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  flex-shrink: 0;
}

.notification-close:hover {
  color: #ef4444;
}

.dark-mode .notification-close {
  color: #94a3b8;
}

/* ----- Progress Bar ----- */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 0 0 12px 12px;
  animation: progress 5s linear forwards;
}

.notification.success .notification-progress {
  background: rgba(16, 185, 129, 0.3);
}

.notification.error .notification-progress {
  background: rgba(239, 68, 68, 0.3);
}

.notification.warning .notification-progress {
  background: rgba(245, 158, 11, 0.3);
}

.notification.info .notification-progress {
  background: rgba(59, 130, 246, 0.3);
}

/* ----- Animations ----- */
@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-100%) scale(0.8);
  }
  
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  
  100% {
    opacity: 0;
    transform: translateY(-100%) scale(0.8);
  }
}

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

/* ----- Removing Animation ----- */
.notification.removing {
  animation: slideUp 0.3s ease forwards;
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
  .notification-container.top-center {
    padding: 10px;
    max-width: 100%;
  }
  
  .notification {
    padding: 12px 16px;
  }
  
  .notification-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}