/* ==========================================================================
   W-MUSIC ULTRA-MODERN DIALOG BOX & TOAST NOTIFICATION SYSTEM
   Designed with Kantumruy Pro font, Dark Glassmorphism & Vibrant Micro-animations
   ========================================================================== */

/* Root Modal Backdrop */
.wm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Kantumruy Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wm-dialog-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Dialog Container Card */
.wm-dialog-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(165deg, rgba(19, 28, 49, 0.96) 0%, rgba(10, 15, 29, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85),
              0 0 0 1px rgba(255, 255, 255, 0.06),
              0 0 45px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  color: #f8fafc;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.22s ease;
}

.wm-dialog-backdrop.active .wm-dialog-card {
  transform: scale(1) translateY(0);
}

/* Ambient Ambient Glow in Top Right */
.wm-dialog-ambient {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.35;
  pointer-events: none;
  transition: background 0.3s ease;
}

/* Types Ambient & Badges */
.wm-type-error .wm-dialog-ambient { background: #ef4444; }
.wm-type-success .wm-dialog-ambient { background: #10b981; }
.wm-type-warning .wm-dialog-ambient { background: #f59e0b; }
.wm-type-info .wm-dialog-ambient { background: #6366f1; }

/* Header */
.wm-dialog-header {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.wm-dialog-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wm-dialog-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
}

.wm-dialog-system-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.wm-dialog-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.18s ease;
}

.wm-dialog-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  transform: rotate(90deg);
}

/* Body */
.wm-dialog-body {
  padding: 24px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Glow Badge */
.wm-dialog-badge-wrapper {
  position: relative;
  margin-bottom: 18px;
}

.wm-dialog-badge-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0.5;
  animation: wmPulse 2.4s infinite ease-in-out;
}

.wm-dialog-badge-icon {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  transition: all 0.3s ease;
}

/* Colors for badge by type */
.wm-type-error .wm-dialog-badge-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(153, 27, 27, 0.35) 100%);
  border-color: rgba(239, 68, 68, 0.45);
}
.wm-type-error .wm-dialog-badge-glow { background: #ef4444; }

.wm-type-success .wm-dialog-badge-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 95, 70, 0.35) 100%);
  border-color: rgba(16, 185, 129, 0.45);
}
.wm-type-success .wm-dialog-badge-glow { background: #10b981; }

.wm-type-warning .wm-dialog-badge-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(180, 83, 9, 0.35) 100%);
  border-color: rgba(245, 158, 11, 0.45);
}
.wm-type-warning .wm-dialog-badge-glow { background: #f59e0b; }

.wm-type-info .wm-dialog-badge-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(67, 56, 202, 0.35) 100%);
  border-color: rgba(99, 102, 241, 0.45);
}
.wm-type-info .wm-dialog-badge-glow { background: #6366f1; }

@keyframes wmPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.12); opacity: 0.7; }
}

/* Titles */
.wm-dialog-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
  line-height: 1.45;
}

.wm-dialog-message {
  font-size: 14.5px;
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
  max-width: 420px;
  word-break: break-word;
}

/* Details Box (e.g. for error logs/technical text) */
.wm-dialog-details {
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-family: monospace;
  font-size: 12px;
  color: #f87171;
  text-align: left;
  max-height: 120px;
  overflow-y: auto;
  user-select: text;
  display: none;
}

/* Footer / Action Buttons */
.wm-dialog-footer {
  padding: 16px 24px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}

.wm-dialog-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  outline: none;
}

.wm-dialog-btn:hover {
  transform: translateY(-1.5px);
}

.wm-dialog-btn:active {
  transform: translateY(0.5px);
}

.wm-dialog-btn-primary {
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.wm-type-error .wm-dialog-btn-primary {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}
.wm-type-error .wm-dialog-btn-primary:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.55);
}

.wm-type-success .wm-dialog-btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
.wm-type-success .wm-dialog-btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55);
}

.wm-type-warning .wm-dialog-btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}
.wm-type-warning .wm-dialog-btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.55);
}

.wm-type-info .wm-dialog-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.wm-type-info .wm-dialog-btn-primary:hover {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.55);
}

.wm-dialog-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.wm-dialog-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* ==========================================================================
   FLOATING TOAST NOTIFICATIONS (TOP-RIGHT / BOTTOM-RIGHT)
   ========================================================================== */
.wm-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100% - 48px);
  pointer-events: none;
  font-family: 'Kantumruy Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wm-toast-item {
  position: relative;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  overflow: hidden;
  transform: translateX(110%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease,
              margin-top 0.24s ease,
              max-height 0.24s ease;
}

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

.wm-toast-item.hide {
  transform: translateX(120%);
  opacity: 0;
}

/* Toast Left Accent Bar */
.wm-toast-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.wm-toast-item.toast-error::before { background: #ef4444; }
.wm-toast-item.toast-success::before { background: #10b981; }
.wm-toast-item.toast-warning::before { background: #f59e0b; }
.wm-toast-item.toast-info::before { background: #6366f1; }

.wm-toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1.2;
  margin-top: 1px;
}

.wm-toast-content {
  flex: 1;
  min-width: 0;
}

.wm-toast-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.wm-toast-message {
  font-size: 12.5px;
  line-height: 1.5;
  color: #cbd5e1;
  word-break: break-word;
}

.wm-toast-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  margin: -4px -6px 0 0;
  font-size: 16px;
  line-height: 1;
  transition: color 0.15s ease;
}

.wm-toast-close:hover {
  color: #f1f5f9;
}

/* Toast Progress Bar */
.wm-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.1);
}

.wm-toast-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
}

.wm-toast-item.toast-error .wm-toast-progress-fill { background: #ef4444; }
.wm-toast-item.toast-success .wm-toast-progress-fill { background: #10b981; }
.wm-toast-item.toast-warning .wm-toast-progress-fill { background: #f59e0b; }
.wm-toast-item.toast-info .wm-toast-progress-fill { background: #6366f1; }

@media (max-width: 600px) {
  .wm-dialog-card {
    max-width: 100%;
    border-radius: 18px;
  }
  .wm-toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}
