/* WorkTime - Animated Alerts & Modern Toast Notification System */

/* Container for Floating Toast Alerts */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

@media (max-width: 576px) {
  #toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

/* Base Toast Item */
.wt-toast {
  pointer-events: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 35px -5px rgba(16, 45, 99, 0.15), 0 0 0 1px rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  animation: toastSpringIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.wt-toast.hiding {
  animation: toastSlideOut 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Toast Variants */
.wt-toast-success {
  border-left: 5px solid #10b981;
}
.wt-toast-error {
  border-left: 5px solid #ef4444;
}
.wt-toast-warning {
  border-left: 5px solid #f59e0b;
}
.wt-toast-info {
  border-left: 5px solid #1677f2;
}

/* Toast Icon Wrapper with Pulse Glow */
.wt-toast-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  animation: toastIconPulse 2s infinite;
}

.wt-toast-success .wt-toast-icon-wrap {
  background: #ecfdf5;
  color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}
.wt-toast-error .wt-toast-icon-wrap {
  background: #fef2f2;
  color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}
.wt-toast-warning .wt-toast-icon-wrap {
  background: #fffbeb;
  color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}
.wt-toast-info .wt-toast-icon-wrap {
  background: #eff6ff;
  color: #1677f2;
  box-shadow: 0 0 12px rgba(22, 119, 242, 0.25);
}

/* Toast Content */
.wt-toast-body {
  flex: 1;
  min-width: 0;
}
.wt-toast-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}
.wt-toast-message {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

/* Toast Close Button */
.wt-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}
.wt-toast-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

/* Animated Countdown Progress Bar */
.wt-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}

.wt-toast-success .wt-toast-progress { background: linear-gradient(90deg, #10b981, #059669); }
.wt-toast-error .wt-toast-progress   { background: linear-gradient(90deg, #ef4444, #dc2626); }
.wt-toast-warning .wt-toast-progress { background: linear-gradient(90deg, #f59e0b, #d97706); }
.wt-toast-info .wt-toast-progress    { background: linear-gradient(90deg, #1677f2, #0d5ec4); }

/* In-Page Static Alert Animation (for PHP render_alerts) */
.animated-page-alert {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  animation: alertBounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.animated-page-alert.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.animated-page-alert.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.animated-page-alert.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.animated-page-alert.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* Keyframe Animations */
@keyframes toastSpringIn {
  0% {
    opacity: 0;
    transform: translateY(-25px) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translateY(4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(110%) scale(0.92);
  }
}

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

@keyframes toastIconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

@keyframes alertBounceIn {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

