﻿/**
 * player_filter - ローカルスタイル
 * version: 20251222 - Using shared design-tokens.css
 * 
 * 共通デザイントークンは /css/shared/design-tokens.css から読み込み済み
 */

body { font-family: "Inter", sans-serif; background-color: var(--c-bg); color: var(--c-text); }

/* Utilities */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }

/* Header */
.language-select-header {
    padding: 0.25rem 0.5rem; border: 1px solid #d1d5db; border-radius: 0.375rem;
    font-size: 0.75rem; color: #4b5563; background-color: #f9fafb; min-width: 100px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.message-box {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    color: #fff; padding: 1rem 1.5rem; border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgb(0 0 0 / 0.1); z-index: 1000;
    display: none; opacity: 0; transition: opacity 0.3s; text-align: center;
}
.message-box.show { display: block; opacity: 1; }
.message-box.success { background-color: var(--c-success); }
.message-box.error { background-color: var(--c-error); }
.message-box.info { background-color: var(--c-info); }

/* Filters */
.filter-dropdown, #globalKeywordSearchInput, #occupationFilter, #specializationFilter, #teamFilter { font-size: 16px !important; }
@media (min-width: 768px) { .filter-dropdown, #globalKeywordSearchInput, #occupationFilter, #specializationFilter, #teamFilter { font-size: 0.875rem !important; } }
.advanced-filter-row .remove-filter-btn { background: transparent; border: none; color: var(--c-error); font-size: 1.5rem; cursor: pointer; padding: 0 0.5rem; }

/* Table - components.cssで共通定義済み */
/* 以下はローカル上書き */
.table-container { max-height: 70vh; overflow: auto; border-radius: var(--radius-lg); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); }
.table-container table { width: 100%; min-width: max-content; border-collapse: collapse; }
#resultsTable th, #resultsTable td { padding: 0.5rem 0.75rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--c-border); white-space: nowrap; font-size: 0.875rem; line-height: 1.25rem; }
#resultsTable th { font-weight: 600; color: var(--c-text-sub); position: sticky; top: 0; z-index: 10; background-color: var(--c-bg-header); cursor: pointer; user-select: none; }
#resultsTable th:hover { background-color: #f3f4f6; }
#resultsTable td { color: var(--c-text); }
#resultsTable td.total-value-cell { font-weight: 600; color: var(--c-primary); }
#resultsTable th:nth-child(1), #resultsTable td:nth-child(1) { position: sticky; left: 0; z-index: 11; background-color: inherit; min-width: 40px; }
#resultsTable tbody tr:nth-child(odd) { background-color: #fff; }
#resultsTable tbody tr:nth-child(even) { background-color: var(--c-bg-alt); }
#resultsTable td.clickable-name, #resultsTable td.clickable-team { cursor: pointer; color: var(--c-primary); font-weight: 500; }
#resultsTable td.clickable-name:hover, #resultsTable td.clickable-team:hover { text-decoration: underline; }

/* Analysis Cards */
.top5-card, .occupation-skill-card, .analysis-card { background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.75rem; }
.analysis-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; gap: 0.5rem; }
@media (min-width: 768px) { .analysis-header { justify-content: flex-start; gap: 1.5rem; } }
.top5-card-title, .analysis-card-title, .occupation-title { font-weight: 600; color: var(--c-primary); margin-bottom: 0.5rem; }
.occupation-title { font-size: 1.125rem; color: #1e3a8a; margin-bottom: 1rem; }

/* Top 5 Layout Fix (Corrected) */
.top5-list { list-style: none; padding: 0; font-size: 0.8rem; space-y: 0.25rem; }
.top5-list-item { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.top5-info-container { 
    display: flex; align-items: baseline; flex: 1; min-width: 0; margin-right: 0.5rem;
    overflow: hidden; 
}
.top5-player-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--c-text); }
.top5-player-name:hover { text-decoration: underline; }
.top5-spec-name { font-size: 0.7rem; color: var(--c-text-sub); margin-left: 0.5rem; white-space: nowrap; }
.top5-team-name { font-size: 0.7rem; color: #9ca3af; margin-left: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top5-player-value { font-weight: 500; color: #4b5563; flex-shrink: 0; }
.show-more-btn { font-size: 0.75rem; color: #4f46e5; background: none; border: none; cursor: pointer; margin-top: 0.5rem; }

/* Team Ranking */
.team-ranking-list { background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 1rem; }
.team-ranking-item { display: grid; grid-template-columns: 2rem 1fr auto; gap: 1rem; align-items: center; padding: 0.25rem 0; font-size: 0.85rem; border-bottom: 1px solid #e2e8f0; }
.team-ranking-item:last-child { border-bottom: none; }
.team-rank { font-weight: 600; text-align: center; color: #64748b; }
.team-name { font-weight: 500; display: flex; align-items: center; }
.team-avg-value { font-weight: 600; color: var(--c-primary); }

/* Accordions */
.team-composition-accordion, .stat-growth-accordion { border-bottom: 1px solid var(--c-border); }
.team-composition-accordion:last-child, .stat-growth-accordion:last-child { border-bottom: none; }
.team-composition-accordion summary, .stat-growth-accordion summary { 
    cursor: pointer; padding: 0.75rem 0.5rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; 
}
.team-composition-accordion summary:hover, .stat-growth-accordion summary:hover { background-color: var(--c-bg-hover); }
.team-composition-accordion summary::after, .stat-growth-accordion summary::after { content: "▼"; font-size: 0.8em; color: var(--c-text-sub); transition: transform 0.2s; }
.team-composition-accordion[open] > summary::after, .stat-growth-accordion[open] > summary::after { transform: rotate(180deg); }

.team-composition-accordion .team-member-list-container { padding: 0 0.5rem 0.75rem 0.5rem; }
@media (max-width: 767px) { .team-composition-accordion .team-member-list-container { column-count: 1; } }
@media (min-width: 768px) and (max-width: 1023px) { .team-composition-accordion .team-member-list-container { column-count: 2; } }

.team-role-group { margin-top: 0.75rem; page-break-inside: avoid; break-inside: avoid; }
.team-role-title { font-size: 0.8rem; font-weight: 600; color: #4b5563; padding-bottom: 0.25rem; border-bottom: 2px solid var(--c-border); margin-bottom: 0.5rem; }
.team-role-list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.team-member-item { display: block; padding: 0.25rem 0.5rem; border-radius: 0.25rem; cursor: pointer; font-size: 0.8rem; }
.team-member-item:hover { background-color: var(--c-bg-hover); }
.team-member-spec { font-size: 0.75rem; color: var(--c-text-sub); margin-left: 0.25rem; }

/* Skill Usage */
.specialization-accordion summary { cursor: pointer; font-weight: 600; color: #059669; padding: 0.5rem; border-radius: 0.25rem; transition: background 0.2s; list-style: none; }
.specialization-accordion summary:hover { background-color: #f0fdf4; }
.specialization-accordion[open] > summary { background-color: #ecfdf5; }
.specialization-accordion summary::before { content: "▶"; margin-right: 0.5rem; display: inline-block; transition: transform 0.2s; }
.specialization-accordion[open] > summary::before { transform: rotate(90deg); }
.skill-usage-list { list-style: none; padding: 0.75rem 0.5rem 0.25rem; space-y: 0.5rem; }
.skill-usage-item { display: flex; flex-direction: column; }
.skill-usage-item > div:first-child { display: flex; justify-content: space-between; margin-bottom: 0.125rem; font-size: 0.75rem; }
.skill-usage-bar-bg { background-color: #e5e7eb; border-radius: 0.25rem; height: 6px; width: 100%; overflow: hidden; }
.skill-usage-bar { background-color: #10b981; height: 100%; border-radius: 0.25rem; }

/* Stat Growth */
.stat-growth-accordion .stat-growth-list { padding: 0.5rem 1rem 1rem; column-count: 2; column-gap: 2rem; }
@media (max-width: 767px) { .stat-growth-accordion .stat-growth-list { column-count: 1; } }
.stat-growth-item { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.2rem 0; border-bottom: 1px solid #f3f4f6; }
.stat-growth-value.positive { color: #16a34a; }
.stat-growth-value.negative { color: var(--c-error); }

/* Histogram */
.histogram-bar-container { display: flex; align-items: flex-end; gap: 2px; height: 100px; margin-top: 0.5rem; }
.histogram-bar { background-color: #3b82f6; flex-grow: 1; }
.histogram-label { font-size: 0.7rem; text-align: center; color: var(--c-text-sub); line-height: 1.3; flex-grow: 1; flex-basis: 0; }

/* Modal */
#modal-container.flex { display: flex; }
#modal-container.hidden { display: none; }
#modal-content { padding: 1rem !important; }
#modal-title .modal-name-link { color: #3b82f6; text-decoration: underline; text-underline-offset: 2px; }
.modal-player-details .player-card { padding-bottom: 0.75rem; margin-bottom: 0.75rem; }
.modal-player-details .stats-grid { display: grid; grid-template-columns: 1fr; gap: 0.125rem 1rem; }
@media (min-width: 768px) { .modal-player-details .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.125rem 2.5rem; } }
.stat-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; align-items: baseline; }
.stat-value-container { display: flex; align-items: baseline; justify-content: flex-end; gap: 0.5rem; font-weight: 600; }
.stat-item-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--c-border); }
.total-value-main { font-size: 1.25rem; font-weight: 700; color: var(--c-primary); }

/* Evaluation */
.evaluation-details summary { cursor: pointer; font-weight: 600; padding: 0.5rem; border-radius: 0.375rem; margin-top: 1.5rem; border-top: 1px solid var(--c-border); padding-top: 1.5rem; list-style: none; transition: background 0.2s; }
.evaluation-details summary:hover { background-color: #f3f4f6; }
.evaluation-details summary::before { content: "▶"; margin-right: 0.5rem; display: inline-block; transition: transform 0.2s; }
.evaluation-details[open] > summary::before { transform: rotate(90deg); }
.evaluation-grid { padding: 0.75rem 0.5rem; font-size: 0.85rem; }
.evaluation-pc { display: none; }
.evaluation-sp { display: block; }
@media (min-width: 641px) { .evaluation-pc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 2rem; } .evaluation-sp { display: none; } }
.evaluation-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f3f4f6; padding: 0.25rem 0; }
.evaluation-separator { height: 0.75rem; }
.evaluation-item-total-highlight { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 2px solid #60a5fa; }
.evaluation-explanation { font-size: 0.75rem; color: #4b5563; background-color: #f9fafb; padding: 0.75rem; border-radius: 0.375rem; margin: 0.75rem 0.5rem 0.25rem; }
.stat-rank { font-size: 0.8em; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 0.25rem; color: #fff; }
.rank-sss { background-color: #f59e0b; } .rank-ss { background-color: #a855f7; } .rank-s { background-color: var(--c-error); } .rank-a { background-color: #3b82f6; } .rank-b { background-color: var(--c-success); } .rank-c { background-color: var(--c-text-sub); }

.chart-wrapper { position: relative; max-width: 450px; max-height: 450px; margin: auto; }
.modal-analysis-container { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--c-border); }
.modal-analysis-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }

/* New: Video Search Button */
.video-search-btn {
    margin-left: 0.5rem; color: #9ca3af; background: none; border: none; cursor: pointer; padding: 0.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.video-search-btn:hover { color: #1d4ed8; background-color: #eef2ff; }

/* Misc */
.custom-btn { color: #fff; font-weight: 600; padding: 0.5rem 1rem; border-radius: 0.5rem; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1); transition: all 0.15s; }
.search-reset-button { background-color: var(--c-error); border-color: var(--c-error); }
.search-reset-button:hover { background-color: #dc2626; }
.player-type-list, .ideal-comp-list { list-style: none; padding: 0; }
.ideal-comp-list { column-count: 3; column-gap: 1.5rem; }
@media (max-width: 767px) { .ideal-comp-list { column-count: 1; } }
.player-type-item, .ideal-comp-item { display: flex; justify-content: space-between; font-size: 0.85rem; page-break-inside: avoid; }
.player-type-value, .ideal-comp-value { font-weight: 600; color: #1e3a8a; }