/*TOAST - Glass Slide with Circular Timer*/
/*Updated to match SweetAlert glassmorphism style*/
/*Refined version with gradient icons and polished styling*/
:root {
  --toast-success: #4caf50;
  --toast-error: #b52b22;
  --toast-warning: #ff9800;
  --toast-info: #f7941d;
  --toast-title: #222;
  --toast-text: #666;
}

/* Toast container positioned at top-right */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1200;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Base toast style - refined glassmorphism */
.toast {
  position: relative;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  min-width: 280px;
  max-width: 340px;
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast:not(.active) {
  transform: translateX(calc(100% + 30px));
  opacity: 0;
}

/* Active state - slide in */
.toast.active {
  transform: translateX(0);
  opacity: 1;
}

/* Hiding state - fast slide out */
.toast.hiding {
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.55, 0, 1, 0.45),
              opacity 0.2s ease-out;
}

.toast .toast-content {
  display: flex;
  align-items: center;
}

/* Outline circle icon style */
.toast-content .check {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  background: transparent;
  border: 2px solid var(--toast-info);
  color: var(--toast-info);
  font-size: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-content .message {
  display: flex;
  flex-direction: column;
  margin: 0 14px;
  flex: 1;
  min-width: 0;
}

.message .text {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--toast-text);
  line-height: 1.35;
}

.message .text.text-1 {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--toast-title);
  margin-bottom: 2px;
}

/* Close button - hidden by default, use ring instead */
.toast .close {
  display: none;
}

/* Circular progress ring */
.toast .progress-ring {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

.toast .progress-ring:hover {
  opacity: 1;
  transform: scale(1.1);
}

.toast .progress-ring circle {
  fill: none;
  stroke-width: 2.5;
  cx: 13;
  cy: 13;
  r: 10;
}

.toast .progress-ring .ring-bg {
  stroke: rgba(0, 0, 0, 0.08);
}

.toast .progress-ring .ring-progress {
  stroke: var(--toast-info);
  stroke-linecap: round;
  stroke-dasharray: 62.83;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: center;
}

.toast.active .progress-ring .ring-progress {
  animation: ringCountdown 5s linear forwards;
}

@keyframes ringCountdown {
  to {
    stroke-dashoffset: 62.83;
  }
}

/* X icon in center of ring */
.toast .progress-ring .close-icon {
  stroke: rgba(0, 0, 0, 0.35);
  transition: stroke 0.2s;
}

.toast .progress-ring:hover .close-icon {
  stroke: rgba(0, 0, 0, 0.7);
}

/* Hide old progress bar */
.toast .progress {
  display: none;
}

/* ========== Toast Type Variants ========== */

/* Success */
.toast.success .check {
  border-color: var(--toast-success);
  color: var(--toast-success);
}
.toast.success .progress-ring .ring-progress {
  stroke: var(--toast-success);
}

/* Error */
.toast.error .check {
  border-color: var(--toast-error);
  color: var(--toast-error);
}
.toast.error .progress-ring .ring-progress {
  stroke: var(--toast-error);
}

/* Warning */
.toast.warning .check {
  border-color: var(--toast-warning);
  color: var(--toast-warning);
}
.toast.warning .progress-ring .ring-progress {
  stroke: var(--toast-warning);
}

/* Info (default) */
.toast.info .check {
  border-color: var(--toast-info);
  color: var(--toast-info);
}
.toast.info .progress-ring .ring-progress {
  stroke: var(--toast-info);
}

/* ========== Dark Theme ========== */
[data-bs-theme="dark"] .toast {
  background: rgba(45, 45, 45, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .toast .message .text.text-1 {
  color: #f1f5f9;
}

[data-bs-theme="dark"] .toast .message .text {
  color: #94a3b8;
}

[data-bs-theme="dark"] .toast .progress-ring .ring-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .toast .progress-ring .close-icon {
  stroke: rgba(255, 255, 255, 0.4);
}

[data-bs-theme="dark"] .toast .progress-ring:hover .close-icon {
  stroke: rgba(255, 255, 255, 0.9);
}