/**
 * Toast提示系统样式
 */

/* Toast容器 */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
    align-items: center;
}

/* Toast消息 */
.toast {
    background: var(--card-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), background-color 0.3s ease;
    pointer-events: auto;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border-color, transparent);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary, #333);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary, #999);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary, #333);
}

/* 不同类型的Toast */
.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

/* 确认对话框 */
.toast-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast-confirm-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.toast-confirm-dialog {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), background-color 0.3s ease;
    border: 1px solid var(--border-color, #e0e0e0);
}

.toast-confirm-overlay.show .toast-confirm-dialog {
    transform: scale(1);
}

.toast-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 12px;
}

.toast-confirm-message {
    font-size: 14px;
    color: var(--text-secondary, #666);
    line-height: 1.6;
    margin-bottom: 20px;
}

.toast-confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.toast-confirm-buttons .btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.toast-confirm-buttons .btn-cancel {
    background: var(--hover-bg, #f5f5f5);
    color: var(--text-primary, #333) !important;
    border-color: var(--border-color, #ddd);
}

.toast-confirm-buttons .btn-cancel:hover {
    background: var(--hover-bg, rgba(0, 0, 0, 0.1));
    color: var(--text-primary, #333) !important;
}

.toast-confirm-buttons .btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    border: none;
}

.toast-confirm-buttons .btn-confirm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff !important;
}

/* 深色主题增强 */
html[data-theme="dark"] .toast-confirm-dialog,
html[data-theme="dark-blue"] .toast-confirm-dialog,
html[data-theme="dark-green"] .toast-confirm-dialog,
html[data-theme="tech-dark"] .toast-confirm-dialog {
    background: var(--card-bg, #1e293b) !important;
    border-color: var(--border-color, #334155) !important;
}

html[data-theme="dark"] .toast-confirm-title,
html[data-theme="dark-blue"] .toast-confirm-title,
html[data-theme="dark-green"] .toast-confirm-title,
html[data-theme="tech-dark"] .toast-confirm-title {
    color: var(--text-primary, #f1f5f9) !important;
}

html[data-theme="dark"] .toast-confirm-message,
html[data-theme="dark-blue"] .toast-confirm-message,
html[data-theme="dark-green"] .toast-confirm-message,
html[data-theme="tech-dark"] .toast-confirm-message {
    color: var(--text-secondary, #cbd5e1) !important;
}

html[data-theme="dark"] .toast,
html[data-theme="dark-blue"] .toast,
html[data-theme="dark-green"] .toast,
html[data-theme="tech-dark"] .toast {
    background: var(--card-bg, #1e293b) !important;
    border-color: var(--border-color, #334155) !important;
}

html[data-theme="dark"] .toast-message,
html[data-theme="dark-blue"] .toast-message,
html[data-theme="dark-green"] .toast-message,
html[data-theme="tech-dark"] .toast-message {
    color: var(--text-primary, #f1f5f9) !important;
}

html[data-theme="dark"] .toast-close,
html[data-theme="dark-blue"] .toast-close,
html[data-theme="dark-green"] .toast-close,
html[data-theme="tech-dark"] .toast-close {
    color: var(--text-secondary, #94a3b8) !important;
}

html[data-theme="dark"] .toast-close:hover,
html[data-theme="dark-blue"] .toast-close:hover,
html[data-theme="dark-green"] .toast-close:hover,
html[data-theme="tech-dark"] .toast-close:hover {
    color: var(--text-primary, #f1f5f9) !important;
}

html[data-theme="dark"] .toast-confirm-buttons .btn-cancel,
html[data-theme="dark-blue"] .toast-confirm-buttons .btn-cancel,
html[data-theme="dark-green"] .toast-confirm-buttons .btn-cancel,
html[data-theme="tech-dark"] .toast-confirm-buttons .btn-cancel {
    background: var(--hover-bg, rgba(255, 255, 255, 0.1)) !important;
    color: var(--text-primary, #f1f5f9) !important;
    border-color: var(--border-color, #475569) !important;
}

html[data-theme="dark"] .toast-confirm-buttons .btn-cancel:hover,
html[data-theme="dark-blue"] .toast-confirm-buttons .btn-cancel:hover,
html[data-theme="dark-green"] .toast-confirm-buttons .btn-cancel:hover,
html[data-theme="tech-dark"] .toast-confirm-buttons .btn-cancel:hover {
    background: var(--hover-bg, rgba(255, 255, 255, 0.15)) !important;
    color: var(--text-primary, #f1f5f9) !important;
}

/* 确保确认按钮文字在所有主题下都可见 */
html[data-theme="dark"] .toast-confirm-buttons .btn-confirm,
html[data-theme="dark-blue"] .toast-confirm-buttons .btn-confirm,
html[data-theme="dark-green"] .toast-confirm-buttons .btn-confirm,
html[data-theme="tech-dark"] .toast-confirm-buttons .btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border: none !important;
}

html[data-theme="dark"] .toast-confirm-buttons .btn-confirm:hover,
html[data-theme="dark-blue"] .toast-confirm-buttons .btn-confirm:hover,
html[data-theme="dark-green"] .toast-confirm-buttons .btn-confirm:hover,
html[data-theme="tech-dark"] .toast-confirm-buttons .btn-confirm:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    opacity: 0.9 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .toast-container {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: 10px;
        left: 10px;
        max-width: none;
        width: calc(100% - 20px);
    }
    
    .toast {
        transform: translateY(-30px) scale(0.95);
        width: 100%;
    }
    
    .toast.show {
        transform: translateY(0) scale(1);
    }
    
    .toast-confirm-dialog {
        margin: 20px;
        width: calc(100% - 40px);
    }
}
