/* ==========================================================================
   Darsely Toast Notification System (RTL, Modern, High Performance)
   ========================================================================== */

#darsely-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 48px);
  direction: rtl;
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (max-width: 576px) {
  #darsely-toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

.darsely-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(18, 24, 38, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
  color: #f8fafc;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              max-height 0.35s ease,
              margin 0.35s ease,
              padding 0.35s ease;
  max-height: 200px;
}

.darsely-toast.darsely-toast-show {
  transform: translateX(0);
  opacity: 1;
}

.darsely-toast.darsely-toast-hide {
  transform: translateX(120%);
  opacity: 0;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border: none !important;
}

/* Toast Variants */
.darsely-toast-success {
  border-right: 4px solid #10b981;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
}
.darsely-toast-success .darsely-toast-icon-badge {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
}
.darsely-toast-success .darsely-toast-progress {
  background: #10b981;
}

.darsely-toast-error {
  border-right: 4px solid #ef4444;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
}
.darsely-toast-error .darsely-toast-icon-badge {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
.darsely-toast-error .darsely-toast-progress {
  background: #ef4444;
}

.darsely-toast-warning {
  border-right: 4px solid #f59e0b;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
}
.darsely-toast-warning .darsely-toast-icon-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
}
.darsely-toast-warning .darsely-toast-progress {
  background: #f59e0b;
}

.darsely-toast-info {
  border-right: 4px solid #3b82f6;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
}
.darsely-toast-info .darsely-toast-icon-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #3b82f6;
}
.darsely-toast-info .darsely-toast-progress {
  background: #3b82f6;
}

/* Icon Badge */
.darsely-toast-icon-badge {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-top: 2px;
}

/* Content */
.darsely-toast-content {
  flex: 1;
  min-width: 0;
}

.darsely-toast-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
  line-height: 1.35;
}

.darsely-toast-message {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.45;
  word-break: break-word;
}

/* Close Button */
.darsely-toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #64748b;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  margin-right: -4px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.darsely-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Progress Bar */
.darsely-toast-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.darsely-toast-progress {
  height: 100%;
  width: 100%;
  transform-origin: right;
  transition: transform linear;
}

/* Pause animation on hover */
.darsely-toast:hover .darsely-toast-progress {
  animation-play-state: paused !important;
}

/* ==========================================================================
   Darsely Lightweight Modal (Dialog / Prompt replacement for Swal modals)
   ========================================================================== */
.darsely-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  direction: rtl;
  font-family: 'Cairo', system-ui, sans-serif;
}

.darsely-modal-backdrop.darsely-modal-open {
  opacity: 1;
  visibility: visible;
}

.darsely-modal-card {
  background: #151d30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #fff;
}

.darsely-modal-backdrop.darsely-modal-open .darsely-modal-card {
  transform: scale(1);
}

.darsely-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
}

.darsely-modal-icon.icon-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.darsely-modal-icon.icon-question {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.darsely-modal-icon.icon-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.darsely-modal-icon.icon-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.darsely-modal-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.darsely-modal-body {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 20px;
}

.darsely-modal-input {
  width: 100%;
  padding: 12px 16px;
  background: #0d1322;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  text-align: center;
  outline: none;
  margin-bottom: 20px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.darsely-modal-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

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

.darsely-modal-btn {
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.darsely-modal-btn-confirm {
  background: #3b82f6;
  color: #fff;
}

.darsely-modal-btn-confirm:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.darsely-modal-btn-primary {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 700;
}

.darsely-modal-btn-primary:hover {
  background: #d97706;
}

.darsely-modal-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.darsely-modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.darsely-modal-btn-deny {
  background: #10b981;
  color: #fff;
}

.darsely-modal-btn-deny:hover {
  background: #059669;
}
