/**
 * Toast Notifications System
 * Modern, responsive bildirim sistemi
 */

/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 420px;
  width: 100%;
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}

/* Toast Item */
.toast {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition: all 0.3s ease;
  border-left: 4px solid #64748b;
}

.toast.toast-removing {
  animation: toastSlideOut 0.3s ease forwards;
}

/* Toast Types */
.toast.toast-success {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, white 100%);
}

.toast.toast-error {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, white 100%);
}

.toast.toast-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, white 100%);
}

.toast.toast-info {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, white 100%);
}

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

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

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

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

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

/* Toast Content */
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.4;
}

.toast-message {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* Toast Close Button */
.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #94a3b8;
  transition: all 0.2s;
  font-size: 18px;
  line-height: 1;
}

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

/* Toast Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  background: currentColor;
  animation: toastProgress linear forwards;
  transform-origin: left;
}

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

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

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

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

/* Animations */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.8);
  }
}

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

/* Dark Mode Support */
[data-theme="dark"] .toast {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .toast-title {
  color: #f1f5f9;
}

[data-theme="dark"] .toast-message {
  color: #cbd5e1;
}

[data-theme="dark"] .toast-close:hover {
  background-color: #475569;
  color: #cbd5e1;
}

/* Multiple toasts stacking */
.toast:nth-child(1) {
  z-index: 100;
}

.toast:nth-child(2) {
  z-index: 99;
  opacity: 0.95;
  transform: scale(0.98) translateY(-2px);
}

.toast:nth-child(3) {
  z-index: 98;
  opacity: 0.9;
  transform: scale(0.96) translateY(-4px);
}

/* Hover effect */
.toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
}

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