/* =====================================================================
   EDMCalendar Toast / Popup Notification System
   ===================================================================== */

/* Container */
#edc-toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 360px;
  max-width: calc(100vw - 32px);
}

/* Toast Base */
.edc-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10,11,26,0.97);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 6px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
  cursor: default;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.36s cubic-bezier(0.34,1.2,0.64,1), opacity 0.28s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  border-left: 3px solid var(--tc, rgba(255,255,255,0.2));
}
.edc-toast.edc-in  { transform: translateX(0); opacity: 1; }
.edc-toast.edc-out { transform: translateX(calc(100% + 24px)); opacity: 0; transition: transform 0.28s cubic-bezier(0.4,0,1,1), opacity 0.22s ease; }
.edc-toast.edc-swipe { transform: translateX(-120%); opacity: 0; transition: transform 0.25s ease, opacity 0.2s ease; }
.edc-toast:hover { box-shadow: 0 10px 40px rgba(0,0,0,0.65), 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06); }

/* Glow blob */
.edc-toast::before {
  content: "";
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tc, rgba(255,255,255,0.05)), transparent 70%);
  top: -24px; right: 10px;
  opacity: 0.35;
  pointer-events: none;
}

/* Icon */
.edc-toast__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1rem; flex-shrink: 0;
  background: var(--tib, rgba(255,255,255,0.06));
  color: var(--tc, #fff);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.2s ease;
  line-height: 1;
}
.edc-toast:hover .edc-toast__icon { transform: scale(1.08); }

/* Body */
.edc-toast__body { flex: 1; min-width: 0; }
.edc-toast__title {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.84rem; font-weight: 700;
  color: #eef0ff; line-height: 1.3; margin: 0 0 3px;
  letter-spacing: -0.01em;
}
.edc-toast__msg {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.77rem; color: #9ba4cc;
  line-height: 1.5; margin: 0; word-break: break-word;
}

/* Close */
.edc-toast__close {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #5e6899; cursor: pointer;
  display: grid; place-items: center;
  font-size: 0.7rem; flex-shrink: 0; margin-top: 2px;
  transition: all 0.18s ease; font-family: inherit;
}
.edc-toast__close:hover { background: rgba(255,255,255,0.12); color: #eef0ff; border-color: rgba(255,255,255,0.18); }

/* Progress */
.edc-toast__progress {
  position: absolute; bottom: 0; left: 0;
  height: 2px; width: 100%;
  background: rgba(255,255,255,0.07);
  border-radius: 0 0 14px 14px; overflow: hidden;
}
.edc-toast__progress-bar {
  height: 100%; width: 100%;
  background: var(--tc, rgba(255,255,255,0.4));
  border-radius: inherit;
  transform-origin: left center;
  animation: edc-prog linear forwards;
  animation-duration: var(--td, 4000ms);
}
@keyframes edc-prog { from { transform:scaleX(1); } to { transform:scaleX(0); } }

/* Variants */
.edc-toast--success { --tc: #10b981; --tib: rgba(16,185,129,0.14); border-left-color: #10b981; }
.edc-toast--error   { --tc: #f87171; --tib: rgba(248,113,113,0.14); border-left-color: #f87171; }
.edc-toast--warning { --tc: #fbbf24; --tib: rgba(251,191,36,0.14);  border-left-color: #fbbf24; }
.edc-toast--info    { --tc: #60a5fa; --tib: rgba(96,165,250,0.14);  border-left-color: #60a5fa; }
.edc-toast--loading { --tc: #a78bfa; --tib: rgba(167,139,250,0.14); border-left-color: #a78bfa; }
.edc-toast--loading .edc-toast__icon { animation: edc-spin 1s linear infinite; }
@keyframes edc-spin { to { transform: rotate(360deg); } }

/* Mobile - slide from bottom */
@media (max-width: 600px) {
  #edc-toast-root {
    top: auto; bottom: 16px;
    right: 10px; left: 10px;
    width: auto; max-width: 100%;
    flex-direction: column-reverse;
  }
  .edc-toast           { transform: translateY(calc(100% + 24px)); }
  .edc-toast.edc-in    { transform: translateY(0); }
  .edc-toast.edc-out   { transform: translateY(calc(100% + 24px)); }
  .edc-toast.edc-swipe { transform: translateX(-110%); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .edc-toast, .edc-toast.edc-in, .edc-toast.edc-out { transition: opacity 0.15s ease !important; transform: none !important; }
  .edc-toast__progress-bar { animation: none !important; }
  .edc-toast--loading .edc-toast__icon { animation: none !important; }
}
