/**
 * 浏览统计前端样式
 * 
 * @package WordPress
 * @subpackage ViewCounterFrontend
 * @since 1.0.0
 */

/* 浏览次数显示 */
.view-count-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.view-count-label {
    font-weight: 500;
}

.view-count-number {
    font-weight: 600;
    color: #0073aa;
}

.post-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
}

.post-views .views-label {
    font-weight: 500;
}

.post-views .views-count {
    font-weight: 600;
    color: #0073aa;
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

/* 热门文章小工具 */
.popular-posts-widget,
.popular-posts-template {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.popular-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.popular-post-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f1;
}

.popular-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s ease;
}

.popular-post-link:hover {
    text-decoration: none;
    color: #0073aa;
}

.popular-post-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.popular-post-link:hover .popular-post-title {
    color: #0073aa;
}

.popular-post-excerpt {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.popular-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: #999;
}

.popular-post-views {
    background: #0073aa;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.popular-post-date {
    color: #999;
}

/* 短代码样式 */
.view-count-shortcode {
    display: inline-block;
    margin: 5px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .popular-posts-widget,
    .popular-posts-template {
        padding: 15px;
    }
    
    .popular-post-title {
        font-size: 15px;
    }
    
    .popular-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .post-views {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* 动画效果 */
.popular-post-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载状态 */
.view-counter-loading {
    opacity: 0.6;
    pointer-events: none;
}

.view-counter-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 主题集成样式 */
.single-post .post-views,
.single-product .post-views,
.single-video .post-views {
    margin: 15px 0;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 4px solid #0073aa;
}

/* 小工具标题样式 */
.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #333;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .popular-posts-widget,
    .popular-posts-template {
        background: #1e1e1e;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    .popular-post-title {
        color: #f0f0f1;
    }
    
    .popular-post-link:hover .popular-post-title {
        color: #4a9eff;
    }
    
    .popular-post-excerpt {
        color: #b4b4b4;
    }
    
    .post-views {
        background: #2c2c2c;
        color: #b4b4b4;
    }
    
    .post-views .views-count {
        background: #1e1e1e;
        border-color: #3c434a;
        color: #4a9eff;
    }
    
    .single-post .post-views,
    .single-product .post-views,
    .single-video .post-views {
        background: linear-gradient(135deg, #2c2c2c, #3c434a);
        border-left-color: #4a9eff;
    }
    
    .widget-title {
        color: #f0f0f1;
        border-bottom-color: #4a9eff;
    }
}

/* 打印样式 */
@media print {
    .popular-posts-widget,
    .popular-posts-template {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .popular-post-views {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
}
