﻿/**
 * 相性分析システム - 専用スタイル
 * 
 * 【適用範囲】
 * - 軸英傑ベース相性分析結果
 * - 段階的候補表示
 * - 相性スコア表示
 */

/* === 放浪娘カラースキーム === */
:root {
  --color-bg: #FFFFFF;
  --color-bg-card: #F9FAFB;
  --color-border: #E5E7EB;
  --color-text-main: #333B4F;
  --color-text-sub: #374151;
  --color-accent-red: #E74C3C;
  --color-accent-blue: #3498DB;
  --color-accent-green: #2ECC71;
  --color-accent-purple: #9B59B6;
  --color-accent-orange: #F39C12;
  --color-gray: #6B7280;
  --color-gray-light: #F3F4F6;
  --color-table-stripe: #F5F5F5;
}

/* === 相性分析全体 === */
.compatibility-analysis {
    font-size: 14px;
    color: var(--color-text-main);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
}

.analysis-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-accent-blue);
    margin-bottom: 12px;
}

/* === 相性グループ（段階的表示） === */
.candidate-group {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    background: var(--color-bg);
}

.group-header {
    padding: 8px 12px;
    background: var(--color-bg-card);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    border: none;
    width: 100%;
    text-align: left;
    outline: none;
    color: var(--color-text-main);
}

.group-header:hover {
    background: #e5e7eb;
}

.group-header:focus {
    background: #e5e7eb;
    box-shadow: 0 0 0 2px #3b82f6;
}

.group-title {
    font-weight: 500;
    color: var(--color-accent-purple);
}

.group-description {
    font-size: 12px;
    color: var(--color-text-sub);
}

.group-content {
    padding: 12px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

/* === 候補アイテム === */
.candidate-item {
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.candidate-item:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.candidate-item:focus {
    outline: none;
    border-color: #3b82f6;
    background: #f0f9ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* === 相性レベル別スタイル === */
.candidate-item.perfect {
    border-left: 3px solid #10b981;
    background: #f0fdf4;
}

.candidate-item.perfect:hover {
    background: #dcfce7;
}

.candidate-item.strong {
    border-left: 3px solid #3b82f6;
    background: #f0f9ff;
}

.candidate-item.strong:hover {
    background: #dbeafe;
}

.candidate-item.moderate {
    border-left: 3px solid #f59e0b;
    background: #fffbeb;
}

.candidate-item.moderate:hover {
    background: #fef3c7;
}

.candidate-item.weak {
    border-left: 3px solid #6b7280;
    background: #f9fafb;
}

.candidate-item.weak:hover {
    background: #f3f4f6;
}

/* === 候補詳細 === */
.candidate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.candidate-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

.candidate-job {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.compatibility-score {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    background: #dbeafe;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 32px;
    text-align: center;
}

.candidate-details {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* === 共通因縁表示 === */
.shared-inen {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    cursor: help;
    transition: background 0.2s;
}

.shared-inen:hover {
    background: #fde68a;
}

/* === 相性表示のバリエーション === */
.compatibility-score.perfect {
    background: #d1fae5;
    color: #065f46;
}

.compatibility-score.strong {
    background: #dbeafe;
    color: #1e40af;
}

.compatibility-score.moderate {
    background: #fef3c7;
    color: #92400e;
}

.compatibility-score.weak {
    background: #f3f4f6;
    color: #6b7280;
}

/* === 空状態 === */
.no-compatibility-results {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 6px;
}

/* === 相性ヒント（トースト用） === */
.compatibility-hint {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 4px 0;
}

/* === 折りたたみ詳細 === */
.candidate-group[open] .group-header {
    background: #e5e7eb;
}

.candidate-group summary::marker {
    content: '';
}

.candidate-group summary::-webkit-details-marker {
    display: none;
}

.group-header::after {
    content: '▼';
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s;
}

.candidate-group[open] .group-header::after {
    transform: rotate(180deg);
}

.candidate-group[open] {
    box-shadow: 0 2px 8px 0 rgba(51,59,79,0.08);
}

/* === レスポンシブ対応 === */
@media (max-width: 768px) {
    .candidate-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .compatibility-score {
        align-self: flex-end;
    }
    
    .candidate-details {
        width: 100%;
        justify-content: flex-start;
    }
    
    .collection-summary {
        flex-direction: column;
        gap: 8px;
    }
}

/* === アクセシビリティ対応 === */
@media (prefers-reduced-motion: reduce) {
    .candidate-item,
    .group-header::after {
        transition: none;
    }
}

/* === 高コントラスト対応 === */
@media (prefers-contrast: high), (forced-colors: active) {
    .candidate-item.perfect {
        border-left-width: 4px;
    }
    
    .candidate-item.strong {
        border-left-width: 4px;
    }
    
    .candidate-item.moderate {
        border-left-width: 4px;
    }
    
    .candidate-item.weak {
        border-left-width: 4px;
    }
    
    .compatibility-analysis {
        border-width: 2px;
    }
}

/* === 印刷対応 === */
@media print {
    .compatibility-analysis {
        border: 1px solid #000;
        background: white;
        break-inside: avoid;
    }
    
    .candidate-item {
        border: 1px solid #000;
        background: white;
    }
    
    .candidate-item.perfect {
        border-left: 3px solid #000;
    }
}