/**
 * Fan Portal ウィジェット スタイルシート
 * 
 * @package Fan_Portal
 * @since 1.0.0
 */

/* ========================================
   共通スタイル
======================================== */
.widget[class*="widget_fp_"] {
    margin-bottom: 30px;
}

.widget[class*="widget_fp_"] ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget[class*="widget_fp_"] a {
    text-decoration: none;
    transition: all 0.3s ease;
}

.widget[class*="widget_fp_"] a:hover {
    opacity: 0.8;
}

/* エラー・データなし表示 */
.fp-no-data,
.fp-no-posts {
    padding: 20px;
    text-align: center;
    color: #999;
    background: #f5f5f5;
    border-radius: 4px;
}

/* ========================================
   人気コンテンツウィジェット - モダンカードデザイン
======================================== */
/* 2×2グリッドタブ */
.fp-widget-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.fp-widget-tab {
    padding: 10px;
    text-align: center;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
    font-weight: 500;
    color: #333;
}

.fp-widget-tab:hover {
    background: #e0e0e0;
}

.fp-widget-tab.active {
    background: #f47920;
    color: white;
}

.fp-widget-tab.loading {
    opacity: 0.6;
    cursor: wait;
}

/* 回答数バッジ */
.fp-response-count {
    font-weight: bold;
    color: #f47920;
    margin-left: 8px;
    font-size: 0.9em;
}

/* リスト形式の人気コンテンツ */
.fp-popular-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fp-popular-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fp-popular-item:last-child {
    border-bottom: none;
}

.fp-popular-item .fp-rank {
    font-size: 16px;
    font-weight: bold;
    min-width: 50px;
}

.fp-popular-item a {
    flex: 1;
    color: #333;
    font-weight: 500;
}

.fp-popular-item a:hover {
    color: #f47920;
}

.fp-popular-item .fp-category {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* ========================================
   人気コンテンツウィジェット - モダンカードデザイン（既存）
======================================== */
.widget.widget_fp_popular_content .fp-popular-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* カードベース */
.widget.widget_fp_popular_content .fp-popular-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.widget.widget_fp_popular_content .fp-popular-card:nth-child(1) {
    animation-delay: 0.1s;
}

.widget.widget_fp_popular_content .fp-popular-card:nth-child(2) {
    animation-delay: 0.2s;
}

.widget.widget_fp_popular_content .fp-popular-card:nth-child(3) {
    animation-delay: 0.3s;
}

.widget.widget_fp_popular_content .fp-popular-card:nth-child(4) {
    animation-delay: 0.4s;
}

.widget.widget_fp_popular_content .fp-popular-card:nth-child(5) {
    animation-delay: 0.5s;
}

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

.widget.widget_fp_popular_content .fp-popular-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget.widget_fp_popular_content .fp-popular-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    border-color: rgba(79, 172, 254, 0.2);
}

.widget.widget_fp_popular_content .fp-popular-card:hover::before {
    opacity: 1;
}

/* ランク表示 */
.widget.widget_fp_popular_content .fp-popular-rank {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 0 12px 0 20px;
    font-weight: bold;
}

/* 1位〜3位の特別な色 */
.widget.widget_fp_popular_content .fp-popular-card:nth-child(1) .fp-popular-rank {
    background: linear-gradient(135deg, #FFD700, #FFA000);
}

.widget.widget_fp_popular_content .fp-popular-card:nth-child(2) .fp-popular-rank {
    background: linear-gradient(135deg, #C0C0C0, #808080);
}

.widget.widget_fp_popular_content .fp-popular-card:nth-child(3) .fp-popular-rank {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
}

.widget.widget_fp_popular_content .fp-rank-number {
    font-size: 20px;
    margin-right: 4px;
}

.widget.widget_fp_popular_content .fp-rank-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* コンテンツエリア */
.widget.widget_fp_popular_content .fp-popular-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.widget.widget_fp_popular_content .fp-type-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.widget.widget_fp_popular_content .fp-popular-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: #1a1a1a;
}

.widget.widget_fp_popular_content .fp-popular-title a {
    color: inherit;
    text-decoration: none;
}

.widget.widget_fp_popular_content .fp-popular-title a:hover {
    color: #007cba;
}

/* 統計情報 */
.widget.widget_fp_popular_content .fp-popular-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget.widget_fp_popular_content .fp-progress-bar {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.widget.widget_fp_popular_content .fp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 3px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.widget.widget_fp_popular_content .fp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.widget.widget_fp_popular_content .fp-vote-count {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

/* メタ情報 */
.widget.widget_fp_popular_content .fp-popular-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.widget.widget_fp_popular_content .fp-trend {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.widget.widget_fp_popular_content .fp-trend-up {
    color: #4caf50;
}

.widget.widget_fp_popular_content .fp-trend-down {
    color: #f44336;
}

.widget.widget_fp_popular_content .fp-trend-neutral {
    color: #999;
}

.widget.widget_fp_popular_content .fp-category {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .widget.widget_fp_popular_content .fp-popular-card {
        background: #2a2a2a;
        color: #ffffff;
    }
    
    .widget.widget_fp_popular_content .fp-popular-title {
        color: #ffffff;
    }
    
    .widget.widget_fp_popular_content .fp-progress-bar {
        background: #3a3a3a;
    }
    
    .widget.widget_fp_popular_content .fp-category {
        background: #3a3a3a;
        color: #ffffff;
    }
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .widget.widget_fp_popular_content .fp-popular-card {
        padding: 16px;
    }
    
    .widget.widget_fp_popular_content .fp-popular-rank {
        position: static;
        display: inline-block;
        margin-bottom: 12px;
        border-radius: 20px;
    }
}

/* ========================================
   最新コンテンツウィジェット
======================================== */
.widget.widget_fp_latest_content .fp-latest-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    line-height: 1.6;
}

.widget.widget_fp_latest_content .fp-latest-item:last-child {
    border-bottom: none;
}

.widget.widget_fp_latest_content .fp-type-label {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    margin-right: 5px;
}

.widget.widget_fp_latest_content .fp-type-poll {
    background: #e3f2fd;
    color: #1976d2;
}

.widget.widget_fp_latest_content .fp-type-quiz {
    background: #f3e5f5;
    color: #7b1fa2;
}

.widget.widget_fp_latest_content .fp-type-shindan {
    background: #e8f5e9;
    color: #388e3c;
}

.widget.widget_fp_latest_content .fp-date {
    font-size: 12px;
    color: #999;
}

/* ========================================
   カテゴリー別ウィジェット
======================================== */
/* リスト形式 */
.widget.widget_fp_category_list .fp-category-section {
    margin-bottom: 20px;
}

.widget.widget_fp_category_list .fp-category-title {
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #333;
    font-size: 16px;
}

.widget.widget_fp_category_list .fp-cat-count {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.widget.widget_fp_category_list .fp-category-posts li {
    padding: 5px 0;
    padding-left: 15px;
    position: relative;
}

.widget.widget_fp_category_list .fp-category-posts li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #999;
}

/* タブ形式 */
.widget.widget_fp_category_list .fp-category-tabs {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.widget.widget_fp_category_list .fp-tab-nav {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.widget.widget_fp_category_list .fp-tab-item {
    flex: 1;
    min-width: 80px;
}

.widget.widget_fp_category_list .fp-tab-btn {
    display: block;
    padding: 10px 15px;
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.widget.widget_fp_category_list .fp-tab-item.active .fp-tab-btn,
.widget.widget_fp_category_list .fp-tab-btn:hover {
    background: #fff;
    font-weight: bold;
}

.widget.widget_fp_category_list .fp-tab-content {
    padding: 15px;
}

.widget.widget_fp_category_list .fp-tab-panel {
    display: none;
}

.widget.widget_fp_category_list .fp-tab-panel.active {
    display: block;
}

/* ========================================
   ランダムコンテンツウィジェット
======================================== */
.widget.widget_fp_random_content .fp-random-content {
    position: relative;
    min-height: 100px;
}

.widget.widget_fp_random_content .fp-random-content-inner {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.widget.widget_fp_random_content .fp-random-thumbnail {
    margin-bottom: 15px;
    text-align: center;
}

.widget.widget_fp_random_content .fp-random-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.widget.widget_fp_random_content .fp-random-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: bold;
}

.widget.widget_fp_random_content .fp-random-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.widget.widget_fp_random_content .fp-random-category {
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 3px;
}

.widget.widget_fp_random_content .fp-random-count,
.widget.widget_fp_random_content .fp-random-rate {
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 3px;
}

.widget.widget_fp_random_content .fp-random-excerpt {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

.widget.widget_fp_random_content .fp-random-button {
    display: inline-block;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.widget.widget_fp_random_content .fp-random-button:hover {
    background: #555;
    opacity: 1;
}

.widget.widget_fp_random_content .fp-random-actions {
    margin-top: 10px;
    text-align: center;
}

.widget.widget_fp_random_content .fp-random-refresh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget.widget_fp_random_content .fp-random-refresh:hover {
    background: #e0e0e0;
}

/* ローディング状態 */
.widget.widget_fp_random_content .fp-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.widget.widget_fp_random_content .fp-loading .fp-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: fp-spin 1s linear infinite;
}

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

/* ========================================
   統計情報ウィジェット
======================================== */
.widget.widget_fp_stats .fp-stats-widget {
    display: grid;
    gap: 15px;
}

.widget.widget_fp_stats .fp-stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.widget.widget_fp_stats .fp-stat-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.widget.widget_fp_stats .fp-stat-icon {
    flex-shrink: 0;
}

.widget.widget_fp_stats .fp-stat-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #666;
}

.widget.widget_fp_stats .fp-stat-posts .dashicons {
    color: #2196f3;
}

.widget.widget_fp_stats .fp-stat-votes .dashicons {
    color: #4caf50;
}

.widget.widget_fp_stats .fp-stat-today .dashicons {
    color: #ff9800;
}

.widget.widget_fp_stats .fp-stat-users .dashicons {
    color: #9c27b0;
}

.widget.widget_fp_stats .fp-stat-content {
    flex: 1;
}

.widget.widget_fp_stats .fp-stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.widget.widget_fp_stats .fp-stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.widget.widget_fp_stats .fp-stat-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

/* 人気カテゴリー */
.widget.widget_fp_stats .fp-stat-popular-cats {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.widget.widget_fp_stats .fp-stat-popular-cats h4 {
    margin: 0 0 10px;
    font-size: 16px;
}

.widget.widget_fp_stats .fp-popular-cat-list {
    counter-reset: cat-ranking;
    padding-left: 20px;
}

.widget.widget_fp_stats .fp-popular-cat-list li {
    counter-increment: cat-ranking;
    margin-bottom: 5px;
}

.widget.widget_fp_stats .fp-popular-cat-list li:before {
    content: counter(cat-ranking) ". ";
    font-weight: bold;
    color: #999;
}

/* ========================================
   急上昇ウィジェット
======================================== */
.fp-trending-content-widget {
    background: #fff;
}

.fp-trending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fp-trending-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.fp-trending-item:last-child {
    border-bottom: none;
}

.fp-trending-item:hover {
    background-color: #f8f9fa;
}

/* ヘッダー部分 */
.fp-trending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fp-trending-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.fp-trending-rank-1 .fp-trending-rank {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: white;
}

.fp-trending-rank-2 .fp-trending-rank {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: white;
}

.fp-trending-rank-3 .fp-trending-rank {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
}

/* 増加数 */
.fp-trending-increase {
    color: #27ae60;
    font-weight: bold;
    font-size: 14px;
}

/* NEWバッジ */
.fp-new-badge {
    background: #ff4757;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

/* コンテンツタイプ */
.fp-content-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.fp-type-poll {
    background: #e3f2fd;
    color: #1976d2;
}

.fp-type-quiz {
    background: #f3e5f5;
    color: #7b1fa2;
}

.fp-type-shindan {
    background: #e8f5e9;
    color: #388e3c;
}

/* タイトル */
.fp-trending-title {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 500;
}

.fp-trending-title a {
    color: #333;
    text-decoration: none;
}

.fp-trending-title a:hover {
    color: #f47920;
}

/* レート表示 */
.fp-trending-rate {
    color: #666;
    font-size: 12px;
}

/* データなし */
.fp-no-trending {
    padding: 30px;
    text-align: center;
    color: #999;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ========================================
   レスポンシブ対応
======================================== */
@media (max-width: 768px) {
    .widget.widget_fp_category_list .fp-tab-nav {
        flex-direction: column;
    }
    
    .widget.widget_fp_category_list .fp-tab-item {
        width: 100%;
    }
    
    .widget.widget_fp_stats .fp-stat-item {
        padding: 10px;
    }
    
    .widget.widget_fp_stats .fp-stat-icon .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }
    
    .widget.widget_fp_stats .fp-stat-number {
        font-size: 20px;
    }
}

/* ========================================
   印刷対応
======================================== */
@media print {
    .widget.widget_fp_random_content .fp-random-actions,
    .widget.widget_fp_category_list .fp-tab-nav {
        display: none;
    }
    
    .widget.widget_fp_category_list .fp-tab-panel {
        display: block !important;
        page-break-inside: avoid;
    }
}