/* ==========================================================================
   POS DESIGN SYSTEM - FLOATING TOAST NOTIFICATION MODULE
   File: pos/_pos_toast.css
   ========================================================================== */

#pos-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 40px);
}

.pos-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  animation: posToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
}

.pos-toast--hiding {
  animation: posToastOut 0.25s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes posToastIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes posToastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
  }
}

/* Icon Badge */
.pos-toast__icon-wrap {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.pos-toast__icon-wrap svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

/* Content Text */
.pos-toast__content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.pos-toast__title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-toast__subtitle {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748B;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Close Button */
.pos-toast__close {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-left: 4px;
}

.pos-toast__close:hover {
  color: #0F172A;
  background: rgba(15, 23, 42, 0.06);
}

.pos-toast__close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* Progress bar animation */
.pos-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(15, 23, 42, 0.08);
  transform-origin: left;
}

.pos-toast__progress-bar {
  height: 100%;
  width: 100%;
  border-radius: 0 2px 2px 0;
  animation: posToastProgress 3s linear forwards;
}

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

/* Specific Variant Themes */

/* 1. Kitchen Send */
.pos-toast--kitchen {
  border-left: 4px solid #10B981;
}
.pos-toast--kitchen .pos-toast__icon-wrap {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.pos-toast--kitchen .pos-toast__progress-bar {
  background: #10B981;
}

/* 2. Pre-bill Print */
.pos-toast--prebill {
  border-left: 4px solid #2563EB;
}
.pos-toast--prebill .pos-toast__icon-wrap {
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
}
.pos-toast--prebill .pos-toast__progress-bar {
  background: #2563EB;
}

/* 3. Payment Checkout */
.pos-toast--payment {
  border-left: 4px solid #059669;
}
.pos-toast--payment .pos-toast__icon-wrap {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}
.pos-toast--payment .pos-toast__progress-bar {
  background: #059669;
}

/* 4. Warning / Error */
.pos-toast--timeclock {
  border-left: 4px solid #10B981;
}
.pos-toast--timeclock .pos-toast__icon-wrap {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}
.pos-toast--timeclock .pos-toast__progress-bar {
  background: #10B981;
}

.pos-toast--warning {
  border-left: 4px solid #F59E0B;
}
.pos-toast--warning .pos-toast__icon-wrap {
  background: rgba(245, 158, 11, 0.15);
  color: #D97706;
}
.pos-toast--warning .pos-toast__progress-bar {
  background: #F59E0B;
}

.pos-toast--error {
  border-left: 4px solid #EF4444;
}
.pos-toast--error .pos-toast__icon-wrap {
  background: rgba(239, 68, 68, 0.15);
  color: #DC2626;
}
.pos-toast--error .pos-toast__progress-bar {
  background: #EF4444;
}

/* Dark Theme Support */
body.dark-theme .pos-toast {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
body.dark-theme .pos-toast__title {
  color: #F8FAFC;
}
body.dark-theme .pos-toast__subtitle {
  color: #94A3B8;
}
body.dark-theme .pos-toast__close {
  color: #64748B;
}
body.dark-theme .pos-toast__close:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.1);
}
