/* ==================== MODERN NOTIFICATION SYSTEM ==================== */

#notification-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
  max-width: 420px;
}

/* ===== NOTIFICATION CARD ===== */
.notification {
  min-width: 360px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateX(500px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
  position: relative;
  overflow: hidden;
}

/* Background gradient subtle */
.notification::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* All content above gradient */
.notification > * {
  position: relative;
  z-index: 1;
}

/* Animation xuất hiện */
.notification.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Animation ẩn */
.notification.hide {
  opacity: 0;
  transform: translateX(500px) scale(0.85);
  transition: all 0.3s cubic-bezier(0.4, 0, 1, 1);
}

/* ===== ICON CONTAINER ===== */
.notification-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 22px;
  transition: transform 0.3s ease;
}

.notification:hover .notification-icon {
  transform: scale(1.1) rotate(5deg);
}

/* ===== CONTENT ===== */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  font-size: 14.5px;
  line-height: 1.6;
  color: #1e293b;
  font-weight: 600;
  word-wrap: break-word;
  letter-spacing: -0.01em;
}

/* ===== CLOSE BUTTON ===== */
.notification-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
  opacity: 0;
}

.notification:hover .notification-close {
  opacity: 1;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1e293b;
  transform: rotate(90deg);
}

/* ===== PROGRESS BAR ===== */
.notification::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  transform-origin: left;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

/* ==================== NOTIFICATION TYPES ==================== */

/* SUCCESS - Green */
.notification-success {
  border: 2px solid rgba(34, 197, 94, 0.2);
}

.notification-success .notification-icon {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.notification-success::before {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  animation: progress 3s linear forwards;
}

/* ERROR - Red */
.notification-error {
  border: 2px solid rgba(239, 68, 68, 0.2);
}

.notification-error .notification-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.notification-error::before {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  animation: progress 3s linear forwards;
}

/* WARNING - Orange/Yellow */
.notification-warning {
  border: 2px solid rgba(245, 158, 11, 0.2);
}

.notification-warning .notification-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.notification-warning::before {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  animation: progress 3s linear forwards;
}

/* INFO - Blue */
.notification-info {
  border: 2px solid rgba(59, 130, 246, 0.2);
}

.notification-info .notification-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.notification-info::before {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  animation: progress 3s linear forwards;
}

/* ===== PROGRESS ANIMATION ===== */
@keyframes progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ===== HOVER EFFECTS ===== */
.notification:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 640px) {
  #notification-container {
    top: auto;
    bottom: 20px;
    left: 16px;
    right: 16px;
    max-width: 100%;
  }

  .notification {
    min-width: 100%;
    max-width: 100%;
    padding: 16px 18px;
    transform: translateY(200px) scale(0.9);
  }

  .notification.show {
    transform: translateY(0) scale(1);
  }

  .notification.hide {
    transform: translateY(200px) scale(0.85);
  }

  .notification-message {
    font-size: 14px;
  }

  .notification-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

/* ==================== DARK MODE ==================== */

@media (prefers-color-scheme: dark) {
  .notification {
    background: rgba(30, 41, 59, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .notification::after {
    background: linear-gradient(
      135deg,
      transparent 0%,
      rgba(255, 255, 255, 0.05) 100%
    );
  }

  .notification-message {
    color: #f1f5f9;
  }

  .notification-close {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
  }

  .notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
  }

  /* Dark borders */
  .notification-success {
    border: 2px solid rgba(34, 197, 94, 0.3);
  }

  .notification-error {
    border: 2px solid rgba(239, 68, 68, 0.3);
  }

  .notification-warning {
    border: 2px solid rgba(245, 158, 11, 0.3);
  }

  .notification-info {
    border: 2px solid rgba(59, 130, 246, 0.3);
  }
}

/* ==================== SPECIAL EFFECTS ==================== */

/* Pulse animation on appear */
@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.notification-icon::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  background: inherit;
  opacity: 0;
  z-index: -1;
}

.notification.show .notification-icon::before {
  animation: pulse-ring 0.6s ease-out;
}

/* Smooth entrance stagger for multiple notifications */
.notification:nth-child(1) {
  transition-delay: 0s;
}

.notification:nth-child(2) {
  transition-delay: 0.05s;
}

.notification:nth-child(3) {
  transition-delay: 0.1s;
}

.notification:nth-child(4) {
  transition-delay: 0.15s;
}

.notification:nth-child(5) {
  transition-delay: 0.2s;
}
