/* ============================= */
/*    XPLORE TOAST SYSTEM        */
/*    Unified Notification UI    */
/* ============================= */

/* --- Container --- */
.xplore-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, calc(100% - 48px));
  pointer-events: none;
}

/* --- Toast base --- */
.xplore-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 14px 20px;
  border-radius: 12px;
  background: rgba(10, 25, 47, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 174, 239, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 174, 239, 0.05);
  color: #F5F7FA;
  pointer-events: auto;
  overflow: hidden;
  animation: xploreToastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
  will-change: transform, opacity;
}

/* --- Left accent bar --- */
.xplore-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: #00AEEF;
}

/* --- Icon circle --- */
.xplore-toast__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(0, 174, 239, 0.15);
  color: #00AEEF;
}

/* --- Content area --- */
.xplore-toast__content {
  flex: 1;
  min-width: 0;
}

.xplore-toast__title {
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.3;
  color: #F5F7FA;
  margin-bottom: 2px;
}

.xplore-toast__message {
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(245, 247, 250, 0.75);
  word-break: break-word;
}

/* When no title, message uses slightly larger font */
.xplore-toast__content:not(:has(.xplore-toast__title)) .xplore-toast__message {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #F5F7FA;
}

/* --- Close button --- */
.xplore-toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(245, 247, 250, 0.4);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  margin-top: -2px;
}

.xplore-toast__close:hover {
  background: rgba(245, 247, 250, 0.1);
  color: rgba(245, 247, 250, 0.8);
}

/* --- Progress bar --- */
.xplore-toast__progress {
  position: absolute;
  left: 4px;
  bottom: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 174, 239, 0.3);
  transform-origin: left;
  border-radius: 0 0 12px 0;
}

.xplore-toast__progress-bar {
  height: 100%;
  border-radius: 0 0 12px 0;
  background: #00AEEF;
  transform-origin: left;
  animation: xploreToastProgress var(--xplore-toast-duration, 5000ms) linear forwards;
}

/* ============================= */
/*    TYPE VARIANTS              */
/* ============================= */

/* --- Success --- */
.xplore-toast--success::before {
  background: #00FFAF;
}
.xplore-toast--success .xplore-toast__icon {
  background: rgba(0, 255, 175, 0.15);
  color: #00FFAF;
}
.xplore-toast--success .xplore-toast__progress {
  background: rgba(0, 255, 175, 0.15);
}
.xplore-toast--success .xplore-toast__progress-bar {
  background: #00FFAF;
}

/* --- Warning --- */
.xplore-toast--warning::before {
  background: #F59E0B;
}
.xplore-toast--warning .xplore-toast__icon {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}
.xplore-toast--warning .xplore-toast__progress {
  background: rgba(245, 158, 11, 0.15);
}
.xplore-toast--warning .xplore-toast__progress-bar {
  background: #F59E0B;
}

/* --- Error / Danger --- */
.xplore-toast--error::before,
.xplore-toast--danger::before {
  background: #EF4444;
}
.xplore-toast--error .xplore-toast__icon,
.xplore-toast--danger .xplore-toast__icon {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}
.xplore-toast--error .xplore-toast__progress,
.xplore-toast--danger .xplore-toast__progress {
  background: rgba(239, 68, 68, 0.15);
}
.xplore-toast--error .xplore-toast__progress-bar,
.xplore-toast--danger .xplore-toast__progress-bar {
  background: #EF4444;
}

/* --- Info (default) --- */
.xplore-toast--info::before {
  background: #00AEEF;
}
.xplore-toast--info .xplore-toast__icon {
  background: rgba(0, 174, 239, 0.15);
  color: #00AEEF;
}
.xplore-toast--info .xplore-toast__progress {
  background: rgba(0, 174, 239, 0.15);
}
.xplore-toast--info .xplore-toast__progress-bar {
  background: #00AEEF;
}

/* ============================= */
/*    EXIT ANIMATION             */
/* ============================= */

.xplore-toast--exit {
  animation: xploreToastOut 0.3s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

/* Pause progress on hover */
.xplore-toast:hover .xplore-toast__progress-bar {
  animation-play-state: paused;
}

/* ============================= */
/*    KEYFRAMES                  */
/* ============================= */

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

@keyframes xploreToastOut {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 200px;
    margin-bottom: 0;
  }
  to {
    opacity: 0;
    transform: translateX(100%);
    max-height: 0;
    margin-bottom: -12px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

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

/* ============================= */
/*    RESPONSIVE                 */
/* ============================= */

@media (max-width: 576px) {
  .xplore-toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .xplore-toast {
    padding: 12px 14px 12px 18px;
  }

  .xplore-toast__icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .xplore-toast__title {
    font-size: 0.875rem;
  }

  .xplore-toast__message {
    font-size: 0.8125rem;
  }
}
