/**
 * Eduplayify Modern Toast & Confirm Modal System
 * Pure CSS - Ultra Fast, Responsive & RTL-ready
 */

/* ==========================================================================
   Toast Notifications (Floating)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  inset-inline-end: 24px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.toast-item {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 12px 30px -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);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-item.toast-closing {
  animation: toastSlideOut 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateY(-24px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(-24px) scale(0.95);
    opacity: 0;
  }
}

.toast-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon-wrap {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.toast-error .toast-icon-wrap,
.toast-danger .toast-icon-wrap {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.toast-warning .toast-icon-wrap {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.toast-info .toast-icon-wrap {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.toast-content {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.toast-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  line-height: 1.35;
}

.toast-message {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  word-break: break-word;
}

.toast-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 4px;
  margin-top: -3px;
  margin-inline-end: -4px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
  flex-shrink: 0;
}

.toast-close-btn:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  overflow: hidden;
}

.toast-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}

html[dir="rtl"] .toast-progress-fill {
  transform-origin: right;
}

.toast-success .toast-progress-fill { background: #10b981; }
.toast-error .toast-progress-fill,
.toast-danger .toast-progress-fill { background: #f43f5e; }
.toast-warning .toast-progress-fill { background: #f59e0b; }
.toast-info .toast-progress-fill { background: #3b82f6; }

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

.toast-item:hover .toast-progress-fill {
  animation-play-state: paused;
}

/* ==========================================================================
   Custom Confirm Modal
   ========================================================================== */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.confirm-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-modal-dialog {
  background: #ffffff;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 1.85rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(226, 232, 240, 0.85);
  text-align: center;
  transform: scale(0.92) translateY(14px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-overlay.active .confirm-modal-dialog {
  transform: scale(1) translateY(0);
}

.confirm-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff1f2;
  color: #e11d48;
  border: 2px solid #fecdd3;
}

.confirm-modal-icon.icon-warning {
  background: #fffbeb;
  color: #d97706;
  border: 2px solid #fde68a;
}

.confirm-modal-icon.icon-primary {
  background: #eef2ff;
  color: #4f46e5;
  border: 2px solid #c7d2fe;
}

.confirm-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.65rem 0;
  line-height: 1.35;
}

.confirm-modal-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 1.65rem 0;
  word-break: break-word;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-modal-btn {
  flex: 1;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}

.confirm-modal-btn-cancel {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.confirm-modal-btn-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.confirm-modal-btn-confirm {
  background: #e11d48;
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.confirm-modal-btn-confirm:hover {
  background: #be123c;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.35);
}

.confirm-modal-btn-confirm.btn-confirm-primary {
  background: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.confirm-modal-btn-confirm.btn-confirm-primary:hover {
  background: #4338ca;
}

@media (max-width: 480px) {
  .toast-container {
    top: 12px;
    inset-inline-end: 12px;
    inset-inline-start: 12px;
    width: auto;
    max-width: none;
  }
  .confirm-modal-dialog {
    padding: 1.35rem;
    border-radius: 16px;
  }
  .confirm-modal-actions {
    flex-direction: column-reverse;
  }
}


