/**
 * FANZA Article Generator - Frontend CSS
 * v1.1.53 - Related Articles Added (PV > Tag Random > Global Random)
 */

:root {
    --fanza-primary: #3b82f6;
    --fanza-success: #10b981;
    --fanza-warning: #f59e0b;
    --fanza-error: #ef4444;
    --fanza-text: #f1f5f9;
    --fanza-text-dark: #1f2937;
    --fanza-bg: #f9fafb;
    --fanza-border: #e5e7eb;
    --fanza-cta: #dc2626;
}

/* ===== ラッパー ===== */
.fanza-article-wrapper {
    padding: 0 20px;
    font-family: 'Open Sans', sans-serif;
    color: var(--fanza-text);
    line-height: 1.6;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* ===== セクション共通 ===== */
.fanza-section {
    margin: 0 0 40px 0;
    padding: 20px;
    background: transparent;
    border: 2px solid var(--fanza-border);
    border-radius: 4px;
    color: var(--fanza-text);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== 1. タイトルセクション ===== */
.fanza-title-section {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 30px !important;
    border-radius: 0 !important;
    align-items: flex-start !important;
}

.fanza-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: #f8fafc !important;
    text-align: left !important;
    text-shadow: none !important;
    width: 100%;
}

/* ===== 2. 動画セクション ===== */
.fanza-video-section {
    padding: 0;
    background: transparent;
    border: none;
    align-items: center;
}

.fanza-video-container {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 2px solid var(--fanza-border);
    border-radius: 4px;
    margin: 0 auto;
}

.fanza-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 3. スコアセクション ===== */
.fanza-score-section {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4d 50%, #0a0e27 100%);
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 60px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 50px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 10px, #eee, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.3), inset 0 0 100px rgba(14, 165, 233, 0.1);
    position: relative;
    padding: 30px 20px !important;
    color: var(--fanza-text);
    align-items: stretch;
}

/* 共通見出しスタイル（幅を800pxに制限、上部マージン削除） */
.fanza-section-title {
    display: block;
    text-align: center;
    font-size: 18px;
    margin: 0 auto 20px auto !important;
    padding: 15px 0;
    color: #f1f5f9;
    text-shadow: none;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    background: linear-gradient(135deg, #0a4d6d 0%, #0d6b8f 50%, #0a4d6d 100%) !important;
    border-radius: 4px !important;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    line-height: 1.2;
}

.fanza-section-title::before,
.fanza-section-title::after {
    display: none;
}

/* コチラもおすすめセクション */
.fanza-score-container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* 左側：総合スコア */
.fanza-score-total {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 200px;
}

.fanza-score-number {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
    justify-content: flex-end;
}

.fanza-score-value {
    font-family: 'Playfair Display', serif;
    font-size: 120px;
    font-weight: 700;
    color: #fbbf24;
    line-height: 1;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    margin-right: -8px;
}

.fanza-score-max {
    font-size: 32px;
    color: #f1f5f9;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

/* 右側：5段階ゲージ */
.fanza-score-gauges {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.fanza-gauge-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ゲージラベル */
.fanza-gauge-label {
    flex: 0 0 180px;
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    text-align: right;
    min-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fanza-gauge-bar {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.fanza-gauge-block {
    flex: 1;
    height: 24px;
    border-radius: 3px;
    border: 2px solid #0ea5e9;
    position: relative;
    min-width: 0;
}

.fanza-gauge-block-filled {
    background: linear-gradient(90deg, #fbbf24 0%, #f97316 50%, #ef4444 100%);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.fanza-gauge-block-empty {
    background: rgba(15, 23, 42, 0.5);
    border-color: #475569;
}

/* レビュー欄（下部） */
.fanza-reviews-block {
    border-top: 2px solid #0ea5e9;
    padding-top: 20px;
    margin-top: 20px;
    line-height: 1.8;
    white-space: normal;
    word-wrap: break-word;
    color: #f1f5f9;
    font-size: 16px;
    width: 100%;
}

/* ===== CTA ボタン ===== */
.fanza-cta-section {
    margin-bottom: 40px;
    padding: 20px 0;
    background: transparent;
    border: none;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.fanza-cta-button {
    display: block;
    padding: 16px 40px;
    background: var(--fanza-cta);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid var(--fanza-cta);
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    text-align: center;
}

.fanza-cta-button:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-2px);
}

.fanza-cta-primary {
    background: var(--fanza-cta);
    color: #fff;
}

.fanza-cta-secondary {
    background: var(--fanza-cta);
    color: #fff;
}

/* ===== アイキャッチ画像 ===== */
.fanza-featured-image-wrapper {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.fanza-featured-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    border: 2px solid var(--fanza-border);
    border-radius: 4px;
    margin: 0 auto;
}

/* ===== 作品情報ラッパー ===== */
.fanza-info-wrapper-section {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4d 50%, #0a0e27 100%);
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
    color: #f1f5f9;
    align-items: center;
    padding-top: 20px !important;
}

/* ===== 作品基本情報 ===== */
.fanza-synopsis-section {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4d 50%, #0a0e27 100%);
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
    color: #f1f5f9;
    align-items: center;
    padding-top: 20px !important;
}

.fanza-info-table {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 auto;
}

.fanza-info-table tr {
    border-bottom: 1px solid var(--fanza-border);
}

.fanza-info-table tr:last-child {
    border-bottom: none;
}

.fanza-info-table th {
    text-align: left;
    padding: 12px;
    background: rgba(15, 23, 42, 0.8);
    font-weight: 700;
    font-size: 14px;
    width: 150px;
    border-right: 2px solid #0ea5e9;
    color: #f1f5f9;
    box-sizing: border-box;
}

.fanza-info-table td {
    padding: 12px;
    font-size: 14px;
    color: var(--fanza-text-dark);
    background: #fff;
    box-sizing: border-box;
    word-break: break-all;
}

/* ===== ユーザーレビュー ===== */
.fanza-user-review-section {
    background: #f0f9ff;
    border-color: var(--fanza-primary);
    color: var(--fanza-text-dark);
}

.fanza-user-review-content {
    white-space: pre-wrap;
    line-height: 1.8;
    width: 100%;
}

/* ===== Highlights ===== */
.fanza-highlights-section {
    background: #fafafa;
    color: var(--fanza-text-dark);
}

.fanza-highlights-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.fanza-highlight-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 2px solid var(--fanza-border);
    border-radius: 4px;
    color: var(--fanza-text-dark);
}

.fanza-highlight-number {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fanza-primary);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    border-radius: 50%;
}

.fanza-highlight-text {
    flex: 1;
    line-height: 1.6;
    font-size: 14px;
}

/* ===== Synopsis ===== */
.fanza-synopsis-content {
    line-height: 1.8;
    white-space: normal;
    padding: 20px;
    background: rgba(15, 23, 42, 0.5);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    color: #f1f5f9;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    margin: 0 auto;
}

/* ===== 出演女優 ===== */
.fanza-actresses-section {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4d 50%, #0a0e27 100%);
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
    color: #f1f5f9;
    align-items: center;
    padding-top: 20px !important;
}

.fanza-actresses-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.fanza-actress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 0 0 auto;
}

.fanza-actress-image-wrapper {
    width: 150px;
    height: 150px;
    margin-bottom: 12px;
    border: 2px solid #0ea5e9;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.fanza-actress-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fanza-actress-image-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.fanza-actress-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #475569;
}

.fanza-actress-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    text-decoration: none;
    transition: color 0.3s ease;
}

.fanza-actress-name:hover {
    color: #fff;
    text-decoration: underline;
}

/* ===== 関連記事（新設） ===== */
.fanza-related-section {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4d 50%, #0a0e27 100%);
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
    color: #f1f5f9;
    align-items: center;
    padding-top: 20px !important;
}

.fanza-related-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.fanza-related-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== レスポンシブ調整（モバイル） ===== */
@media (max-width: 768px) {
    .fanza-article-wrapper {
        padding: 0 !important;
        color: #f1f5f9 !important;
    }

    .fanza-section {
        margin-bottom: 20px !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        color: #f1f5f9 !important;
        align-items: center !important;
    }

    /* タイトルセクション */
    .fanza-title-section {
        background: transparent !important;
        background-image: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 10px 0 !important;
        margin-bottom: 20px !important;
        align-items: flex-start !important;
    }

    .fanza-title {
        font-size: 20px !important;
        line-height: 1.4 !important;
        text-align: left !important;
        color: #f8fafc !important;
        text-shadow: none !important;
        word-break: break-all !important;
    }

    /* 動画セクション (修正: 100vwを削除し、親要素に合わせる) */
    .fanza-video-container {
        border: none !important;
        border-radius: 0 !important;
        width: 100% !important; /* 100vw -> 100% */
        margin: 0 auto !important; /* 中央寄せ */
    }

    /* スコアセクション */
    .fanza-score-section {
        background: transparent !important;
        background-image: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        color: #f1f5f9 !important;
    }

    .fanza-section-title {
        background: linear-gradient(135deg, #0a4d6d 0%, #0d6b8f 50%, #0a4d6d 100%) !important;
        color: #f1f5f9 !important;
        text-align: center !important;
        padding: 10px 0 !important;
        margin-bottom: 10px !important;
        font-size: 18px !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 4px !important;
    }

    .fanza-score-container {
        flex-direction: column !important;
        gap: 20px !important;
    }

    .fanza-score-total {
        justify-content: flex-start !important;
        min-width: auto !important;
    }

    .fanza-score-value {
        font-size: 60px !important;
        color: var(--fanza-warning) !important;
        text-shadow: none !important;
    }
    
    .fanza-score-max {
        color: #f1f5f9 !important;
    }

    .fanza-gauge-label {
        color: #f1f5f9 !important;
        text-align: left !important;
        flex: 0 0 100px !important;
        font-size: 12px !important;
    }
    
    .fanza-gauge-block-empty {
        background: #e2e8f0 !important;
        border-color: #cbd5e1 !important;
    }

    /* レビュー欄 */
    .fanza-reviews-block {
        border-top: 1px solid var(--fanza-border) !important;
        color: #f1f5f9 !important;
        padding-top: 15px !important;
        margin-top: 15px !important;
    }

    /* 作品情報セクション */
    .fanza-info-wrapper-section {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #f1f5f9 !important;
    }

    /* サムネイル画像 (修正: 100vwを削除し、親要素に合わせる) */
    .fanza-featured-image {
        border: none !important;
        border-radius: 0 !important;
        width: 100% !important; /* 100vw -> 100% */
        margin: 0 auto !important; /* 中央寄せ */
    }

    /* テーブル (修正: 100vwを削除し、親要素に合わせる) */
    .fanza-info-table {
        width: 100% !important; /* 100vw -> 100% */
        margin: 0 auto !important; /* 中央寄せ */
    }

    .fanza-info-table th {
        background: #f1f5f9 !important;
        color: var(--fanza-text-dark) !important;
        border-right: 1px solid var(--fanza-border) !important;
        width: 100px !important;
    }

    .fanza-info-table td {
        background: #fff !important;
        color: var(--fanza-text-dark) !important;
    }

    /* あらすじセクション */
    .fanza-synopsis-section {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #f1f5f9 !important;
    }

    .fanza-synopsis-content {
        background: transparent !important;
        color: #f1f5f9 !important;
        padding: 0 !important;
    }

    /* 出演女優セクション */
    .fanza-actresses-section {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #f1f5f9 !important;
    }

    .fanza-actresses-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .fanza-actress-image-wrapper {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        border: 1px solid var(--fanza-border) !important;
        box-shadow: none !important;
    }
    
    .fanza-actress-name {
        color: #f1f5f9 !important;
        font-size: 12px !important;
    }

    /* 関連記事セクション（新設） */
    .fanza-related-section {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #f1f5f9 !important;
    }

    .fanza-related-container {
        gap: 30px !important;
    }

    /* CTAボタン */
    .fanza-cta-button {
        padding: 14px 20px !important;
        font-size: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .fanza-actresses-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===== サイドバー用スタイル ===== */
.fanza-sidebar-wrapper {
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    color: var(--fanza-text);
}

.fanza-sidebar-section {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4d 50%, #0a0e27 100%);
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 60px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 50px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 10px, #eee, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3), inset 0 0 50px rgba(14, 165, 233, 0.1);
    border-radius: 4px;
    color: #f1f5f9;
}

.fanza-sidebar-title-section {
    padding: 20px;
}

.fanza-sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #e0f2fe;
    text-align: center;
    text-shadow: 0 0 15px rgba(14, 165, 233, 0.6), 0 0 30px rgba(14, 165, 233, 0.3);
}

@media (max-width: 768px) {
    .fanza-sidebar-title {
        font-size: 16px;
    }
}
