/**
 * LiftLink Unified Notification System
 * Toast notifications, Modal dialogs (confirm/prompt)
 * Supports light/dark themes
 */

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.ll-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

@media (max-width: 480px) {
  .ll-toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

.ll-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  animation: ll-toast-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.ll-toast:hover {
  transform: translateX(-4px);
}

.ll-toast.ll-toast-exit {
  animation: ll-toast-slide-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ll-toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ll-toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Toast Icon */
.ll-toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.ll-toast-icon svg {
  width: 16px;
  height: 16px;
}

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

.ll-toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
  line-height: 1.4;
}

.ll-toast-message {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.9;
  word-wrap: break-word;
}

/* Toast Close Button */
.ll-toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  margin: -4px -4px -4px 0;
}

.ll-toast-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.ll-toast-close svg {
  width: 14px;
  height: 14px;
}

/* Toast Progress Bar */
.ll-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.ll-toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: ll-toast-progress 5s linear forwards;
}

@keyframes ll-toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Toast Types - Light Theme */
.ll-toast-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.ll-toast-success .ll-toast-icon {
  background: #10b981;
  color: white;
}

.ll-toast-success .ll-toast-progress-bar {
  background: #10b981;
}

.ll-toast-error,
.ll-toast-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.ll-toast-error .ll-toast-icon,
.ll-toast-danger .ll-toast-icon {
  background: #ef4444;
  color: white;
}

.ll-toast-error .ll-toast-progress-bar,
.ll-toast-danger .ll-toast-progress-bar {
  background: #ef4444;
}

.ll-toast-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  color: #92400e;
}

.ll-toast-warning .ll-toast-icon {
  background: #f59e0b;
  color: white;
}

.ll-toast-warning .ll-toast-progress-bar {
  background: #f59e0b;
}

.ll-toast-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.ll-toast-info .ll-toast-icon {
  background: #3b82f6;
  color: white;
}

.ll-toast-info .ll-toast-progress-bar {
  background: #3b82f6;
}

/* Toast Types - Dark Theme */
[data-theme="dark"] .ll-toast-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

[data-theme="dark"] .ll-toast-error,
[data-theme="dark"] .ll-toast-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.1) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

[data-theme="dark"] .ll-toast-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

[data-theme="dark"] .ll-toast-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

[data-theme="dark"] .ll-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   MODAL DIALOGS (Confirm, Prompt, Alert)
   ============================================ */
.ll-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: ll-modal-fade-in 0.2s ease;
}

.ll-modal-overlay.ll-modal-exit {
  animation: ll-modal-fade-out 0.2s ease forwards;
}

@keyframes ll-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ll-modal-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.ll-modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 400px;
  width: 100%;
  overflow: hidden;
  animation: ll-modal-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ll-modal-overlay.ll-modal-exit .ll-modal {
  animation: ll-modal-scale-out 0.2s ease forwards;
}

@keyframes ll-modal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes ll-modal-scale-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
}

[data-theme="dark"] .ll-modal {
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Icon */
.ll-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 0;
}

.ll-modal-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ll-modal-icon-circle svg {
  width: 32px;
  height: 32px;
}

/* Modal Icon Types */
.ll-modal-icon-warning .ll-modal-icon-circle {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}

.ll-modal-icon-danger .ll-modal-icon-circle {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
}

.ll-modal-icon-info .ll-modal-icon-circle {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.ll-modal-icon-success .ll-modal-icon-circle {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.ll-modal-icon-question .ll-modal-icon-circle {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4f46e5;
}

[data-theme="dark"] .ll-modal-icon-warning .ll-modal-icon-circle {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
  color: #fbbf24;
}

[data-theme="dark"] .ll-modal-icon-danger .ll-modal-icon-circle {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
  color: #f87171;
}

[data-theme="dark"] .ll-modal-icon-info .ll-modal-icon-circle {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: #60a5fa;
}

[data-theme="dark"] .ll-modal-icon-success .ll-modal-icon-circle {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
  color: #34d399;
}

[data-theme="dark"] .ll-modal-icon-question .ll-modal-icon-circle {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
  color: #818cf8;
}

/* Modal Content */
.ll-modal-content {
  padding: 20px 24px;
  text-align: center;
}

.ll-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

[data-theme="dark"] .ll-modal-title {
  color: #f9fafb;
}

.ll-modal-text {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

[data-theme="dark"] .ll-modal-text {
  color: #9ca3af;
}

/* Modal Input (for prompt) */
.ll-modal-input-wrapper {
  margin-top: 16px;
}

.ll-modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  background: #f9fafb;
  color: #111827;
  transition: all 0.2s ease;
}

.ll-modal-input:focus {
  outline: none;
  border-color: var(--color-primary, #6366f1);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ll-modal-input::placeholder {
  color: #9ca3af;
}

[data-theme="dark"] .ll-modal-input {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

[data-theme="dark"] .ll-modal-input:focus {
  background: #1f2937;
  border-color: var(--color-primary, #818cf8);
}

[data-theme="dark"] .ll-modal-input::placeholder {
  color: #6b7280;
}

textarea.ll-modal-input {
  min-height: 100px;
  resize: vertical;
}

/* Modal Actions */
.ll-modal-actions {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
}

.ll-modal-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.ll-modal-btn:active {
  transform: scale(0.98);
}

.ll-modal-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.ll-modal-btn-cancel:hover {
  background: #e5e7eb;
}

[data-theme="dark"] .ll-modal-btn-cancel {
  background: #374151;
  color: #d1d5db;
}

[data-theme="dark"] .ll-modal-btn-cancel:hover {
  background: #4b5563;
}

.ll-modal-btn-confirm {
  background: var(--color-primary, #6366f1);
  color: white;
}

.ll-modal-btn-confirm:hover {
  filter: brightness(1.1);
}

.ll-modal-btn-danger {
  background: #ef4444;
  color: white;
}

.ll-modal-btn-danger:hover {
  background: #dc2626;
}

/* Single button layout */
.ll-modal-actions.ll-modal-actions-single {
  justify-content: center;
}

.ll-modal-actions.ll-modal-actions-single .ll-modal-btn {
  flex: 0 1 auto;
  min-width: 120px;
}
