/**
 * Toast 通知系统样式
 * 现代、美观、响应式
 */

/* 容器 */
.toast-container {
    position: fixed;
    top: 100px; /* 桌面端：导航栏 80px + 20px 间距 */
    right: 20px;
    z-index: 999999; /* 必须高于导航栏 (99999) */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: auto;
    max-width: 500px;
}

/* 响应式调整 - 跟随导航栏高度变化 */

/* 平板端 (≤991px, >767px) - 导航栏 60px */
@media (max-width: 991px) {
    .toast-container {
        top: 80px; /* 60px + 20px 间距 */
    }
}

/* 小屏幕 (≤767px) - 导航栏 50px */
@media (max-width: 767px) {
    .toast-container {
        top: 70px; /* 50px + 20px 间距 */
        right: 15px;
        max-width: calc(100vw - 30px);
    }
}

/* 更小屏幕 (≤480px) - 导航栏 45px */
@media (max-width: 480px) {
    .toast-container {
        top: 60px; /* 45px + 15px 间距 */
        right: 10px;
        max-width: calc(100vw - 20px);
    }
}

/* 超小屏幕 (≤360px) - 导航栏 40px */
@media (max-width: 360px) {
    .toast-container {
        top: 55px; /* 40px + 15px 间距 */
        right: 10px;
        max-width: calc(100vw - 20px);
    }
}

/* Toast 元素的移动端优化 */

/* 小屏幕 (≤767px) */
@media (max-width: 767px) {
    .brygg-toast {
        min-width: 280px;
        max-width: calc(100vw - 30px);
        padding: 14px 18px;
        font-size: 13px;
    }
    
    .brygg-toast-icon {
        font-size: 18px;
        min-width: 18px;
    }
    
    .brygg-toast-close {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}

/* 更小屏幕 (≤480px) */
@media (max-width: 480px) {
    .brygg-toast {
        min-width: 260px;
        max-width: calc(100vw - 20px);
        padding: 12px 16px;
        font-size: 12px;
        gap: 10px;
    }
    
    .brygg-toast-icon {
        font-size: 16px;
        min-width: 16px;
    }
    
    .brygg-toast-close {
        width: 22px;
        height: 22px;
        font-size: 14px;
    }
}

/* 超小屏幕 (≤360px) */
@media (max-width: 360px) {
    .brygg-toast {
        min-width: 240px;
        max-width: calc(100vw - 20px);
        padding: 10px 14px;
        font-size: 11px;
        gap: 8px;
    }
    
    .brygg-toast-icon {
        font-size: 14px;
        min-width: 14px;
    }
    
    .brygg-toast-close {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* Toast 基础样式 - 使用 brygg-toast 前缀避免与 Bootstrap 冲突 */
.brygg-toast {
    position: relative;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 显示动画 */
.brygg-toast-show {
    opacity: 1;
    transform: translateX(0);
}

/* 隐藏动画 */
.brygg-toast-hide {
    opacity: 0;
    transform: translateX(400px) scale(0.9);
}

/* 图标容器 */
.brygg-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 消息文本 */
.brygg-toast-message {
    flex: 1;
    color: #333;
    font-weight: 500;
}

/* 关闭按钮 */
.brygg-toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
    opacity: 0.6;
}

.brygg-toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.brygg-toast-close:active {
    transform: scale(0.95);
}

/* 成功 Toast */
.brygg-toast-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
}

.brygg-toast-success .brygg-toast-icon {
    color: #28a745;
}

.brygg-toast-success .brygg-toast-message {
    color: #155724;
}

/* 错误 Toast */
.brygg-toast-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
}

.brygg-toast-error .brygg-toast-icon {
    color: #dc3545;
}

.brygg-toast-error .brygg-toast-message {
    color: #721c24;
}

/* 警告 Toast */
.brygg-toast-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
}

.brygg-toast-warning .brygg-toast-icon {
    color: #f39c12;
}

.brygg-toast-warning .brygg-toast-message {
    color: #856404;
}

/* 信息 Toast */
.brygg-toast-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid #17a2b8;
}

.brygg-toast-info .brygg-toast-icon {
    color: #17a2b8;
}

.brygg-toast-info .brygg-toast-message {
    color: #0c5460;
}


/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .brygg-toast {
        background: #2d2d30;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 
                    0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    
    .brygg-toast-message {
        color: #e0e0e0;
    }
    
    .brygg-toast-close {
        color: #999;
    }
    
    .brygg-toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* 成功 - 深色模式 */
    .brygg-toast-success {
        background: linear-gradient(135deg, #1e3a28 0%, #2d5a3f 100%);
        border-left-color: #4caf50;
    }
    
    .brygg-toast-success .brygg-toast-icon {
        color: #4caf50;
    }
    
    .brygg-toast-success .brygg-toast-message {
        color: #a5d6a7;
    }
    
    /* 错误 - 深色模式 */
    .brygg-toast-error {
        background: linear-gradient(135deg, #3a1e1e 0%, #5a2d2d 100%);
        border-left-color: #f44336;
    }
    
    .brygg-toast-error .brygg-toast-icon {
        color: #f44336;
    }
    
    .brygg-toast-error .brygg-toast-message {
        color: #ef9a9a;
    }
    
    /* 警告 - 深色模式 */
    .brygg-toast-warning {
        background: linear-gradient(135deg, #3a3a1e 0%, #5a5a2d 100%);
        border-left-color: #ff9800;
    }
    
    .brygg-toast-warning .brygg-toast-icon {
        color: #ff9800;
    }
    
    .brygg-toast-warning .brygg-toast-message {
        color: #ffcc80;
    }
    
    /* 信息 - 深色模式 */
    .brygg-toast-info {
        background: linear-gradient(135deg, #1e2a3a 0%, #2d405a 100%);
        border-left-color: #2196f3;
    }
    
    .brygg-toast-info .brygg-toast-icon {
        color: #2196f3;
    }
    
    .brygg-toast-info .brygg-toast-message {
        color: #90caf9;
    }
}

/* 打印时隐藏 */
@media print {
    .toast-container {
        display: none !important;
    }
}

