/* カスタムスタイル */

/* 全体的な文字サイズを大きく */
body {
    font-size: 1.1rem;
}

/* 見出しを大きく */
h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1.1rem;
}

/* カードタイトルを適切なサイズに */
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* 統計カードの数字を適切なサイズに */
.stats-number {
    font-size: 2.2rem;
    font-weight: bold;
}

.stats-label {
    font-size: 1rem;
    font-weight: 500;
}

/* チャンネル統計の数字を大きく */
.channel-stats-number {
    font-size: 1.4rem;
    font-weight: bold;
}

.channel-stats-label {
    font-size: 1rem;
    font-weight: 500;
}

/* テーブルの文字を大きく */
.table {
    font-size: 1.1rem;
}

.table th {
    font-size: 1.2rem;
    font-weight: 600;
}

.table td {
    font-size: 1.1rem;
}

/* バッジの文字を大きく */
.badge {
    font-size: 1rem;
    padding: 0.5em 0.75em;
}

/* ナビゲーションバーの文字を大きく */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-size: 1.1rem;
}

/* ボタンの文字を大きく */
.btn {
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
}

/* フォームの文字を大きく */
.form-control {
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
}

.form-label {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ページネーションの文字を大きく */
.pagination .page-link {
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
}

/* アラートの文字を大きく */
.alert {
    font-size: 1.1rem;
}

/* リストの文字を大きく */
.list-group-item {
    font-size: 1.1rem;
}

/* 小さなテキストを大きく */
.small, small {
    font-size: 1rem;
}

/* テキストミュートを大きく */
.text-muted {
    font-size: 1rem;
}

/* テーブルの列幅調整 */
.table th:nth-child(4),
.table td:nth-child(4) {
    min-width: 120px;
    white-space: nowrap;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    min-width: 100px;
    white-space: nowrap;
}

.table th:nth-child(6),
.table td:nth-child(6) {
    min-width: 100px;
    white-space: nowrap;
}

/* 数字表示の調整 */
.number-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* ホバーカードのスタイル */
.hover-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 背景色は既に上で定義済み */

.navbar-brand {
    font-weight: bold;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.comment-text {
    max-width: 400px;
    word-wrap: break-word;
    line-height: 1.4;
}

.badge {
    font-size: 0.75em;
}

/* 統計カードのアニメーション */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    transition: transform 0.2s ease-in-out;
}

.card.bg-primary:hover:not(.disabled),
.card.bg-success:hover:not(.disabled),
.card.bg-info:hover:not(.disabled),
.card.bg-warning:hover:not(.disabled) {
    transform: translateY(-2px);
}

/* 検索フォーム */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* フッター */
footer {
    margin-top: auto;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .comment-text {
        max-width: 200px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* ローディングアニメーション */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ツールチップ風のスタイル */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* カスタムボタンスタイル */
.btn-custom {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-custom:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* 無効化されたボタンのホバー効果を無効化 */
.btn:disabled,
.btn.disabled,
.page-item.disabled .page-link {
    transform: none !important;
    box-shadow: none !important;
    transition: none !important;
}

.btn:disabled:hover,
.btn.disabled:hover,
.page-item.disabled .page-link:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* テーブルの行の高さ調整 */
.table tbody tr {
    height: auto;
    min-height: 50px;
}

/* 数値の表示 */
.number-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* ステータス表示 */
.status-online {
    color: #28a745;
}

.status-offline {
    color: #dc3545;
}

/* カスタムスクロールバー */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* プログラムアイコンのスタイル */
.program-icon {
    width: 72px;
    height: 72px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

/* テーブル列幅の調整 */
.table th:nth-child(1),
.table td:nth-child(1) {
    width: 45%;
}

/* コメントテーブルの列幅調整 */
.comment-table th:nth-child(1),
.comment-table td:nth-child(1) {
    width: 15%;
}

.comment-table th:nth-child(2),
.comment-table td:nth-child(2) {
    width: 55%;
}

.comment-table th:nth-child(3),
.comment-table td:nth-child(3) {
    width: 15%;
}

.comment-table th:nth-child(4),
.comment-table td:nth-child(4) {
    width: 15%;
}

/* 地域別の色分け */
.region-kanto {
    border-left: 4px solid #0d6efd;
}

/* ワードクラウドのスタイル */
#wordCloudCanvas {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.word-cloud-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.region-kansai {
    border-left: 4px solid #198754;
}

.region-other {
    border-left: 4px solid #6c757d;
}

/* チャンネルリンクのスタイル */
a[href*="youtube.com"] {
    color: inherit;
    transition: color 0.2s ease-in-out;
}

a[href*="youtube.com"]:hover {
    color: #dc3545 !important;
}

a[href*="youtube.com"] .fas.fa-external-link-alt {
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

a[href*="youtube.com"]:hover .fas.fa-external-link-alt {
    opacity: 1;
}

/* 字幕・概要欄分析機能のスタイル */
.analysis-section {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.analysis-section h6 {
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid #27ae60;
    padding-bottom: 10px;
}

.wordcloud-analysis-wrapper {
    width: 100%;
    height: 400px;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d9dfe6;
    box-shadow: 0 0 0 1px #eef1f4 inset;
    border-radius: 8px;
}

.wordcloud-analysis-canvas {
    /* JS 側で width/height を指定するため、CSS での強制拡縮をやめる */
    display: block;
}

.subtitles-preview-wrapper {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.subtitles-preview-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.subtitles-preview-body {
    flex: 1;
    overflow-y: auto;
    font-size: 0.95em;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    padding-right: 6px;
}

.highlight-entity {
    background: linear-gradient(120deg, #52be80 0%, #27ae60 100%);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.party-chart-section {
    margin-top: 15px;
}

.party-chart-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.party-chart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 10px;
}

.party-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.party-item:last-child {
    border-bottom: none;
}

.party-bar-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.party-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.party-bar-label {
    width: 100px;
    font-weight: 600;
    color: #0b6623;
    font-size: 0.85em;
}

.party-bar {
    flex: 1;
    height: 16px;
    background: #e8f5e9;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}

.party-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #0b6623, #27ae60);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.party-bar-value {
    min-width: 32px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85em;
}

.party-breakdown-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 8px;
    border-left: 1px solid #e8f5e9;
}

.party-chart-empty {
    text-align: center;
    color: #6c757d;
    font-size: 0.85em;
    padding: 12px;
}

.party-detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 4px 8px;
    padding: 3px 0 2px 0;
    font-size: 0.8em;
    color: #6c757d;
}

.party-detail-list span {
    display: inline-block;
}

.party-detail-count {
    font-weight: 600;
    color: #0b6623;
    margin-left: 3px;
}

.party-breakdown-container {
    padding: 2px 0;
    display: flex;
    flex-direction: row;
    gap: 12px;
    font-size: 0.8em;
    align-items: center;
}

.party-breakdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.party-breakdown-label {
    color: #6c757d;
    font-size: 0.85em;
}

.party-breakdown-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85em;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .wordcloud-analysis-wrapper {
        height: 300px;
        min-height: 300px;
    }
    
    .subtitles-preview-wrapper {
        height: 300px;
        margin-top: 15px;
    }
    
    .party-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .party-breakdown-section {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #e8f5e9;
        padding-top: 8px;
    }
    
    .party-bar-label {
        width: 80px;
        font-size: 0.75em;
    }
    
    .party-detail-list {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 3px 6px;
    }
    
    .party-breakdown-container {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.75em;
    }
    
    .party-bar-value {
        min-width: 28px;
        font-size: 0.75em;
    }
    
    .party-chart-wrapper {
        padding: 8px;
        gap: 5px;
    }
}

/* 議員一覧ページ */
.reserved-words-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.reserved-word-item {
    font-size: 0.9em;
    padding: 6px 10px;
    cursor: default;
}

.reserved-word-item:hover {
    background-color: #ffc107 !important;
    transform: scale(1.05);
    transition: transform 0.2s;
}

.nav-tabs .nav-link {
    color: #495057;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    font-weight: 600;
}

.table th {
    white-space: nowrap;
}

/* 議員一覧ページのテーブルヘッダー */
#councillorsTable,
#representativesTable {
    table-layout: fixed;
    width: 100%;
}

#councillorsTable thead th,
#representativesTable thead th,
#councillorsTable thead.table-dark th,
#representativesTable thead.table-dark th {
    background: #0056b3 !important;
    color: white !important;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 3px solid #004085 !important;
    position: sticky;
    top: 0;
    z-index: 10;
    width: 16.666%; /* 6列なので各列を均等に */
}

#councillorsTable tbody td,
#representativesTable tbody td {
    width: 16.666%; /* 6列なので各列を均等に */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.table td {
    vertical-align: middle;
}

.badge {
    font-size: 0.85em;
    padding: 5px 10px;
}

/* 議員一覧ページのカードスタイル */
.card.border-primary {
    border-width: 2px !important;
}

.card.border-primary .card-title {
    margin-bottom: 10px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .reserved-words-container {
        max-height: 400px;
    }
    
    .table-responsive {
        font-size: 0.9em;
    }
    
    .nav-tabs {
        font-size: 0.9em;
    }
}
