/* Toast Manager Styles - Круглые тосты с loading-шкалой (без скругления у шкалы) */

/* ============================================ */
/* КОНТЕЙНЕР ДЛЯ ВСЕХ ТОСТОВ */
/* ============================================ */
.toast-container {
  position: fixed !important;
  z-index: 999999 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 90vw;
  width: auto;
  padding: 0 10px;
  box-sizing: border-box;
}

/* ============================================ */
/* ТОСТ */
/* ============================================ */
.toast-item {
  pointer-events: auto !important;
  position: relative !important;
  width: auto !important;
  max-width: 420px !important;
  min-width: 280px !important;
  border-radius: 50px !important;
  padding: 8px 14px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0 auto;
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  cursor: default;
  color: #ffffff !important;
}

/* Анимация появления */
.toast-item.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Анимация исчезновения */
.toast-item.hide {
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
}

/* Ховер эффект */
.toast-item:hover {
  transform: scale(1.02) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08) !important;
}

/* ============================================ */
/* КОНТЕНТ ТОСТА */
/* ============================================ */
.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
}

/* ============================================ */
/* ИКОНКА MATERIAL SYMBOLS */
/* ============================================ */
.toast-icon {
  font-size: 24px !important;
  flex-shrink: 0;
  color: #ffffff !important;
  line-height: 1;
  user-select: none;
}

/* ============================================ */
/* ТЕКСТ СООБЩЕНИЯ */
/* ============================================ */
.toast-message {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: #ffffff !important;
  word-break: break-word;
  flex: 1;
  margin: 0 4px;
  min-width: 0;
}

/* ============================================ */
/* КНОПКА ЗАКРЫТИЯ */
/* ============================================ */
.toast-close {
  background: rgba(255, 255, 255, 0.15) !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 18px !important;
  cursor: pointer !important;
  opacity: 0.6;
  padding: 0 !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0;
  line-height: 1;
  margin: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast-close:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.25) !important;
}

/* ============================================ */
/* ТАЙМЕР - LOADING ШКАЛА (ровная, без скругления) */
/* ============================================ */
.toast-timer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 1;
  overflow: hidden;
  background: transparent !important;
  border-radius: 0 !important;
}

.toast-timer-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear;
  border-radius: 0 !important;
}

.toast-timer-bar.paused {
  animation-play-state: paused !important;
}

/* ============================================ */
/* ЦВЕТОВЫЕ СХЕМЫ */
/* ============================================ */

/* Успех - зеленый */
.toast-success {
  background: #16a34a !important;
  border: 1px solid #22c55e !important;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3), 0 2px 4px rgba(22, 163, 74, 0.15) !important;
}

.toast-success .toast-timer-bar {
  background: rgba(255, 255, 255, 0.25) !important;
}

.toast-success .toast-close {
  background: rgba(255, 255, 255, 0.15) !important;
}

.toast-success .toast-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Ошибка - красный */
.toast-error {
  background: #dc2626 !important;
  border: 1px solid #ef4444 !important;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3), 0 2px 4px rgba(220, 38, 38, 0.15) !important;
}

.toast-error .toast-timer-bar {
  background: rgba(255, 255, 255, 0.25) !important;
}

.toast-error .toast-close {
  background: rgba(255, 255, 255, 0.15) !important;
}

.toast-error .toast-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Предупреждение - оранжевый */
.toast-warning {
  background: #ea580c !important;
  border: 1px solid #f97316 !important;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.3), 0 2px 4px rgba(234, 88, 12, 0.15) !important;
}

.toast-warning .toast-timer-bar {
  background: rgba(255, 255, 255, 0.25) !important;
}

.toast-warning .toast-close {
  background: rgba(255, 255, 255, 0.15) !important;
}

.toast-warning .toast-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Информация - синий */
.toast-info {
  background: #2563eb !important;
  border: 1px solid #3b82f6 !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3), 0 2px 4px rgba(37, 99, 235, 0.15) !important;
}

.toast-info .toast-timer-bar {
  background: rgba(255, 255, 255, 0.25) !important;
}

.toast-info .toast-close {
  background: rgba(255, 255, 255, 0.15) !important;
}

.toast-info .toast-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* ============================================ */
/* АНИМАЦИИ ПОЯВЛЕНИЯ В ЗАВИСИМОСТИ ОТ ПОЗИЦИИ */
/* ============================================ */

/* Слайд сверху */
.toast-item.animation-slide-down {
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Слайд снизу */
.toast-item.animation-slide-up {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Слайд слева */
.toast-item.animation-slide-left {
  animation: slideLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Слайд справа */
.toast-item.animation-slide-right {
  animation: slideRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Появление с масштабом */
.toast-item.animation-fade {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================ */
/* МОБИЛЬНАЯ АДАПТАЦИЯ */
/* ============================================ */
@media (max-width: 640px) {
  .toast-container {
    max-width: 90vw !important;
    width: auto !important;
    padding: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .toast-item {
    min-width: 0 !important;
    max-width: 90vw !important;
    width: auto !important;
    padding: 12px 18px !important;
    border-radius: 30px !important;
    margin: 0 auto !important;
  }

  .toast-message {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  .toast-icon {
    font-size: 20px !important;
    flex-shrink: 0 !important;
  }

  .toast-close {
    font-size: 16px !important;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }

  .toast-content {
    gap: 8px !important;
    min-width: 0 !important;
  }
}

/* ============================================ */
/* УТИЛИТЫ */
/* ============================================ */

.toast-container::-webkit-scrollbar {
  width: 4px;
}

.toast-container::-webkit-scrollbar-track {
  background: transparent;
}

.toast-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

.toast-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}