/* notyf-custom.css */

/* --- Custom Notyf Styles --- */
.notyf {
    /* Global positioning and base settings for Notyf container */
}

.notyf__toast {
    font-family: var(--font-family, 'Fira Code', 'Consolas', 'Monaco', monospace);
    border-radius: 0.25rem; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); 
    
    padding-top: var(--spacing-xs, 0.25rem);    
    padding-bottom: var(--spacing-xs, 0.25rem); 
    padding-left: var(--spacing-md, 1rem);
    /* 为绝对定位的关闭按钮留出足够的右侧内边距 */
    padding-right: calc(var(--spacing-md, 1rem) + var(--spacing-sm, 0.5rem)); /* 例如 1rem + 0.5rem */
    
    max-width: 400px; 
    width: auto;      
    min-width: 280px; 
    
    opacity: 0.96; 
    transition: all 0.3s ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.08); 
    margin-bottom: var(--spacing-sm, 0.5rem); 
    
    position: relative; /* 关键：父容器需要相对定位，以便子元素的绝对定位相对于它 */
    /* display: flex;  当使用绝对定位关闭按钮时，toast 本身不一定需要 flex */
    /* align-items: center; */
}

.notyf__message {
    font-size: 0.95rem;  
    line-height: 1.45;   
    font-weight: 500;   
    padding-left: 0;    
    /* flex-grow: 1; 当关闭按钮绝对定位时，消息不再需要 flex-grow */
    /* min-width: 0; */
}

.notyf__icon {
    display: none;
}

/* Specific notification type styles */
.notyf-success-custom {
    background-color: var(--primary-color, #64ffda); 
    color: var(--darker-bg, #121212); 
    border-left: 4px solid var(--primary-color-dark, #4ac5b8); 
}
.notyf-success-custom .notyf__ripple {
    background-color: var(--primary-color-dark, #4ac5b8);
}
.notyf-success-custom .notyf__dismiss-icon {
    color: var(--darker-bg, #121212); 
}


.notyf-error-custom {
    background-color: #d32f2f; 
    color: var(--text-color, #f8f8f2);          
    border-left: 4px solid #b71c1c;          
}
.notyf-error-custom .notyf__ripple {
    background-color: #b71c1c;
}
.notyf-error-custom .notyf__dismiss-icon {
    color: var(--text-color, #f8f8f2);
}


.notyf-warning-custom {
    background-color: var(--accent-color, #fca311); 
    color: var(--darker-bg, #121212); 
    border-left: 4px solid #ef6c00;             
}
.notyf-warning-custom .notyf__ripple {
    background-color: #ef6c00;
}
.notyf-warning-custom .notyf__dismiss-icon {
    color: var(--darker-bg, #121212);
}


.notyf-info-custom {
    background-color: #2979ff; 
    color: var(--text-color, #f8f8f2);         
    border-left: 4px solid #1c54b2;           
}
.notyf-info-custom .notyf__ripple {
    background-color: #1c54b2;
}
.notyf-info-custom .notyf__dismiss-icon {
    color: var(--text-color, #f8f8f2);
}


/* Dismiss button style - 使用绝对定位 */
.notyf__dismiss-icon {
    position: absolute;
    top: 50%;                             /* 垂直居中：第一步，移到父容器高度的一半 */
    right: var(--spacing-sm, 0.5rem);     /* 距离右边缘的距离 */
    transform: translateY(-50%);          /* 垂直居中：第二步，向上移动自身高度的一半 */
    
    opacity: 0.7; 
    transition: opacity 0.2s ease;
    font-size: 1.25em; 
    line-height: 1; /* 确保单行文字的关闭按钮垂直居中 */
    padding: var(--spacing-xs, 0.25rem); /* 给关闭按钮一点点击区域 */
    cursor: pointer;    
    /* flex-shrink: 0;  不再需要 flex 相关属性 */
    /* margin-left: auto; 不再需要 */
    /* align-self: center; 不再需要 */
}

.notyf__dismiss-icon:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .notyf__toast {
        max-width: calc(100vw - 30px); 
        min-width: 0; 
        padding-top: calc(var(--spacing-xs, 0.25rem) + 3px); 
        padding-bottom: calc(var(--spacing-xs, 0.25rem) + 3px);
        /* 响应式下右内边距也需要足够 */
        padding-right: calc(var(--spacing-md, 1rem) + var(--spacing-xs, 0.25rem)); 
    }
    .notyf { 
        right: var(--spacing-xs, 0.25rem); 
        top: var(--spacing-xs, 0.25rem);   
    }
    .notyf__message {
        font-size: 0.9rem; 
    }
    .notyf__dismiss-icon { /* 调整关闭按钮在小屏幕上的右边距 */
        right: var(--spacing-xs, 0.25rem);
    }
}