/**
 * Professional Toast Notifications & Modals
 * Clean, accessible, and elegant UI notifications
 */

/* Toast Container */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
  max-width: 400px;
}

@media (max-width: 768px) {
  #toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Toast Base Styles */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  pointer-events: all;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.toast-hide {
  opacity: 0;
  transform: translateX(400px);
}

/* Toast Icon */
.toast-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

/* Toast Message */
.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-800, #1f2937);
}

/* Toast Close Button */
.toast-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: var(--gray-500, #6b7280);
  flex-shrink: 0;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--gray-700, #374151);
}

/* Toast Types */
.toast-success {
  border-left: 4px solid #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-info {
  border-left: 4px solid #3b82f6;
}

/* Confirm Modal */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.confirm-modal.show {
  opacity: 1;
}

.confirm-modal.fade-out {
  opacity: 0;
}

.confirm-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.confirm-dialog {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.confirm-modal.show .confirm-dialog {
  transform: scale(1);
}

.confirm-dialog h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900, #111827);
}

.confirm-dialog p {
  margin: 0 0 24px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-600, #4b5563);
}

.confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.confirm-buttons button {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.confirm-cancel {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
}

.confirm-cancel:hover {
  background: var(--gray-200, #e5e7eb);
}

.confirm-ok {
  background: var(--success, #4caf50);
  color: white;
}

.confirm-ok:hover {
  background: var(--primary-dark, #006b3c);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s;
}

.loading-overlay.show {
  opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200, #e5e7eb);
  border-top-color: var(--primary, #009b3a);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-message {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-700, #374151);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .toast,
  .confirm-dialog,
  .loading-overlay {
    transition: none;
  }

  .loading-spinner {
    animation: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .toast {
    background: var(--gray-800, #1f2937);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }

  .toast-message {
    color: var(--gray-100, #f3f4f6);
  }

  .toast-close {
    color: var(--gray-400, #9ca3af);
  }

  .toast-close:hover {
    color: var(--gray-200, #e5e7eb);
  }

  .confirm-dialog {
    background: var(--gray-800, #1f2937);
  }

  .confirm-dialog h3 {
    color: var(--gray-100, #f3f4f6);
  }

  .confirm-dialog p {
    color: var(--gray-300, #d1d5db);
  }

  .loading-overlay {
    background: rgba(17, 24, 39, 0.95);
  }

  .loading-message {
    color: var(--gray-200, #e5e7eb);
  }
}
