/* 토스트 스택 컨테이너 */
.toast-stack-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000; /* 모달보다 높은 z-index */
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
}

/* 커스텀 토스트 스타일 */
.toast-container {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  margin-bottom: 8px;
}

.toast-container.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  width: 320px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: "Pretendard", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  position: relative;
  z-index: 10001; /* 토스트 자체도 높은 z-index */
}

.toast.success {
  background-color: #f0f9f4; /* System-Success-50 */
  color: #1f2937; /* Gray-95 */
}

.toast.warning {
  background-color: #fef3c7; /* System-Warning-30 */
  color: #1f2937; /* Gray-95 */
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  word-break: keep-all;
  white-space: normal;
}

.toast-close {
  display: none; /* 임시로 비활성화 */
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

.toast-close svg {
  width: 12px;
  height: 12px;
}

/* 애니메이션 */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.toast-container.show .toast {
  animation: slideInDown 0.3s ease-out;
}

.toast-container:not(.show) .toast {
  animation: slideOutUp 0.3s ease-out;
}

/* 모달 내에서 토스트가 제대로 표시되도록 */
.modal-open .toast-stack-container {
  z-index: 10000;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .toast {
    width: calc(100vw - 40px);
    max-width: 320px;
  }

  .toast-stack-container {
    top: 10px;
  }
}

/* Scroll highlight effect for selected items */
.scroll-highlight {
  animation: highlightFade 2s ease-out forwards;
  background-color: rgba(59, 130, 246, 0.15) !important;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

@keyframes highlightFade {
  0% {
    background-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  }
  50% {
    background-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
  }
  100% {
    background-color: rgba(59, 130, 246, 0.05);
    box-shadow: none;
  }
}
