﻿/**
 * Toast Notification System
 * 전역 토스트 팝업 스타일
 */

/* 토스트 컨테이너 - 기본 */
.toast-container {
  position: fixed;
  z-index: calc(var(--z-overlay) + 1); /* 10000 — overlay보다 위에 표시 */
  display: flex;
  gap: 12px;
  pointer-events: none;
}

/* 우측 상단 (기본) */
.toast-container.toast-position-top-right {
  top: 20px;
  right: 20px;
  flex-direction: column; /* 위에서 아래로 쌓임 */
}

/* 우측 하단 */
.toast-container.toast-position-bottom-right {
  bottom: 20px;
  right: 20px;
  flex-direction: column-reverse; /* 아래에서 위로 쌓임 */
}

/* 좌측 상단 */
.toast-container.toast-position-top-left {
  top: 20px;
  left: 20px;
  flex-direction: column; /* 위에서 아래로 쌓임 */
}

/* 좌측 하단 */
.toast-container.toast-position-bottom-left {
  bottom: 20px;
  left: 20px;
  flex-direction: column-reverse; /* 아래에서 위로 쌓임 */
}

/* 개별 토스트 아이템 */
.toast {
  min-width: 320px;
  max-width: 400px;
  padding: 16px 20px;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
}

/* 토스트 슬라이드 인 애니메이션 - 우측 */
@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 토스트 슬라이드 인 애니메이션 - 좌측 */
@keyframes toastSlideInLeft {
  from {
    transform: translateX(-400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 토스트 슬라이드 인 애니메이션 - 하단 */
@keyframes toastSlideInBottom {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 위치에 따른 애니메이션 적용 */
.toast-position-bottom-right .toast,
.toast-position-bottom-left .toast {
  animation: toastSlideInBottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-position-top-left .toast,
.toast-position-bottom-left .toast {
  animation: toastSlideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 토스트 슬라이드 아웃 애니메이션 */
@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

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

/* 토스트 아이콘 */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 50%;
}

/* 토스트 콘텐츠 */
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 토스트 닫기 버튼 */
.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 16px;
  padding: 0;
}

.toast-close:hover {
  background: var(--color-gray-100);
  color: var(--text-primary);
}

/* 토스트 타입별 스타일 */

/* Success */
.toast.toast-success {
  border-left-color: var(--color-success);
}

.toast.toast-success .toast-icon {
  color: var(--color-success);
  background: var(--color-success-light);
}

/* Error */
.toast.toast-error {
  border-left-color: var(--color-error);
}

.toast.toast-error .toast-icon {
  color: var(--color-error);
  background: var(--color-error-light);
}

/* Warning */
.toast.toast-warning {
  border-left-color: var(--color-warning);
}

.toast.toast-warning .toast-icon {
  color: var(--color-warning);
  background: var(--color-warning-light);
}

/* Info */
.toast.toast-info {
  border-left-color: var(--color-info);
}

.toast.toast-info .toast-icon {
  color: var(--color-info);
  background: var(--color-info-light);
}

/* 프로그레스 바 (자동 사라지기) */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.3;
  transform-origin: left;
  animation: toastProgress linear;
}

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

/* 반응형 */
@media (max-width: 640px) {
  .toast-container {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ========================================
   Toast Confirm Dialog
======================================== */

/* 오버레이 */
.toast-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: calc(var(--z-overlay) + 2); /* 10001 — toast-container보다 위에 */
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 다이얼로그 */
.toast-confirm-dialog {
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  min-width: 400px;
  max-width: 500px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 헤더 */
.toast-confirm-header {
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.toast-confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-warning-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-warning);
}

.toast-confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

/* 본문 */
.toast-confirm-body {
  padding: 0 24px 24px;
}

.toast-confirm-message {
  font-size: 14px;
  color: var(--text-secondary, var(--color-slate-500));
  line-height: 1.6;
  text-align: center;
  margin: 0;
}

.toast-prompt-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.toast-prompt-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 푸터 */
.toast-confirm-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

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

.toast-confirm-btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.toast-confirm-btn-cancel:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.toast-confirm-btn-confirm {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.toast-confirm-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* 반응형 */
@media (max-width: 640px) {
  .toast-confirm-dialog {
    min-width: auto;
    width: calc(100% - 40px);
    max-width: none;
  }
}

/* ========================================
   다크모드
======================================== */

[data-theme="dark"] .toast {
  background: var(--bg-secondary);
}

[data-theme="dark"] .toast-confirm-dialog {
  background: var(--bg-secondary);
}

[data-theme="dark"] .toast-prompt-input {
  background: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme="dark"] .toast-confirm-btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

[data-theme="dark"] .toast-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}










