/* Toast Notifications - Ultra Pro Modern Design */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
  max-width: 420px;
}

.toast {
  position: relative;
  min-width: 360px;
  max-width: 420px;
  padding: 20px 24px;
  border-radius: 24px;
  pointer-events: all;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 2px 4px rgba(255, 255, 255, 1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.02);
  animation: toastSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: top right;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.toast:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.18),
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 2px 4px rgba(255, 255, 255, 1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.02);
  border-color: rgba(255, 255, 255, 1);
}

.toast:active {
  transform: translateY(-2px) scale(1.01);
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.toast-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.04),
    inset 0 2px 4px rgba(255, 255, 255, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast:hover .toast-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 6px 16px rgba(0, 0, 0, 0.06),
    inset 0 2px 4px rgba(255, 255, 255, 1);
}

.toast-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.toast-text {
  flex: 1;
  padding-top: 4px;
}

.toast-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f0f0f;
  margin: 0 0 6px 0;
  line-height: 1.25;
  letter-spacing: -0.4px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.toast-message {
  font-size: 14px;
  color: #4a4a4a;
  margin: 0;
  line-height: 1.5;
  letter-spacing: -0.2px;
  font-weight: 500;
}

.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 2px;
  position: relative;
  z-index: 3;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(1.15) rotate(90deg);
  color: #333;
}

.toast-close:active {
  transform: scale(0.95);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  width: 100%;
  background: rgba(0, 0, 0, 0.04);
}

.toast-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.9) 0%, rgba(147, 51, 234, 0.9) 100%);
  backdrop-filter: blur(10px);
  animation: progressBar 3s linear forwards;
  transform-origin: left;
  box-shadow: 0 -2px 8px rgba(59, 130, 246, 0.3);
  position: relative;
}

.toast-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.toast.success {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.95) 0%, rgba(187, 247, 208, 0.9) 100%);
  border-color: rgba(134, 239, 172, 0.7);
}

.toast.success .toast-icon {
  background: linear-gradient(135deg, rgba(134, 239, 172, 0.9) 0%, rgba(74, 222, 128, 0.8) 100%);
  color: #047857;
  border-color: rgba(134, 239, 172, 1);
  box-shadow:
    0 8px 24px rgba(16, 185, 129, 0.25),
    0 4px 12px rgba(16, 185, 129, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.toast.success .toast-progress-bar {
  background: linear-gradient(90deg, rgba(16, 185, 129, 1) 0%, rgba(5, 150, 105, 1) 100%);
  box-shadow: 0 -2px 12px rgba(16, 185, 129, 0.5);
}

.toast.error {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(252, 165, 165, 0.9) 100%);
  border-color: rgba(248, 113, 113, 0.7);
}

.toast.error .toast-icon {
  background: linear-gradient(135deg, rgba(252, 165, 165, 0.9) 0%, rgba(248, 113, 113, 0.8) 100%);
  color: #b91c1c;
  border-color: rgba(252, 165, 165, 1);
  box-shadow:
    0 8px 24px rgba(239, 68, 68, 0.25),
    0 4px 12px rgba(239, 68, 68, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.toast.error .toast-progress-bar {
  background: linear-gradient(90deg, rgba(239, 68, 68, 1) 0%, rgba(220, 38, 38, 1) 100%);
  box-shadow: 0 -2px 12px rgba(239, 68, 68, 0.5);
}

.toast.warning {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.95) 0%, rgba(253, 224, 71, 0.9) 100%);
  border-color: rgba(251, 191, 36, 0.7);
}

.toast.warning .toast-icon {
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.9) 0%, rgba(251, 191, 36, 0.8) 100%);
  color: #b45309;
  border-color: rgba(253, 224, 71, 1);
  box-shadow:
    0 8px 24px rgba(245, 158, 11, 0.25),
    0 4px 12px rgba(245, 158, 11, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.toast.warning .toast-progress-bar {
  background: linear-gradient(90deg, rgba(245, 158, 11, 1) 0%, rgba(217, 119, 6, 1) 100%);
  box-shadow: 0 -2px 12px rgba(245, 158, 11, 0.5);
}

.toast.info {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.95) 0%, rgba(186, 230, 253, 0.9) 100%);
  border-color: rgba(96, 165, 250, 0.7);
}

.toast.info .toast-icon {
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.9) 0%, rgba(96, 165, 250, 0.8) 100%);
  color: #1e40af;
  border-color: rgba(147, 197, 253, 1);
  box-shadow:
    0 8px 24px rgba(59, 130, 246, 0.25),
    0 4px 12px rgba(59, 130, 246, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.toast.info .toast-progress-bar {
  background: linear-gradient(90deg, rgba(59, 130, 246, 1) 0%, rgba(37, 99, 235, 1) 100%);
  box-shadow: 0 -2px 12px rgba(59, 130, 246, 0.5);
}

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateX(120%) scale(0.85) rotate(8deg);
    filter: blur(12px);
  }
  60% {
    transform: translateX(-15px) scale(1.06) rotate(-3deg);
  }
  80% {
    transform: translateX(5px) scale(0.98) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0);
    filter: blur(0);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(150%) scale(0.85) rotate(10deg);
    filter: blur(12px);
  }
}

.toast.removing {
  animation: toastSlideOut 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

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

.toast::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.4) 30%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.4) 70%,
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast:hover::before {
  left: 150%;
}

.toast::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.3), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@media (prefers-color-scheme: dark) {
  .toast {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.9) 100%);
    border-color: rgba(80, 80, 80, 0.8);
    box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.6),
      0 8px 24px rgba(0, 0, 0, 0.4),
      0 2px 8px rgba(0, 0, 0, 0.2),
      inset 0 2px 4px rgba(255, 255, 255, 0.05),
      inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  }

  .toast:hover {
    box-shadow:
      0 28px 80px rgba(0, 0, 0, 0.8),
      0 12px 32px rgba(0, 0, 0, 0.6),
      0 4px 12px rgba(0, 0, 0, 0.4),
      inset 0 2px 4px rgba(255, 255, 255, 0.08),
      inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  }

  .toast-title {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }

  .toast-message {
    color: #b0b0b0;
  }

  .toast-icon {
    background: linear-gradient(135deg, rgba(80, 80, 80, 0.8) 0%, rgba(60, 60, 60, 0.6) 100%);
    border-color: rgba(100, 100, 100, 0.8);
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.2),
      inset 0 2px 4px rgba(255, 255, 255, 0.05);
  }

  .toast-close {
    background: rgba(255, 255, 255, 0.08);
    color: #b0b0b0;
  }

  .toast-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
  }
}

@media (max-width: 768px) {
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: auto;
    max-width: none;
    margin: 0 auto;
    padding: 18px 20px;
  }

  .toast-icon {
    width: 40px;
    height: 40px;
  }

  .toast-icon svg {
    width: 22px;
    height: 22px;
  }

  .toast-title {
    font-size: 15px;
  }

  .toast-message {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    gap: 12px;
  }

  .toast {
    padding: 16px 18px;
    border-radius: 20px;
  }

  .toast-content {
    gap: 12px;
  }

  .toast-icon {
    width: 36px;
    height: 36px;
  }

  .toast-icon svg {
    width: 20px;
    height: 20px;
  }

  .toast-title {
    font-size: 14px;
  }

  .toast-message {
    font-size: 12px;
  }

  .toast-close {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: toastFadeIn 0.3s ease;
  }

  .toast::before,
  .toast::after {
    display: none;
  }

  .toast-progress-bar::after {
    display: none;
  }

  @keyframes toastFadeIn {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
