/**
 * Toast 시스템 스타일 - 글래스모피즘 디자인
 * 
 * 최적화 원칙:
 * - CSS 클래스 기반 스타일 (인라인 스타일 제거)
 * - 1회 로드, 무한 재사용
 * - GPU 가속 애니메이션 (transform, opacity)
 */

/* Toast 컨테이너 - 우측 상단 고정 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* 스크롤바 스타일 */
.toast-container::-webkit-scrollbar {
    width: 6px;
}

.toast-container::-webkit-scrollbar-track {
    background: transparent;
}

.toast-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.toast-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Toast 메시지 - 글래스모피즘 */
.toast-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    min-height: 56px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    pointer-events: auto;
    cursor: pointer;
    
    /* 글래스모피즘 효과 - 강화 */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    border: 1px solid rgba(255, 255, 255, 0.3);
    
    /* 애니메이션 */
    animation: slideIn 0.3s ease-out;
    transition: all 0.2s ease;
}

.toast-message:hover {
    transform: translateX(-4px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.08),
        0 12px 24px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

/* Toast 아이콘 */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

/* Toast 텍스트 */
.toast-text {
    flex: 1;
    color: #1e293b;
    word-break: break-word;
}

/* 페이드아웃 애니메이션 */
.toast-message.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* 슬라이드 인 애니메이션 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 페이드 아웃 애니메이션 */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* 로딩 스피너 애니메이션 */
.toast-message.loading .toast-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 반응형 디자인 - 모바일 */
@media (max-width: 640px) {
    .toast-container {
        top: 20px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
    
    .toast-message {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
}

/* 다크모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    .toast-message {
        background: rgba(30, 41, 59, 0.75);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: 
            0 8px 16px rgba(0, 0, 0, 0.3),
            0 4px 6px rgba(0, 0, 0, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.1) inset;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .toast-text {
        color: #f1f5f9;
    }
    
    .toast-icon {
        background: rgba(255, 255, 255, 0.1);
    }
}

