/**
 * FANZA Face Search - スタイル
 * search_ui.py v3 のデザインを忠実に再現
 */

/* =============================================================================
   Cocoonテーマ干渉防止（ピンポイント対策）
   ============================================================================= */

/* Cocoonの見出し装飾（ボーダー、背景、padding等）を無効化 */
#fanza-face-search-app h2,
#fanza-face-search-app h3 {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

#fanza-face-search-app h2::before,
#fanza-face-search-app h2::after,
#fanza-face-search-app h3::before,
#fanza-face-search-app h3::after {
    content: none !important;
    display: none !important;
}

/* Cocoonのリスト装飾を無効化 */
#fanza-face-search-app ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#fanza-face-search-app li {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

#fanza-face-search-app .ffs-tips-box li::before {
    content: "✓ " !important;
    display: inline !important;
    color: #ff6b9d;
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    border: none !important;
}

/* Cocoonの段落margin無効化 */
#fanza-face-search-app p {
    margin: 0 !important;
}

/* Cocoonのaタグ装飾を無効化（色はプラグイン側で再定義） */
#fanza-face-search-app a {
    text-decoration: none !important;
}

/* Cocoonのimgスタイル（余白・影）を無効化 */
#fanza-face-search-app img {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* =============================================================================
   基本スタイル
   ============================================================================= */

#fanza-face-search-app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
}

#fanza-face-search-app * {
    box-sizing: border-box;
}

/* =============================================================================
   アップロードセクション
   ============================================================================= */

.ffs-upload-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.ffs-upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.ffs-upload-area:hover {
    border-color: #ff6b9d;
    background: rgba(255,107,157,0.03);
}

.ffs-upload-area.dragover {
    border-color: #ff6b9d;
    background: rgba(255,107,157,0.08);
}

.ffs-upload-area.has-image {
	border: 3px dashed #ddd;    
	border-color: #ff6b9d;
    background: rgba(255,107,157,0.03);    
    padding: 20px;
    cursor: default;
}

.ffs-upload-area input {
    display: none;
}

.ffs-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ffs-upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.ffs-upload-hint {
    font-size: 14px;
    color: #999;
}

/* =============================================================================
   検索のコツ
   ============================================================================= */

.ffs-tips-box {
    background: linear-gradient(135deg, #fff9f0, #fff5f7);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.ffs-tips-box h3 {
    font-size: 15px;
    color: #ff6b9d;
    margin-bottom: 10px;
}

.ffs-tips-box ul {
    list-style: none;
    font-size: 15px;
    color: #777;
    padding: 0;
    margin: 0;
}

.ffs-tips-box li {
    padding: 4px 0;
}

.ffs-tips-box li::before {
    content: "✓ " !important;
    display: inline !important;
    color: #ff6b9d;
}

.ffs-privacy-note {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-top: 15px;
}

.ffs-privacy-note::before {
    content: "🔒 " !important;
    display: inline !important;
}

/* =============================================================================
   Step2 タイトル・説明
   ============================================================================= */

.ffs-step-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
}

.ffs-step-hint {
    font-size: 15px;
    color: #666;
    text-align: center;
    margin: 15px 0;
    padding: 12px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* =============================================================================
   プレビュー
   ============================================================================= */

.ffs-preview-container {
    display: none;
    text-align: center;	
}

.ffs-preview-container.active {
    display: block;
}

.ffs-preview-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
	margin-top: 12px;
}

.ffs-preview-wrapper img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.ffs-preview-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* =============================================================================
   補助線
   ============================================================================= */

.ffs-guide-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

.ffs-guide-lines.active {
    display: block;
}

.ffs-guide-lines::before,
.ffs-guide-lines::after {
    content: '' !important;
    display: block !important;
    position: absolute;
    left: 0;
    right: 0;
    height: 2.5px;
    background: rgba(0, 160, 0, 0.45) !important;
    border-top: 1px dashed rgba(0, 162, 0, 0.4) !important;
}

.ffs-guide-lines::before { top: 33%; }
.ffs-guide-lines::after { top: 66%; }

/* =============================================================================
   コントロール
   ============================================================================= */

.ffs-controls {
    display: none;
    margin-top: 25px;
}

.ffs-controls.active {
    display: block;
}

/* =============================================================================
   角度調整バー
   ============================================================================= */

.ffs-rotation-bar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.ffs-rotation-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.ffs-rotation-bar-label .icon {
    font-size: 18px;
}

.ffs-rotation-bar input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.ffs-rotation-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff6b9d;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,107,157,0.4);
}

.ffs-rotation-bar input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff6b9d;
    cursor: pointer;
    border: none;
}

/* =============================================================================
   ボタン
   ============================================================================= */

.ffs-button-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
	margin-top: 15px;
}

.ffs-button-row-main {
    text-align: center;
    margin: 20px 0 15px;
}

.ffs-button-row-sub {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.ffs-button-row-sub .ffs-btn {
    padding: 14px 28px;
    font-size: 15px;
}

.ffs-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.ffs-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.ffs-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ffs-btn-primary {
    background: linear-gradient(135deg, #ff6b9d, #ff8a65);
    color: white;
    box-shadow: 0 4px 15px rgba(255,107,157,0.3);
}

.ffs-btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255,107,157,0.4);
}

.ffs-btn-secondary {
    background: white;
    color: #666;
    border: 2px solid #ddd;
}

.ffs-btn-secondary:hover:not(:disabled) {
    border-color: #ff6b9d;
    color: #ff6b9d;
}

/* =============================================================================
   顔サムネイル行（マルチアングル検出結果）
   
   ★ 追加位置: style.css の「ステータスメッセージ」セクション（L420付近）の直前、
     つまり「ボタン」セクション（L350〜L418）の直後に挿入する。
   
   デザイン方針:
     - 既存の ffs-step-hint と同じ背景パターン（淡青+左ボーダー）を踏襲
     - サムネイルは既存の ffs-product-thumb-wrapper と同じ角丸・影パターン
     - 選択色は既存の顔bbox描画色 #27ae60 と統一
     - Cocoon干渉防止は #fanza-face-search-app スコープで自動適用済み
   ============================================================================= */
 
.ffs-face-thumbnails {
    margin-top: 20px;
    padding: 16px 20px;
    background: #f0f8ff;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}
 
.ffs-thumb-label {
    font-size: 14px !important;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px !important;
}
 
.ffs-thumb-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
 
.ffs-face-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #e0e0e0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #f5f5f5;
    flex-shrink: 0;
}
 
.ffs-face-thumb:hover {
    border-color: rgba(39, 174, 96, 0.5);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
 
.ffs-face-thumb.selected {
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.25), 0 4px 12px rgba(39, 174, 96, 0.15);
}
 
.ffs-face-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
 
.ffs-thumb-index {
    position: absolute;
    top: 3px;
    left: 3px;
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
 
.ffs-thumb-angle {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(52, 152, 219, 0.85);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.3;
}
 
.ffs-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    font-size: 11px;
    color: #888;
    text-align: center;
    line-height: 1.3;
}
 

/* =============================================================================
   ステータスメッセージ
   ============================================================================= */

.ffs-status-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 15px;
    display: none;
    font-size: 14px;
}

.ffs-status-message.active {
    display: block;
}

.ffs-status-message.success {
    background: #e8f8f0;
    color: #27ae60;
}

.ffs-status-message.warning {
    background: #fef5e7;
    color: #d68910;
}

/* =============================================================================
   ローディング
   ============================================================================= */

.ffs-loading {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.ffs-loading.active {
    display: block;
}

.ffs-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #ff6b9d;
    border-radius: 50%;
    animation: ffs-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes ffs-spin {
    to { transform: rotate(360deg); }
}

/* =============================================================================
   検索結果
   ============================================================================= */

.ffs-results {
    display: none;
    margin-top: 30px;
}

.ffs-results.active {
    display: block;
}

.ffs-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.ffs-results-header h2 {
    font-size: 16px;
    color: #333;
}

/* =============================================================================
   検索結果の顔プレビュー
   ============================================================================= */

.ffs-search-face-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);	
    margin-bottom: 25px;
}

.ffs-search-face-preview {
    flex-shrink: 0;
}

.ffs-search-face-preview canvas {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #ff6b9d;
}

.ffs-search-face-info {
    flex-grow: 1;
}

.ffs-search-face-info p {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.ffs-search-face-hint {
    font-size: 15px !important;
    font-weight: 400 !important;
    color: #888 !important;
}

.ffs-search-face-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.ffs-search-face-buttons .ffs-btn {
    margin-top: 0;
}

/* =============================================================================
   信頼度バナー
   ============================================================================= */

.ffs-confidence-banner {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.ffs-confidence-banner.high {
    background: linear-gradient(135deg, #e8f8f0, #d4efdf);
}

.ffs-confidence-banner.medium {
    background: linear-gradient(135deg, #e8f4fc, #d4e6f1);
}

.ffs-confidence-banner.medium-low {
    background: linear-gradient(135deg, #fef9e7, #fdebd0);
}

.ffs-confidence-banner.low {
    background: linear-gradient(135deg, #fdedec, #f9e2e1);
}

.ffs-confidence-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.ffs-confidence-content {
    flex: 1;
}

.ffs-confidence-title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.ffs-confidence-desc {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* =============================================================================
   女優カード
   ============================================================================= */

.ffs-actress-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.ffs-actress-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ffs-actress-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.ffs-actress-header {
    padding: 18px;
    background: linear-gradient(135deg, #ff6b9d, #ff8a65);
    color: white;
}

.ffs-actress-name {
    font-size: 18px;
    font-weight: 700;
}

.ffs-actress-ruby {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 3px;
}

/* =============================================================================
   作品サムネイル
   ============================================================================= */

.ffs-actress-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
}

.ffs-product-thumb {
    cursor: pointer;
    transition: transform 0.2s;
}

.ffs-product-thumb:hover {
    transform: scale(1.05);
}

.ffs-product-thumb-wrapper {
    position: relative;
    aspect-ratio: 147/200;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
}

.ffs-product-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ffs-product-thumb-wrapper .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #999;
}

.ffs-vr-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #3498db;
    color: white;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
}

.ffs-release-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
    color: white;
}

.ffs-release-badge.label-newest { background: #e74c3c; }
.ffs-release-badge.label-new { background: #ff6b9d; }
.ffs-release-badge.label-semi-new { background: #f39c12; }
.ffs-release-badge.label-upcoming { background: #9b59b6; }

.ffs-actress-footer {
    border-top: 1px solid #f0f0f0;
}

.ffs-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.ffs-footer-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.ffs-footer-list {
    color: #ff6b9d;
    border-bottom: 1px solid #f0f0f0;
}

.ffs-footer-list:hover {
    background: #fff5f7;
}

.ffs-footer-similar {
    color: #3498db;
}

.ffs-footer-similar:hover {
    background: #f0f7ff;
}

/* =============================================================================
   もっと見る
   ============================================================================= */

.ffs-load-more {
    text-align: center;
    margin-top: 30px;
}

/* =============================================================================
   モーダル
   ============================================================================= */

.ffs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ffs-modal.active {
    display: flex;
}

.ffs-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;          /* ← 追加 */
    overflow-y: auto;          /* ← 追加 */
    overflow-x: hidden;        /* ← 追加 */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ffs-modal-header {
    padding: 20px 24px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.ffs-modal-header h3 {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    margin: 0;
}

.ffs-modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.ffs-modal-close:hover {
    color: #333;
}

.ffs-modal-body {
    padding: 13px;
}

.ffs-modal-media {
    width: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
	position: relative; 
}

.ffs-modal-media iframe {
    width: 100%;
    height: 400px;
    border: none;
}

.ffs-modal-media img {
    width: 100%;
    max-height: min(510px, 54vh);
    object-fit: contain;
}

.ffs-modal-media .no-media {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

.ffs-modal-info {
    font-size: 14px;
    color: #666;
}

.ffs-modal-footer {
    padding: 20px 22px;
    background: #f8f9fa;
    text-align: center;
}

.ffs-modal-footer a {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b9d, #ff8a65);
    color: white;
    padding: 14px 40px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(255,107,157,0.3);
    transition: all 0.2s;
}

.ffs-modal-footer a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,157,0.4);
    color: white;
}

/* =============================================================================
   モーダル ナビゲーション
   ============================================================================= */

.ffs-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 50%;
    background: transparent;
    border: none;
    color: white;
	font-size: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
    border-radius: 4px;
    padding: 0;
}

.ffs-modal-nav:hover {
	background: rgba(0, 0, 0, 0.15);	
    color: white;
}

.ffs-modal-nav-prev {
    left: 6px;
}

.ffs-modal-nav-next {
    right: 6px;
}

/* =============================================================================
   レスポンシブ
   ============================================================================= */

@media (max-width: 768px) {
    #fanza-face-search-app {
        padding: 15px;
    }

    .ffs-upload-section {
        padding: 20px;
    }

    .ffs-upload-area {
        padding: 40px 15px;
    }

    .ffs-actress-grid {
        grid-template-columns: 1fr;
    }

    .ffs-actress-products {
        grid-template-columns: repeat(3, 1fr);
    }

    .ffs-search-face-section {
        flex-direction: column;
        text-align: center;
    }

    .ffs-search-face-buttons {
        flex-direction: column;
    }

    .ffs-button-row-sub {
        flex-direction: column;
        gap: 10px;
    }

    /* 類似検索ページ レスポンシブ */
    #fanza-similar-search-app {
        padding: 15px;
    }

    .ss-search-section {
        padding: 20px;
    }

    .ss-search-bar {
        flex-direction: column;
    }

    .ss-search-btn {
        width: 100%;
    }

    .ss-source-card {
        flex-direction: column;
        text-align: center;
    }

    .ss-source-products {
        justify-content: center;
    }

    .ss-similar-header {
        flex-direction: column;
        gap: 10px;
    }
    /* --- モーダル フルワイド化 --- */
    .ffs-modal,
    .ss-modal {
        padding: 0;
        align-items: flex-start;
    }
    .ffs-modal.active,
    .ss-modal.active {
        padding: 0;
        align-items: center;
    }
    .ffs-modal-content {
        border-radius: 0;
        max-width: 100%;
        min-height: auto;
        display: flex;
        flex-direction: column;
        box-shadow: none;  /* ← ここに追加 */
		width: 100vw;       /* ← 追加 */
    }
    .ffs-modal-header {
        padding: 15px;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .ffs-modal-body {
        padding: 0;
        flex: 1;
    }

    .ffs-modal-media {
        border-radius: 0;
        margin-bottom: 0;
    }

    .ffs-modal-media img {
        width: 100%;
        max-height: none;
        object-fit: contain;
    }

    .ffs-modal-info {
        padding: 12px 15px;
    }

    .ffs-modal-footer {
        padding: 15px;
        position: sticky;
        bottom: 0;
    }

    .ffs-modal-footer a {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }
        .ffs-face-thumb {
        width: 60px;
        height: 60px;
    }
    
    .ffs-thumb-row {
        gap: 8px;
    }
    
    .ffs-thumb-index {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .ffs-thumb-angle {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .ffs-face-thumbnails {
        padding: 14px 16px;
    }
}

/* =============================================================================
   類似女優検索ページ (#fanza-similar-search-app)
   ============================================================================= */

/* --- Cocoonテーマ干渉防止 --- */

#fanza-similar-search-app h2,
#fanza-similar-search-app h3 {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

#fanza-similar-search-app h2::before,
#fanza-similar-search-app h2::after,
#fanza-similar-search-app h3::before,
#fanza-similar-search-app h3::after {
    content: none !important;
    display: none !important;
}

#fanza-similar-search-app ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#fanza-similar-search-app li {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

#fanza-similar-search-app p {
    margin: 0 !important;
}

#fanza-similar-search-app a {
    text-decoration: none !important;
}

#fanza-similar-search-app img {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- 基本 --- */

#fanza-similar-search-app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    color: #333;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
}

#fanza-similar-search-app * {
    box-sizing: border-box;
}

/* --- 検索バー --- */

.ss-search-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.ss-search-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.ss-search-bar {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.ss-search-input-wrap {
    flex: 1;
    position: relative;
}

.ss-search-input-wrap input {
    width: 100%;
    padding: 14px 40px 14px 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.ss-search-input-wrap input:focus {
    border-color: #ff6b9d;
}

.ss-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    display: none;
}

.ss-clear-btn:hover {
    color: #333;
}

.ss-search-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #ff6b9d, #ff8a65);
    color: white;
    box-shadow: 0 4px 15px rgba(255,107,157,0.3);
    transition: all 0.2s;
    white-space: nowrap;
}

.ss-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,157,0.4);
}

.ss-search-hint {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-top: 12px;
}

/* --- ローディング --- */

.ss-loading {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.ss-loading.active {
    display: block;
}

/* --- 名前検索結果 --- */

.ss-name-results {
    display: none;
    margin-top: 30px;
}

.ss-name-results.active {
    display: block;
}

.ss-results-header {
    margin-bottom: 15px;
}

.ss-results-count {
    font-size: 14px;
    color: #888;
}

/* --- 類似女優セクション --- */

.ss-similar-section {
    display: none;
    margin-top: 30px;
}

.ss-similar-section.active {
    display: block;
}

.ss-source-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    text-align: center;
}

.ss-source-header {
    flex-shrink: 0;
}

.ss-source-name {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.ss-source-ruby {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.ss-source-products {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.ss-source-thumb {
    width: 120px;
    aspect-ratio: 147/200;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
    display: block;              /* ← 追加 */
    cursor: pointer;             /* ← 追加 */
    transition: transform 0.2s;  /* ← 追加 */
}

/* 新規追加 */
.ss-source-thumb:hover {
    transform: scale(1.05);
}

.ss-source-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ss-source-footer {
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;    
}

.ss-similar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ss-similar-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.ss-back-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ss-back-btn:hover {
    border-color: #ff6b9d;
    color: #ff6b9d;
}

/* --- モーダル（類似検索ページ用） --- */

.ss-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ss-modal.active {
    display: flex;
}
