/* =========================================================================
   THE CLUB 777° — PREMIUM GLOBAL TOAST NOTIFICATION SYSTEM
   =========================================================================
   Fully responsive, WCAG accessible, theme-compatible toast notification styles.
   Zero external dependencies, 100% locally hosted.
   ========================================================================= */

:root {
  --toast-success-accent: #059669;
  --toast-success-bg: #ECFDF5;
  --toast-success-progress: #10B981;
  
  --toast-error-accent: #DC2626;
  --toast-error-bg: #FEF2F2;
  --toast-error-progress: #EF4444;
  
  --toast-warning-accent: #D97706;
  --toast-warning-bg: #FFFBEB;
  --toast-warning-progress: #F59E0B;
  
  --toast-info-accent: #2563EB;
  --toast-info-bg: #EFF6FF;
  --toast-info-progress: #3B82F6;
  
  --toast-loading-accent: #8B5CF6;
  --toast-loading-bg: #F5F3FF;
  --toast-loading-progress: #A78BFA;
}

/* Toast Container Stack */
#clubToastContainer,
#toastContainer {
  position: fixed;
  top: 86px;
  right: 24px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

/* Toast Card Base */
.club-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 13px 14px 15px 14px;
  box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-left: 5px solid var(--toast-accent, #2563EB);
  overflow: hidden;
  box-sizing: border-box;
  font-family: var(--font-body, 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif);
  animation: toastSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
  will-change: transform, opacity;
}

/* Type Variations */
.club-toast.toast-success {
  --toast-accent: var(--toast-success-accent);
  --toast-icon-bg: var(--toast-success-bg);
  --toast-progress-color: var(--toast-success-progress);
}

.club-toast.toast-error,
.club-toast.toast-danger {
  --toast-accent: var(--toast-error-accent);
  --toast-icon-bg: var(--toast-error-bg);
  --toast-progress-color: var(--toast-error-progress);
}

.club-toast.toast-warning {
  --toast-accent: var(--toast-warning-accent);
  --toast-icon-bg: var(--toast-warning-bg);
  --toast-progress-color: var(--toast-warning-progress);
}

.club-toast.toast-info {
  --toast-accent: var(--toast-info-accent);
  --toast-icon-bg: var(--toast-info-bg);
  --toast-progress-color: var(--toast-info-progress);
}

.club-toast.toast-loading {
  --toast-accent: var(--toast-loading-accent);
  --toast-icon-bg: var(--toast-loading-bg);
  --toast-progress-color: var(--toast-loading-progress);
}

/* Icon Badge */
.club-toast-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--toast-icon-bg, #EFF6FF);
  color: var(--toast-accent, #2563EB);
}

.club-toast-icon-badge svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Content Container */
.club-toast-content {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.club-toast-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 3px 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.club-toast-message {
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.45;
  margin: 0;
  word-break: break-word;
}

/* Close Button */
.club-toast-close {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  margin: -2px -2px 0 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, transform 0.1s;
}

.club-toast-close:hover,
.club-toast-close:focus-visible {
  color: #0F172A;
  background: #F1F5F9;
  outline: none;
}

.club-toast-close svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* Progress Countdown Bar */
.club-toast-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: rgba(226, 232, 240, 0.4);
}

.club-toast-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--toast-progress-color, #3B82F6);
  transform-origin: left;
  animation: toastProgressBar linear forwards;
}

/* Pause countdown on hover or focus */
.club-toast:hover .club-toast-progress-bar,
.club-toast:focus-within .club-toast-progress-bar {
  animation-play-state: paused;
}

/* Exit / Hiding Animation */
.club-toast.toast-hiding {
  transform: translateX(115%) scale(0.96);
  opacity: 0;
  pointer-events: none;
}

/* Keyframe Animations */
@keyframes toastSlideIn {
  0% {
    transform: translateX(115%) scale(0.96);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastSlideInMobile {
  0% {
    transform: translateY(-30px) scale(0.96);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastProgressBar {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

@keyframes toastSpinnerRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.toast-spinner {
  animation: toastSpinnerRotate 0.85s linear infinite;
}

/* Responsive Placement for Mobile & Small Tablets */
@media (max-width: 640px) {
  #clubToastContainer,
  #toastContainer {
    top: max(14px, env(safe-area-inset-top, 14px));
    right: 14px;
    left: 14px;
    width: auto;
    max-width: 100%;
    gap: 8px;
  }

  .club-toast {
    animation-name: toastSlideInMobile;
    padding: 11px 12px 13px 12px;
    border-radius: 12px;
  }

  .club-toast.toast-hiding {
    transform: translateY(-24px) scale(0.96);
    opacity: 0;
  }

  .club-toast-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .club-toast-icon-badge svg {
    width: 18px;
    height: 18px;
  }

  .club-toast-title {
    font-size: 0.84rem;
  }

  .club-toast-message {
    font-size: 0.78rem;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .club-toast {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }
  .club-toast.toast-hiding {
    transform: none !important;
    opacity: 0 !important;
  }
  .club-toast-progress-bar {
    animation: none !important;
    display: none;
  }
  .toast-spinner {
    animation-duration: 2s !important;
  }
}
