/* WP Popular Posts Custom Ranking Styles */

/* ランキングヘッダー */
.wpp-ranking-header {
    /*margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;*/
}

.wpp-ranking-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 3px;
    font-weight: 500;
}

.wpp-ranking-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.wpp-category-name {
    color: #333;
    display: inline-block;
    margin-right: 4px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .wpp-ranking-title {
        font-size: 20px;
    }

    .wpp-ranking-date {
        font-size: 12px;
    }
}

/* コントロール部分 */
.wpp-ranking-container {
    max-width: 100%;
    margin: 0 auto;
}

.wpp-ranking-controls {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpp-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e0e0e0;
}

.wpp-tab {
    padding: 5px 24px;
    background: #ffffff;
    border: 2px solid #ddd;
    border-top: 3px solid #ddd;
    border-radius: 4px 4px 0 0;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.wpp-tab:hover {
    color: #757575;
    /*background: #f5f5f5;*/
    /*border-color: #bbb;*/
    /*border-bottom-color: #FF1D90;*/
    border-top: 3px solid #FF1D90;
}

.wpp-tab.active {
    color: #333;
    /*background: #0073aa;*/
    /*border-color: #0073aa;*/
    border-top: 3px solid #FF1D90;
    /*border-bottom-color: #0073aa;*/
}

.wpp-category-filter select {
    width: 100%;
    /*max-width: 300px;*/
    padding: 5px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

/* ランキングリスト */
.wpp-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wpp-ranking-item {
    display: flex;
    grid-template-columns: 50px 120px 1fr;
    gap: 20px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    align-items: center;
    transition: box-shadow 0.3s ease;
    background: white;
    position: relative;
}

.wpp-ranking-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.wpp-item-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.wpp-rank-number {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    text-align: center;
    position:absolute;
    top: 8px;
    left: 5px;
    z-index: 1;
    text-shadow: 1px 1px 1px #000000, 0 0 1em #ffffff, 0 0 0.2em #fff;
    padding: 8px;
}

.wpp-ranking-item[data-rank="1"] .wpp-rank-number {
    color: #fff;
    background-color: #FF1D90;
    border-radius: 5px;
}

.wpp-ranking-item[data-rank="2"] .wpp-rank-number {
    /*color: #C0C0C0;*/
    color: #fff;
    background-color: #FF1D90;
    border-radius: 5px;
}

.wpp-ranking-item[data-rank="3"] .wpp-rank-number {
    /*color: #CD7F32;*/
    color: #fff;
    background-color: #FF1D90;
    border-radius: 5px;
}

.wpp-ranking-item[data-rank="4"] .wpp-rank-number {
    /*color: #CD7F32;*/
    color: #fff;
    background-color: #FF1D90;
    border-radius: 5px;
}

.wpp-ranking-item[data-rank="5"] .wpp-rank-number {
    /*color: #CD7F32;*/
    color: #fff;
    background-color: #FF1D90;
    border-radius: 5px;
}

.wpp-thumbnail {
    width: 120px;
    height: 90px;
    position:relative;
}

.wpp-thumbnail img,
.wpp-no-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.wpp-no-image {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpp-content {
    min-width: 0;
}

.wpp-content h3 {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.4;
}

.wpp-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.wpp-content h3 a:hover {
    color: #0073aa;
}

.wpp-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.wpp-views {
    font-weight: 500;
    color: #0073aa;
}

/* カテゴリバッジ */
.wpp-categories {
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    position: absolute;
    left: 2px;
    bottom: -5px;
}

.wpp-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 500;
}

/* Dashicons対応 */
.wpp-meta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.wpp-no-image .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
}

/* ローディングスピナー */
.wpp-loading {
    text-align: center;
    padding: 40px 20px;
}

.wpp-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.wpp-loading p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* エラー・結果なし */
.wpp-error,
.wpp-no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* もっと読み込むボタン */
.wpp-load-more {
    text-align: center;
    padding: 30px 0;
}

.wpp-btn-primary {
    padding: 12px 30px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wpp-btn-primary:hover {
    background: #005a87;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.wpp-btn-primary:active {
    transform: translateY(0);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .wpp-ranking-item {
        grid-template-columns: 40px 80px 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .wpp-rank-number {
        font-size: 24px;
        padding: 5px;
    }
    
    .wpp-thumbnail,
    .wpp-thumbnail img,
    .wpp-no-image {
        width: 80px;
        height: 60px;
    }
    
    .wpp-content h3 {
        font-size: 16px;
    }
    
    .wpp-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .wpp-tabs {
        flex-wrap: wrap;
    }
    
    .wpp-tab {
        flex: 1;
        min-width: 100px;
    }
}

/* スケルトンローディング（オプション） */
.wpp-ranking-item.skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ランキング内広告ブロック */
.wpp-ranking-ad-block {
    padding: 8px 0;
    text-align: center;
}

.wpp-ranking-ad {
    display: block;
    width: 100%;
}