/* ==========================================================================
   HoplaCollect Toast Notifications
   ========================================================================== */

.hc-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.hc-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  overflow: hidden;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.hc-toast[data-visible="true"] {
  transform: translateX(0);
  opacity: 1;
}

.hc-toast[data-visible="false"] {
  transform: translateX(120%);
  opacity: 0;
}

/* Toast types */
.hc-toast[data-type="success"] {
  border-left: 4px solid #22c55e;
}

.hc-toast[data-type="error"] {
  border-left: 4px solid #ef4444;
}

.hc-toast[data-type="warning"] {
  border-left: 4px solid #f59e0b;
}

.hc-toast[data-type="info"] {
  border-left: 4px solid #3b82f6;
}

/* Icon */
.hc-toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.hc-toast[data-type="success"] .hc-toast-icon {
  background: #dcfce7;
  color: #22c55e;
}

.hc-toast[data-type="error"] .hc-toast-icon {
  background: #fee2e2;
  color: #ef4444;
}

.hc-toast[data-type="warning"] .hc-toast-icon {
  background: #fef3c7;
  color: #f59e0b;
}

.hc-toast[data-type="info"] .hc-toast-icon {
  background: #dbeafe;
  color: #3b82f6;
}

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

/* Content */
.hc-toast-content {
  flex: 1;
  min-width: 0;
}

.hc-toast-message {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #1f2937;
  word-wrap: break-word;
}

/* Close button */
.hc-toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #9ca3af;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

.hc-toast-close:hover {
  background: #f3f4f6;
  color: #6b7280;
}

.hc-toast-close svg {
  width: 14px;
  height: 14px;
}

/* Progress bar */
.hc-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

.hc-toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  transition: transform linear;
}

.hc-toast[data-type="success"] .hc-toast-progress-bar {
  background: #22c55e;
}

.hc-toast[data-type="error"] .hc-toast-progress-bar {
  background: #ef4444;
}

.hc-toast[data-type="warning"] .hc-toast-progress-bar {
  background: #f59e0b;
}

.hc-toast[data-type="info"] .hc-toast-progress-bar {
  background: #3b82f6;
}

/* Pause on hover */
.hc-toast:hover .hc-toast-progress-bar {
  animation-play-state: paused !important;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 480px) {
  .hc-toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }

  .hc-toast {
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 14px;
  }

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

/* Stacking animation for multiple toasts */
.hc-toast:nth-child(n+4) {
  opacity: 0.6;
  transform: scale(0.95) translateX(0);
}

.hc-toast:nth-child(n+5) {
  display: none;
}

/* Dark mode support (optional, follows system preference) */
@media (prefers-color-scheme: dark) {
  .hc-toast {
    background: #1f2937;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .hc-toast-message {
    color: #f9fafb;
  }

  .hc-toast-close {
    color: #6b7280;
  }

  .hc-toast-close:hover {
    background: #374151;
    color: #9ca3af;
  }

  .hc-toast-progress {
    background: #374151;
  }

  .hc-toast[data-type="success"] .hc-toast-icon {
    background: rgba(34, 197, 94, 0.2);
  }

  .hc-toast[data-type="error"] .hc-toast-icon {
    background: rgba(239, 68, 68, 0.2);
  }

  .hc-toast[data-type="warning"] .hc-toast-icon {
    background: rgba(245, 158, 11, 0.2);
  }

  .hc-toast[data-type="info"] .hc-toast-icon {
    background: rgba(59, 130, 246, 0.2);
  }
}
