/**
 * データ集計画面のスタイル
 * 
 * データ取得、データ処理、データ提供の3つのタブで構成される集計画面のスタイル定義
 * VICSセンター、DRMリンク、車両位置データなどの取得・処理状況を表示
 */

/* ========================================
   メインコンテナ
   ======================================== */

#dataAggregation {
    background: white;
    padding: 0;
}

.data-aggregation-container {
    padding: 20px;
    max-width: 100%;
    margin: 0;
    background: white;
}

/* ========================================
   タブナビゲーション
   データ取得、データ処理、データ提供の3つのタブ
   ======================================== */

.aggregation-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 20px 0;
    padding: 0;
    border-bottom: 2px solid #ddd;
    background: #f8f9fa;
}

.tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-button:hover {
    color: #000;
    background-color: #e9ecef;
}

/* アクティブなタブ */
.tab-button.active {
    color: #5b6abf;
    border-bottom: 3px solid #5b6abf;
    font-weight: 600;
    background: white;
}

/* ========================================
   タブコンテンツエリア
   各タブの内容を表示するメインエリア
   ======================================== */

.aggregation-content {
    background: white;
    padding: 0;
    min-height: 300px;
}

.tab-content {
    display: none;
}

/* アクティブなタブコンテンツ */
.tab-content.active {
    display: block;
}

/* ========================================
   集計セクション
   VICSセンター、DRMリンク、車両位置データなどのセクション
   ======================================== */

.aggregation-section {
    margin-bottom: 40px;
}

.aggregation-section:last-child {
    margin-bottom: 0;
}

.aggregation-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #5b6abf;
    color: #333;
    font-size: 18px;
}

/* ========================================
   テーブルコンテナ
   スクロール可能なテーブル表示エリア
   ======================================== */

.table-container {
    overflow-x: auto;
    overflow-y: auto;
    margin-top: 15px;
    max-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ========================================
   集計テーブル
   データ取得・処理・提供の状況を表示するテーブル
   ======================================== */

.aggregation-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

/* テーブルヘッダー（固定表示） */
.aggregation-table thead {
    background-color: #5b6abf;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.aggregation-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #ddd;
}

.aggregation-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
}

/* 偶数行の背景色（ゼブラストライプ） */
.aggregation-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 行のホバー効果 */
.aggregation-table tbody tr:hover {
    background-color: #f0f0f0;
}

/* ========================================
   ステータス表示
   成功、失敗、警告などの状態を色分け表示
   ======================================== */

/* 成功状態（緑色） */
.status-成功,
.status-success {
    color: #28a745;
    font-weight: bold;
}

.status-失敗,
.status-error {
    color: #dc3545;
    font-weight: bold;
}

.status-警告,
.status-warning {
    color: #ffc107;
    font-weight: bold;
}

/* ========================================
   ローディング表示
   データ読み込み中のスピナー表示
   ======================================== */

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5b6abf;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   情報メッセージ
   データが存在しない場合などの通知メッセージ
   ======================================== */

.info-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.info-message p {
    margin: 0;
}

/* ========================================
   エラーメッセージ
   データ取得失敗などのエラー表示
   ======================================== */

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.error-message p {
    margin: 10px 0;
}

.error-detail {
    font-size: 14px;
    color: #666;
}

/* ========================================
   レスポンシブ対応
   タブレット・スマートフォン向けのレイアウト調整
   ======================================== */

/* タブレット向け（768px以下） */
@media (max-width: 768px) {
    .data-aggregation-container {
        padding: 10px;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .aggregation-tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab-button {
        width: 100%;
        text-align: left;
        padding: 10px 15px;
    }

    .aggregation-table {
        font-size: 14px;
    }

    .aggregation-table th,
    .aggregation-table td {
        padding: 8px;
    }
}

/* ========================================
   2次メッシュ詳細リスト
   1次メッシュに含まれる2次メッシュの一覧表示
   ======================================== */

.mesh-details-list {
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #5b6abf;
    margin: 5px 0;
}

/* 2次メッシュリストのタイトル */
.mesh-details-list strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

/* 2次メッシュリスト（3カラム表示） */
.mesh-details-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    column-count: 3;
    column-gap: 20px;
}

.mesh-details-list li {
    padding: 5px 0;
    font-size: 13px;
    color: #555;
    break-inside: avoid;
    page-break-inside: avoid;
}

.mesh-details-list li:hover {
    color: #5b6abf;
    font-weight: 500;
}

/* ========================================
   詳細行のスタイル
   展開された2次メッシュ詳細を表示する行
   ======================================== */

.detail-row td {
    background-color: #ffffff !important;
    padding: 0 !important;
}

.detail-row:hover td {
    background-color: #ffffff !important;
}

/* 2次メッシュリストのレスポンシブ対応 */
@media (max-width: 1200px) {
    .mesh-details-list ul {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .mesh-details-list ul {
        column-count: 1;
    }
}
