/* 用户体验增强样式 */

/* 加载状态样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    font-size: 1.1rem;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 通知系统样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

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

.notification-success {
    border-left-color: #4caf50;
    background: #f1f8e9;
}

.notification-error {
    border-left-color: #f44336;
    background: #ffebee;
}

.notification-warning {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.notification-info {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.notification-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.notification-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    font-weight: bold;
}

.notification-success .notification-icon {
    color: #4caf50;
}

.notification-error .notification-icon {
    color: #f44336;
}

.notification-warning .notification-icon {
    color: #ff9800;
}

.notification-info .notification-icon {
    color: #2196f3;
}

.notification-message {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #666;
}

/* 表单增强样式 */
.input-focused {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.input-valid input {
    border-color: #4caf50 !important;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.input-invalid input {
    border-color: #f44336 !important;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

/* 按钮波纹效果 */
button, .card-link {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 可访问性增强样式 */
.keyboard-navigation *:focus {
    outline: 2px solid #667eea !important;
    outline-offset: 2px;
}

.focused {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5) !important;
}

/* 改进的提示样式 */
.tips {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
}

.successTips, .errorTips {
    padding: 12px 24px;
    border-radius: 25px;
    color: white;
    font-weight: 500;
    margin-bottom: 10px;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.successTips {
    background: linear-gradient(45deg, #4caf50, #66bb6a);
}

.errorTips {
    background: linear-gradient(45deg, #f44336, #ef5350);
}

.successTips.tipsAnim, .errorTips.tipsAnim {
    transform: translateY(0);
    opacity: 1;
}

/* 响应式改进 */
@media (max-width: 768px) {
    .notification-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        padding: 12px;
    }
    
    .loading-spinner {
        transform: scale(0.8);
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #2d2d2d;
        color: #fff;
    }
    
    .notification-message {
        color: #fff;
    }
    
    .notification-close {
        color: #ccc;
    }
    
    .notification-close:hover {
        color: #fff;
    }
}

/* 动画性能优化 */
@media (prefers-reduced-motion: reduce) {
    .notification,
    .spinner,
    .ripple,
    .successTips,
    .errorTips {
        animation: none !important;
        transition: none !important;
    }
}
