/* =========================================================
   FANZA Data Fetcher Plugin Styles
   (女優・商品・動画ランキング プロフェッショナル統合版 - CV強化)
   ========================================================= */

/* ---------------------------------------------------------
   共通設定 (アニメーション・バッジ・ボタンなど)
   --------------------------------------------------------- */

/* GODランクの虹色アニメーション定義 */
@keyframes rainbow-glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ランクバッジ（共通） */
.rank-badge, .voltage-rank {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    display: inline-block;
}

/* ティアごとの色設定 */
.tier-GOD {
    background: linear-gradient(270deg, #ff00cc, #3333ff, #00ccff, #ff00cc);
    background-size: 400% 400%;
    animation: rainbow-glow 4s ease infinite;
    color: #fff !important;
    border: none;
    box-shadow: 0 0 8px rgba(255, 0, 204, 0.6);
}
.tier-SSS { background: linear-gradient(90deg, #ff0000, #ff4500); }
.tier-SS  { background: linear-gradient(90deg, #ff8c00, #ffd700); }
.tier-S   { background: #ffd700; color:#000; text-shadow:none; }
.tier-A   { background: #32cd32; }
.tier-B   { background: #666; }

/* ---------------------------------------------------------
   共通：ボタンエリア（★コンバージョン強化・ピンクver★）
   --------------------------------------------------------- */
.ranking-card-actions { margin-top: 16px; }

.ranking-card-cta, .actress-card .ranking-card-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    
    /* 薄めのピンク系グラデーション */
    background: linear-gradient(to bottom, #ffeaf4, #ffcce6); 
    
    color: #330d1a !important; /* 文字色は濃い小豆色 */
    text-align: center;
    padding: 12px 0;
    border-radius: 6px;
    font-size: 15px;
    text-decoration: none !important;
    font-weight: 800;
    border: none;
    
    /* 影もピンク系に合わせる */
    box-shadow: 0 4px 6px rgba(255, 105, 180, 0.2); 
    
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

/* ボタンの光沢エフェクト */
.ranking-card-cta::before, .actress-card .ranking-card-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: all 0.5s;
}

.ranking-card-cta:hover, .actress-card .ranking-card-cta:hover {
    /* ホバー時はさらに明るく */
    background: linear-gradient(to bottom, #fff5fa, #ffe0f0); 
    
    color: #000 !important;
    transform: translateY(-2px);
    
    /* ホバー時の影を少し強く */
    box-shadow: 0 6px 12px rgba(255, 105, 180, 0.35); 
}

.ranking-card-cta:hover::before, .actress-card .ranking-card-cta:hover::before {
    left: 100%;
}

.icon-external {
    margin-left: 8px;
    font-size: 14px;
    color: #cc0066; 
}


/* ---------------------------------------------------------
   1. 女優ランキング (Actress Ranking)
   --------------------------------------------------------- */
.actress-ranking-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
}
@media screen and (min-width: 768px) {
    .actress-ranking-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}
.actress-card.rank-card-wrapper {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.25s;
}
.actress-card.rank-card-wrapper:hover {
    transform: translateY(-6px);
    border-color: #555;
    box-shadow: 0 12px 24px rgba(0,0,0,0.8);
    z-index: 2;
}
.actress-card .ranking-card-rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: rgba(0,0,0,0.9);
    color: #fff;
    font-weight: 800;
    padding: 6px 14px;
    font-size: 16px;
    border-radius: 8px 0 16px 0;
    border-right: 1px solid #444;
    border-bottom: 1px solid #444;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.actress-card.rank-card-wrapper:nth-child(1) .ranking-card-rank-badge { background: linear-gradient(135deg, #FFD700, #FDB931); color:#000; border:none; }
.actress-card.rank-card-wrapper:nth-child(2) .ranking-card-rank-badge { background: linear-gradient(135deg, #E0E0E0, #BDBDBD); color:#000; border:none; }
.actress-card.rank-card-wrapper:nth-child(3) .ranking-card-rank-badge { background: linear-gradient(135deg, #CD7F32, #A0522D); color:#fff; border:none; }
.actress-card-image-wrapper {
    width: 100%;
    aspect-ratio: 200 / 280;
    background: #0d0d0d;
    position: relative;
    overflow: hidden;
}
.actress-card-image-wrapper a { display: block; width: 100%; height: 100%; }
.actress-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 100% 0%;
    transition: transform 0.4s ease;
}
.actress-card.rank-card-wrapper:hover .actress-card-image-wrapper img { transform: scale(1.06); }
.actress-card-content {
    padding: 16px;
    background: #181818;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.actress-name {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}
.actress-name a { color: #fff !important; text-decoration: none !important; transition: color 0.2s; }
.actress-name a:hover { color: #ffd700 !important; }
.actress-name .ruby { display: block; font-size: 11px; color: #999; margin-bottom: 4px; font-weight: 400; }
.finder-score-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-left: 3px solid #444;
}
.actress-card.tier-GOD .finder-score-card { border-left-color: #ff00cc; background: rgba(255, 0, 204, 0.08); }
.score-main { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 2px; }
.score-label { font-size: 10px; color: #888; text-transform: uppercase; margin-bottom: 4px; }
.score-value {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", sans-serif;
    font-weight: 900;
    font-size: 28px;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: -0.5px;
}
.icon-bolt { font-size: 20px; color: #ffcc00; margin-right: 6px; vertical-align: bottom; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.actress-specs { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.actress-meta, .actress-bwh { color: #ccc; font-size: 12px; margin: 3px 0; line-height: 1.5; }
.actress-meta span { margin-right: 12px; display: inline-block; }
.actress-bwh { color: #aaa; }


/* ---------------------------------------------------------
   2. 商品ランキング (Products Ranking)
   --------------------------------------------------------- */

.products-ranking-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
}
@media screen and (min-width: 768px) {
    .products-ranking-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

.product-card {
    background: #181818;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.25s;
}
.product-card:hover {
    transform: translateY(-6px);
    border-color: #555;
    box-shadow: 0 12px 24px rgba(0,0,0,0.8);
    z-index: 2;
}

/* 商品：順位バッジ */
.product-card .ranking-card-rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: rgba(0,0,0,0.9);
    color: #fff;
    font-weight: 800;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 8px 0 12px 0;
    border-right: 1px solid #444;
    border-bottom: 1px solid #444;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.product-card:nth-child(1) .ranking-card-rank-badge { background: linear-gradient(135deg, #FFD700, #FDB931); color:#000; border:none; }
.product-card:nth-child(2) .ranking-card-rank-badge { background: linear-gradient(135deg, #E0E0E0, #BDBDBD); color:#000; border:none; }
.product-card:nth-child(3) .ranking-card-rank-badge { background: linear-gradient(135deg, #CD7F32, #A0522D); color:#fff; border:none; }

/* 商品：画像エリア */
.product-card .ranking-card-media-area {
    width: 100%;
    aspect-ratio: 147 / 200; /* DMMパッケージ比率 */
    background: #0d0d0d;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #222;
}
.product-card .ranking-card-media-area a { display: block; width: 100%; height: 100%; }
.product-card .ranking-card-media-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 100% 0%; 
    transition: transform 0.4s ease;
}
.product-card:hover .ranking-card-media-area img { transform: scale(1.06); }

/* 商品：情報エリア */
.product-card .ranking-card-info-area {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* 商品：タイトル */
.product-card .ranking-card-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-card .ranking-card-title a { color: #fff !important; text-decoration: none !important; transition: color 0.2s; }
.product-card .ranking-card-title a:hover { color: #ffd700 !important; }

/* 商品：出演女優リンク */
.ranking-card-actresses {
    font-size: 13px;
    color: #ccc; 
    margin-bottom: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.ranking-card-actresses a {
    color: #ddd !important;
    text-decoration: none;
    background: rgba(255,255,255,0.1);
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 6px;
    transition: background 0.2s, color 0.2s;
}
.ranking-card-actresses a:hover { background: rgba(255,255,255,0.25); color: #fff !important; }
.actress-etc { color: #999; font-size: 12px; }


/* 商品：ボルテージ＆メタ */
.product-card .ranking-card-meta-info {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 10px 12px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-card .fdf-voltage-display { display: flex; align-items: center; gap: 8px; }
.product-card .voltage-score {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 900;
    font-size: 22px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    line-height: 1;
}
.product-card .voltage-icon { font-size: 18px; color: #ffcc00; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

/* 商品：レビュー評価 */
.product-card .ranking-card-review {
    font-size: 13px;
    color: #bbb;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}
.product-card .review-stars {
    color: #ffcc00;
    font-size: 15px; 
    letter-spacing: 1px;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.product-card .review-count {
    font-size: 12px;
    color: #888;
}

/* =========================================
   ソートUI (Finder風)
   ========================================= */
.fdf-sort-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    z-index: 100;
}

/* ボタン本体 */
.fdf-sort-trigger {
    background: #252525;
    color: #fff;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.fdf-sort-trigger:hover {
    background: #333;
    border-color: #666;
}
.fdf-sort-trigger span {
    color: #ffcc00;
}

/* ドロップダウンメニュー */
.fdf-sort-options {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    list-style: none;
    padding: 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    
    /* アニメーション用 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* メニュー表示時 (JSで.active付与) */
.fdf-sort-container.active .fdf-sort-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fdf-sort-options li {
    border-bottom: 1px solid #222;
    margin: 0;
}
.fdf-sort-options li:last-child {
    border-bottom: none;
}

.fdf-sort-options a {
    display: block;
    padding: 10px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}
.fdf-sort-options a:hover {
    background: #333;
    color: #fff;
}
.fdf-sort-options a.active {
    color: #ffcc00;
    font-weight: bold;
    background: #252525;
}

/* =========================================
   3. 動画ランキング (Video Ranking) - 最終調整版
   ========================================= */

/* ★重要：動画エリアの親枠のスタイルをリセット */
.product-card .video-media-area {
    width: 100% !important;
    aspect-ratio: auto !important; /* 縦長設定を解除 */
    height: auto !important;
    min-height: 0 !important;
    background: #000 !important;
    border-bottom: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* 動画のiframeエリア: 高さを広げて操作パネルを表示 */
.video-media-area .iframe-responsive-container {
    position: relative !important;
    width: 100% !important;
    
    /* ★ここを変更：高さを 56.25%(16:9) から 75%(4:3) に拡大 */
    /* これにより、動画の下にある再生ボタンなどの操作エリアが見えるようになります */
    padding-bottom: 75% !important; 
    
    height: 0 !important;
    overflow: hidden !important;
    background: #000 !important;
    z-index: 1;
}

/* iframe本体 */
.video-media-area iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- 以下、レイアウト調整（変更なし） --- */

/* 動画下のコンテンツ（余白削除） */
.video-card-content {
    background: #181818;
    padding: 12px;
    padding-top: 0 !important; /* 動画との隙間をなくす */
    margin-top: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: none;
}

/* 上段：画像 + 情報 */
.video-card-top-row {
    display: flex;
    gap: 12px;
    margin-top: 12px; /* コンテンツ開始位置 */
}

/* 左：ジャケット画像（商品ランクと同じ縦長・右側トリミング） */
.video-thumb-column {
    flex: 0 0 30%;
    max-width: 100px;
}
.video-thumb-column a {
    display: block;
    width: 100%;
    aspect-ratio: 147 / 200;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #333;
}
.video-thumb-column img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 100% 0% !important; /* 右上トリミング */
    transition: transform 0.3s;
}
.video-thumb-column a:hover img {
    transform: scale(1.05);
}

/* 右：情報 */
.video-info-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.video-info-column .ranking-card-title {
    font-size: 14px;
    margin-bottom: 4px;
    height: auto;
    max-height: 60px;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-info-column .ranking-card-actresses {
    margin-bottom: 0;
    font-size: 12px;
}

/* 中段：スコア */
.video-card-middle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 10px;
}
.video-card-middle-row .finder-score-card {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}
.video-card-middle-row .score-value {
    font-size: 20px;
}
.video-review {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* 下段：ボタン */
.video-card-bottom-row {
    margin-top: 0;
}

/* =========================================
   女優ランキング：作品数表示・レイアウト調整
   ========================================= */

/* 右側のカラム（バッジと作品数を縦並び） */
.score-right-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    line-height: 1;
}

/* 作品数表示テキスト */
.score-work-count {
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
    font-family: "Helvetica Neue", Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 🎥アイコンの調整 */
.score-work-count .icon-movie {
    font-size: 12px;
}

/* GODバッジがある場合のマージン調整 */
.score-right-col .rank-badge {
    margin-bottom: 2px;
}