/* ═══════════════════════════════════════════════════════════════════════════
   🔔 NOTIFICATIONS/TOASTS - KOLO UI v1.0.0.82 Cyber Glow Edition
   Toast Messages • Alerts • Notifications • Темна тема з Neon Glow
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   📦 TOAST CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

/* Positions */
.toast-container--top-right {
  top: 0;
  right: 0;
  align-items: flex-end;
}

.toast-container--top-left {
  top: 0;
  left: 0;
  align-items: flex-start;
}

.toast-container--top-center {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

.toast-container--bottom-right {
  bottom: 0;
  right: 0;
  align-items: flex-end;
}

.toast-container--bottom-left {
  bottom: 0;
  left: 0;
  align-items: flex-start;
}

.toast-container--bottom-center {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .toast-container {
    padding: 16px;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    align-items: stretch !important;
  }
  
  .toast-container--bottom-right,
  .toast-container--bottom-left,
  .toast-container--bottom-center {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 70px);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎴 TOAST CARD
   ═══════════════════════════════════════════════════════════════════════════ */
.toast {
  position: relative;
  min-width: 320px;
  max-width: 480px;
  padding: 16px 20px;
  background: var(--k-glass-bg-strong, rgba(26, 26, 36, 0.95));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--k-radius-xl, 16px);
  border: 1px solid var(--k-border-default, rgba(255, 255, 255, 0.1));
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  
  animation: toast-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.2s ease;
}

.toast:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* Mobile full width */
@media (max-width: 768px) {
  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎨 TOAST VARIANTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Success (Green) */
.toast--success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.toast--success::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--k-green, #10b981), 
    var(--k-green-light, #34d399));
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.toast--success:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 
    0 12px 40px rgba(16, 185, 129, 0.2),
    0 0 0 1px rgba(16, 185, 129, 0.1) inset;
}

/* Error (Red) */
.toast--error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.toast--error::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--k-red, #ef4444), 
    var(--k-red-light, #f87171));
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.toast--error:hover {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 
    0 12px 40px rgba(239, 68, 68, 0.2),
    0 0 0 1px rgba(239, 68, 68, 0.1) inset;
}

/* Warning (Yellow) */
.toast--warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.toast--warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--k-yellow, #f59e0b), 
    var(--k-yellow-light, #fbbf24));
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.toast--warning:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 
    0 12px 40px rgba(245, 158, 11, 0.2),
    0 0 0 1px rgba(245, 158, 11, 0.1) inset;
}

/* Info (Blue) */
.toast--info {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
}

.toast--info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--k-blue, #3b82f6), 
    var(--k-blue-light, #60a5fa));
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.toast--info:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 
    0 12px 40px rgba(59, 130, 246, 0.2),
    0 0 0 1px rgba(59, 130, 246, 0.1) inset;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📋 TOAST CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
.toast__content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-left: 8px; /* Space for left border */
}

.toast__icon {
  flex: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.toast--success .toast__icon {
  color: var(--k-green, #10b981);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}

.toast--error .toast__icon {
  color: var(--k-red, #ef4444);
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

.toast--warning .toast__icon {
  color: var(--k-yellow, #f59e0b);
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.toast--info .toast__icon {
  color: var(--k-blue, #3b82f6);
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: var(--k-text-sm, 14px);
  font-weight: var(--k-weight-bold, 700);
  color: var(--k-text-primary, #f8fafc);
  margin-bottom: 4px;
  line-height: 1.4;
}

.toast__message {
  font-size: var(--k-text-sm, 14px);
  color: var(--k-text-secondary, #94a3b8);
  line-height: 1.5;
  margin: 0;
}

.toast__close {
  flex: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--k-text-muted, #64748b);
  border-radius: var(--k-radius-lg, 12px);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 20px;
  line-height: 1;
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--k-text-primary, #f8fafc);
}

.toast__close:active {
  transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⏱️ PROGRESS BAR (Auto-dismiss indicator)
   ═══════════════════════════════════════════════════════════════════════════ */
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0 0 var(--k-radius-xl, 16px) var(--k-radius-xl, 16px);
  overflow: hidden;
}

.toast__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.5), 
    rgba(255, 255, 255, 0.8));
  width: 100%;
  transform-origin: left;
  animation: toast-progress linear forwards;
}

.toast--success .toast__progress-bar {
  background: linear-gradient(90deg, 
    var(--k-green, #10b981), 
    var(--k-green-light, #34d399));
}

.toast--error .toast__progress-bar {
  background: linear-gradient(90deg, 
    var(--k-red, #ef4444), 
    var(--k-red-light, #f87171));
}

.toast--warning .toast__progress-bar {
  background: linear-gradient(90deg, 
    var(--k-yellow, #f59e0b), 
    var(--k-yellow-light, #fbbf24));
}

.toast--info .toast__progress-bar {
  background: linear-gradient(90deg, 
    var(--k-blue, #3b82f6), 
    var(--k-blue-light, #60a5fa));
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎬 ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

/* Progress animation */
@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Removing state */
.toast--removing {
  animation: toast-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📱 TOAST WITH ACTIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-left: 36px; /* Align with message */
}

.toast__action {
  padding: 6px 12px;
  border-radius: var(--k-radius-lg, 12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--k-text-primary, #f8fafc);
  font-size: var(--k-text-xs, 12px);
  font-weight: var(--k-weight-semibold, 600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toast__action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.toast__action:active {
  transform: scale(0.97);
}

.toast__action--primary {
  background: rgba(255, 107, 53, 0.2);
  border-color: rgba(255, 107, 53, 0.4);
  color: var(--k-primary, #ff6b35);
}

.toast__action--primary:hover {
  background: rgba(255, 107, 53, 0.3);
  border-color: rgba(255, 107, 53, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎭 COMPACT VARIANT
   ═══════════════════════════════════════════════════════════════════════════ */
.toast--compact {
  min-width: 280px;
  padding: 12px 16px;
}

.toast--compact .toast__content {
  gap: 8px;
}

.toast--compact .toast__icon {
  width: 20px;
  height: 20px;
  font-size: 16px;
}

.toast--compact .toast__title {
  font-size: var(--k-text-xs, 12px);
  margin-bottom: 0;
}

.toast--compact .toast__message {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🌈 RICH CONTENT VARIANT
   ═══════════════════════════════════════════════════════════════════════════ */
.toast--rich {
  max-width: 560px;
}

.toast__image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--k-radius-lg, 12px);
  margin-top: 8px;
}

.toast__metadata {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-left: 36px;
  font-size: var(--k-text-xs, 12px);
  color: var(--k-text-muted, #64748b);
}

.toast__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ♿ ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */
.toast[role="alert"],
.toast[role="status"] {
  /* Screen reader support */
}

/* Focus visible for close button */
.toast__close:focus-visible {
  outline: 2px solid var(--k-primary, #ff6b35);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⚡ REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none !important;
  }
  
  .toast--removing {
    animation: none !important;
    opacity: 0 !important;
  }
  
  .toast__progress-bar {
    animation: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎯 THEME VARIANTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Light theme variant */
@media (prefers-color-scheme: light) {
  .toast {
    background: rgba(255, 255, 255, 0.95);
    color: var(--k-text-inverse, #0f172a);
  }
  
  .toast__title {
    color: var(--k-text-inverse, #0f172a);
  }
  
  .toast__message {
    color: #475569;
  }
}
