/* notifications.css - Revamped Notification System */

.notification-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  max-height: 70vh;
  overflow-y: auto;
  width: 320px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.notification-container::-webkit-scrollbar {
  width: 4px;
}

.notification-container::-webkit-scrollbar-track {
  background: transparent;
}

.notification-container::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 2px;
}

.notification {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  background-color: var(--card-bg);
  border-left: 3px solid var(--primary-color);
  pointer-events: auto;
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-height: 120px;
  overflow: hidden;
  backdrop-filter: blur(5px);
}

.notification-hide {
  transform: translateX(120%);
  opacity: 0;
}

.notification-content {
  flex: 1;
  margin-right: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  max-height: 5.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.notification-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 0.7;
}

.notification-close:hover {
  opacity: 1;
  background-color: var(--hover-bg);
  color: var(--text-color);
}

.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  animation: progress linear forwards;
  opacity: 0.5;
}

@keyframes progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Notification Types */
.notification-info {
  border-left-color: var(--info-color);
}

.notification-info .notification-progress {
  background-color: var(--info-color);
}

.notification-success {
  border-left-color: var(--success-color);
}

.notification-success .notification-progress {
  background-color: var(--success-color);
}

.notification-warning {
  border-left-color: var(--warning-color);
}

.notification-warning .notification-progress {
  background-color: var(--warning-color);
}

.notification-error {
  border-left-color: var(--danger-color);
}

.notification-error .notification-progress {
  background-color: var(--danger-color);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .notification-container {
    width: calc(100% - 2rem);
    left: 1rem;
    right: auto;
    bottom: 1rem;
  }
  
  .notification {
    width: 100%;
    max-width: 100%;
  }
}

.notification-error .notification-progress {
  background-color: var(--danger-color);
}

@keyframes notification-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes notification-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

/* Header alerts */
.header-alert {
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 500;
  position: relative;
}

.header-alert.info {
  background-color: var(--info-color-light);
  color: var(--info-color-dark);
}

.header-alert.success {
  background-color: var(--success-color-light);
  color: var(--success-color-dark);
}

.header-alert.warning {
  background-color: var(--warning-color-light);
  color: var(--warning-color-dark);
}

.header-alert.error {
  background-color: var(--danger-color-light);
  color: var(--danger-color-dark);
}

.header-alert-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-alert-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  border-radius: 8px;
  font-weight: 500;
  z-index: 9999;
  animation: toast-fade-in 0.3s ease forwards;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
}

.toast-hide {
  animation: toast-fade-out 0.3s ease forwards;
}

@keyframes toast-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, 1rem);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toast-fade-out {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 1rem);
  }
}
