.notification {
  position: fixed;
  display: flex;
  flex-direction: row;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  gap: 0.875rem;
  padding: 1.125rem 1.25rem;
  border-radius: 0.75rem;
  z-index: 50;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform: translateY(-100%);
  opacity: 0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  align-items: center;
  max-width: 100%;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification:hover {
  transform: scale(1.02);
}

.notification-success:hover {
  box-shadow: 0 10px 30px -5px rgba(16, 185, 129, 0.4), 0 8px 15px -6px rgba(5, 150, 105, 0.3);
}

.notification-error:hover {
  box-shadow: 0 10px 30px -5px rgba(239, 68, 68, 0.4), 0 8px 15px -6px rgba(220, 38, 38, 0.3);
}

.notification:active {
  cursor: grabbing;
  transform: scale(1.01);
}

/* Swipe hint indicator */
.notification::after {
  content: '';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.notification:hover::after {
  opacity: 1;
}

/* Close button - more visible */
.close-button {
  margin-left: auto;
  border-radius: 0.5rem;
  padding: 0.375rem;
  display: inline-flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.close-button-success {
  background-color: rgba(255, 255, 255, 0.35);
  color: #065f46;
}

.close-button-error {
  background-color: rgba(255, 255, 255, 0.35);
  color: #7f1d1d;
}

.close-button:hover {
  transform: scale(1.05);
}

.close-button-success:hover {
  background-color: rgba(255, 255, 255, 0.85);
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.3), 0 0 20px rgba(16, 185, 129, 0.2);
}

.close-button-error:hover {
  background-color: rgba(255, 255, 255, 0.85);
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 12px rgba(127, 29, 29, 0.3), 0 0 20px rgba(239, 68, 68, 0.2);
}

.close-button:active {
  transform: scale(0.9);
  box-shadow: none;
}

.close-icon {
  height: 1.25rem;
  width: 1.25rem;
}

.notification-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: 500;
}

.notification-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-weight: 500;
}

/* Notification text styling */
.notification-text {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

@keyframes slideDown {
  0% {
    transform: translateY(calc(-100% - 1rem));
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Swipe out animation - like phone notifications */
.notification-swipe-out-right {
  animation: none !important;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out !important;
  transform: translateX(calc(100% + 2rem)) !important;
  opacity: 0 !important;
}

/* Close animation - smooth fade with slight slide */
.notification-close {
  animation: none !important;
  transition: transform 0.35s ease-out, opacity 0.35s ease-out !important;
  transform: translateX(100%) !important;
  opacity: 0 !important;
}

/* Progress bar for auto-close timer */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 0 0.75rem 0.75rem;
  animation: progressBar 5.5s linear forwards;
}

@keyframes progressBar {
  0% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}

/* Swipe hint tooltip on mobile */
@media only screen and (max-width: 639px) {
  .notification {
    padding-right: 1rem;
  }

  .notification::after {
    opacity: 0.5;
    animation: pulseHint 2s ease-in-out 2s infinite;
  }

  @keyframes pulseHint {
    0%, 100% {
      opacity: 0.3;
      transform: translateY(-50%) translateX(0);
    }
    50% {
      opacity: 0.7;
      transform: translateY(-50%) translateX(3px);
    }
  }
}

@media only screen and (min-width: 640px) {
  .notification {
    left: auto;
    right: 1rem;
    max-width: 28rem;
  }
}

@media only screen and (min-width: 1024px) {
  .notification {
    top: 1.5rem;
    right: 1.5rem;
    max-width: 32rem;
    padding: 1.25rem 1.5rem;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateX(100%);
  }

  @keyframes slideInRight {
    0% {
      transform: translateX(100%);
      opacity: 0;
    }
    100% {
      transform: translateX(0);
      opacity: 1;
    }
  }

  .notification::after {
    display: none;
  }
}
