/* 动画效果增强 - 提升用户交互体验 */

/* 通用过渡 */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* 淡入淡出动画 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 缩放动画 */
.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.scale-out {
    animation: scaleOut 0.3s ease-in;
}

@keyframes scaleOut {
    from { 
        opacity: 1; 
        transform: scale(1); 
    }
    to { 
        opacity: 0; 
        transform: scale(0.95); 
    }
}

/* 滑动动画 */
.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.slide-in-up {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.slide-in-down {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* 脉冲动画 - 用于通知和强调 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); 
    }
    70% { 
        transform: scale(1.05); 
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); 
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); 
    }
}

/* 心跳动画 - 用于点赞等交互 */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* 摇摆动画 - 用于错误提示 */
.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* 旋转动画 - 用于加载状态 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 呼吸动画 - 用于微妙的强调 */
.breathe {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

/* 闪光效果 - 用于未读消息或新内容 */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

/* 悬停效果增强 */
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 标签页切换动画 */
.tab-content > .tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

/* 滚动条样式美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载状态动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 0.8s linear infinite;
}

/* 按钮点击效果 */
.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* 焦点样式增强 */
.form-control:focus,
.btn:focus,
.dropdown-toggle:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* 骨架屏动画 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 消息通知动画 */
.notification {
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-in 3s forwards;
}

/* 响应式动画调整 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 移动端触摸反馈 */
@media (hover: none) {
    .touch-feedback {
        transition: background-color 0.15s ease;
    }
    
    .touch-feedback:active {
        background-color: rgba(0, 0, 0, 0.1);
    }
}