/* 토스트 알림 시스템 CSS */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.notification-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-out;
    pointer-events: auto;
    max-height: 400px; /* 높이 제한을 늘림 */
    border-left: 4px solid #007bff;
    display: flex;
    flex-direction: column;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification-toast.expanded {
    max-height: none;
}

.notification-toast.auto-hiding {
    opacity: 0.7;
}

.notification-toast:hover.auto-hiding {
    opacity: 1;
}

/* 우선순위별 좌측 테두리 색상 */
.notification-priority-urgent {
    border-left-color: #dc3545;
}

.notification-priority-high {
    border-left-color: #fd7e14;
}

.notification-priority-normal {
    border-left-color: #007bff;
}

.notification-priority-low {
    border-left-color: #28a745;
}

.toast-header {
    padding: 12px 16px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.toast-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.toast-title strong {
    font-size: 15px;
    margin: 0;
}

.priority-badge {
    font-size: 11px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* flex item이 축소될 수 있도록 */
}

.toast-content {
    line-height: 1.5;
    color: #333;
    font-size: 14px;
    margin-bottom: 12px;
    max-height: 200px; /* 내용 영역의 최대 높이 증가 */
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* flex item이 축소될 수 있도록 */
}

.notification-toast.expanded .toast-content {
    max-height: none;
}

.toast-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0; /* 버튼 영역이 축소되지 않도록 */
}

.do-not-show-label {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.do-not-show-label input[type="checkbox"] {
    margin-right: 6px;
    scale: 0.9;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 500;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification-toast {
        margin: 0;
        max-height: 80vh; /* 모바일에서는 화면 높이의 80%로 제한 */
    }
    
    .toast-header {
        padding: 10px 12px;
    }
    
    .toast-body {
        padding: 12px;
    }
    
    .toast-content {
        max-height: 150px; /* 모바일에서 내용 영역 높이 조정 */
    }
    
    .toast-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        flex-shrink: 0; /* 모바일에서도 버튼 영역 고정 */
    }
    
    .action-buttons {
        justify-content: stretch;
        gap: 8px;
    }
    
    .btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
    }
    
    .do-not-show-label {
        justify-content: center;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .notification-toast {
        background: #2d3748;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .toast-content {
        color: #e2e8f0;
    }
    
    .toast-actions {
        border-top-color: #4a5568;
    }
    
    .do-not-show-label {
        color: #a0aec0;
    }
    
    .btn-secondary {
        background: #4a5568;
    }
    
    .btn-secondary:hover {
        background: #2d3748;
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    .notification-toast,
    .toast-close,
    .btn {
        transition: none;
    }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .notification-toast {
        border: 2px solid #000;
    }
    
    .btn {
        border: 1px solid currentColor;
    }
}