/* ============================================
   TP-TOAST — Premium Notification System
   Shared by pelanggan & admin
   ============================================ */

/* Container: fixed top-right */
.tp-toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 2rem);
}

/* Toast Base */
.tp-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15,23,42,0.06);
  padding: 1rem 1rem 1.25rem;
  position: relative;
  overflow: hidden;
  pointer-events: all;
  border-left: 4px solid transparent;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}

.tp-toast.tp-toast--out {
  animation: toastSlideOut 0.4s ease forwards;
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); max-height: 200px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(110%); max-height: 0; margin-bottom: -0.65rem; padding: 0; }
}

/* Icon */
.tp-toast__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-top: 1px;
}

/* Body */
.tp-toast__body { flex: 1; min-width: 0; }

.tp-toast__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

.tp-toast__msg {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.45;
  word-break: break-word;
}

/* Close Button */
.tp-toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  line-height: 1;
  margin-top: -2px;
}
.tp-toast__close:hover { background: rgba(0,0,0,0.07); }

/* Progress Bar */
.tp-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 14px;
  animation: toastProgress 4s linear forwards;
  width: 100%;
}

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

/* ---- Variant: Success ---- */
.tp-toast--success {
  border-left-color: #22c55e;
}
.tp-toast--success .tp-toast__icon {
  background: #dcfce7;
  color: #16a34a;
}
.tp-toast--success .tp-toast__label { color: #16a34a; }
.tp-toast--success .tp-toast__close { color: #16a34a; }
.tp-toast--success .tp-toast__progress { background: #22c55e; }

/* ---- Variant: Error ---- */
.tp-toast--error {
  border-left-color: #ef4444;
}
.tp-toast--error .tp-toast__icon {
  background: #fee2e2;
  color: #dc2626;
}
.tp-toast--error .tp-toast__label { color: #dc2626; }
.tp-toast--error .tp-toast__close { color: #dc2626; }
.tp-toast--error .tp-toast__progress { background: #ef4444; }

/* ---- Variant: Warning ---- */
.tp-toast--warning {
  border-left-color: #f59e0b;
}
.tp-toast--warning .tp-toast__icon {
  background: #fef9c3;
  color: #d97706;
}
.tp-toast--warning .tp-toast__label { color: #d97706; }
.tp-toast--warning .tp-toast__close { color: #d97706; }
.tp-toast--warning .tp-toast__progress { background: #f59e0b; }

/* ---- Variant: Info ---- */
.tp-toast--info {
  border-left-color: #3b82f6;
}
.tp-toast--info .tp-toast__icon {
  background: #eff6ff;
  color: #2563eb;
}
.tp-toast--info .tp-toast__label { color: #2563eb; }
.tp-toast--info .tp-toast__close { color: #2563eb; }
.tp-toast--info .tp-toast__progress { background: #3b82f6; }

/* Responsive */
@media (max-width: 480px) {
  .tp-toast-container {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: 100%;
    width: auto;
  }
}
