/* 友谊PK系统样式文件 */

/* 友谊互动区域样式 */
.friendship-interaction-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.friendship-interaction-area .btn {
    transition: all 0.3s ease;
    border-radius: 20px;
}

.friendship-interaction-area .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.friendship-hint {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 15px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* 积分排名系统样式 */
.friendship-ranking-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 积分显示样式 */
.score-display {
    position: relative;
}

.total-score h4 {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: scoreGlow 2s ease-in-out infinite alternate;
}

@keyframes scoreGlow {
    from {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    }
    to {
        text-shadow: 2px 2px 8px rgba(0,123,255,0.3);
    }
}

.score-breakdown {
    background: rgba(0,123,255,0.05);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(0,123,255,0.1);
}

.score-breakdown span:last-child {
    font-weight: bold;
    color: #007bff;
}

/* 成就展示样式 */
.achievements-container {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-item {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 10px;
    padding: 10px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    animation: achievementSlideIn 0.5s ease-out;
}

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

.achievement-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    animation: achievementBounce 1s ease-in-out infinite;
}

@keyframes achievementBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* 排行榜样式 */
.ranking-container {
    min-height: 200px;
}

.ranking-tab {
    transition: all 0.3s ease;
}

.ranking-tab.active {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

.ranking-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.ranking-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.ranking-item.rank-1::before {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.ranking-item.rank-2::before {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.ranking-item.rank-3::before {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
}

.ranking-position {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    min-width: 40px;
    text-align: center;
}

.ranking-position.rank-1 {
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.ranking-position.rank-2 {
    color: #c0c0c0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.ranking-position.rank-3 {
    color: #cd7f32;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.ranking-user-info {
    flex: 1;
    margin-left: 15px;
}

.ranking-username {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.ranking-stats {
    font-size: 0.9rem;
    color: #666;
}

.ranking-score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
    text-align: right;
}

/* 题目交换动画 */
.question-exchange-animation {
    animation: questionExchange 1s ease-in-out;
}

@keyframes questionExchange {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95) rotateY(90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* 友谊通知样式 */
.friendship-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
    animation: notificationSlideIn 0.5s ease-out;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.friendship-notification.notification-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.friendship-notification.notification-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #333;
}

.friendship-notification.notification-info {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    color: white;
}

/* 积分增加动画 */
.score-increase-animation {
    animation: scoreIncrease 1s ease-out;
}

@keyframes scoreIncrease {
    0% {
        transform: scale(1);
        color: inherit;
    }
    50% {
        transform: scale(1.2);
        color: #28a745;
        text-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    }
    100% {
        transform: scale(1);
        color: inherit;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .friendship-ranking-section {
        padding: 15px;
    }
    
    .total-score h4 {
        font-size: 2rem;
    }
    
    .ranking-item {
        padding: 10px;
    }
    
    .ranking-position {
        font-size: 1.2rem;
        min-width: 30px;
    }
    
    .friendship-notification {
        max-width: 300px;
        right: 10px;
        top: 10px;
    }
}

@media (max-width: 576px) {
    .friendship-interaction-area .btn {
        margin-bottom: 10px;
        width: 100%;
    }
    
    .friendship-hint {
        text-align: center;
        margin-top: 10px;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
}

/* 卡片悬停效果 */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Purple color utilities for PK modes */
.bg-purple {
    background-color: #6f42c1 !important;
}

.text-purple {
    color: #6f42c1 !important;
}

.border-purple {
    border-color: #6f42c1 !important;
}

.btn-purple {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: white;
}

.btn-purple:hover {
    background-color: #5a32a3;
    border-color: #5a32a3;
    color: white;
}

.badge.bg-purple {
    background-color: #6f42c1 !important;
    color: white;
}

.progress-bar.bg-purple {
    background-color: #6f42c1 !important;
}

.card-header.bg-purple {
    background-color: #6f42c1 !important;
    color: white;
}