/* グラフ,表が正しく表示されるバージョン */
/* 基本スタイル (PC表示を基準) グラフの縦軸を長くし、青枠と同じ長さに*/
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 20px;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}
.container {
    max-width: 960px; /* PCでの最大幅 */
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px; /* グラフ上部の空間を少し減らす */
    font-size: 2.2em;
    padding: 10px 0;
}

/* グラフの日付表示スタイル */
.graph-date-display {
    text-align: center;
    font-size: 1.5em;
    color: #34495e;
    margin-bottom: 15px; /* グラフとの間隔 */
    margin-top: 0; /* 上部の余白を調整 */
}

.graph-section {
    margin-top: 20px; /* グラフセクションの上部の空間を調整 */
    text-align: center;
}

/* グラフの親コンテナを作成し、最大幅と中央寄せ、レスポンシブな高さ調整を適用 */
.graph-container {
    max-width: 80%;
    margin: 0 auto;
    position: relative;
    height: 300px;
    overflow: hidden;
    border: 3px solid #3498db;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    background-color: #fdfdfd;
}

/* グラフ表示用の canvas スタイル */
#wbgtChart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ★★★ここから追加部分★★★ */
.table-section {
    margin-top: 40px;
    text-align: center;
}

.table-section h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.wbgt-table {
    width: 100%;
    max-width: 60%; /* PC表示のテーブル幅を60%に設定 */
    margin: 0 auto;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.wbgt-table th, .wbgt-table td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: center;
    font-size: 0.95em;
}

.wbgt-table thead th {
    background-color: #3498db;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wbgt-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wbgt-table tbody tr:hover {
    background-color: #f0f0f0;
}

/* 危険度に応じた色分け */
.risk-alert {
    background-color: #9b59b6; /* 紫 */
    color: #000;
    font-weight: bold;
}
.risk-danger {
    background-color: #e74c3c; /* 赤 */
    color: #000;
    font-weight: bold;
}
.risk-very-high-alert {
    background-color: #f39c12; /* オレンジ */
    color: #000;
    font-weight: bold;
}
.risk-high-alert {
    background-color: #f1c40f; /* 黄色 */
    color: #000;
    font-weight: bold;
}
.risk-caution {
    background-color: #2ecc71; /* 緑 */
    color: #000;
    font-weight: bold;
}
.risk-safe {
    background-color: #3498db; /* 青 */
    color: #000;
    font-weight: bold;
}

/* ★★★ここまで追加部分★★★ */

.button-container {
    text-align: center;
    margin-top: 30px;
}
.button {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1.1em;
    color: #fff;
    background-color: #3498db;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.button:hover {
    background-color: #2980b9;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        margin: 10px;
    }
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    .graph-date-display {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    .graph-container {
        height: 250px;
    }
    .button {
        padding: 10px 20px;
        font-size: 1em;
    }
    /* テーブルのレスポンシブ調整: モバイルでも通常の表形式を維持 */
    .table-section {
        overflow-x: auto; /* 画面に収まらない場合、横スクロールを許可 */
    }
    .wbgt-table {
        max-width: 80%; /* スマホ表示のテーブル幅を80%に設定 */
        margin: 0 auto;
        /* ここから下のdisplay関連のスタイルは削除しました */
    }
}

/* ★★★ここから凡例の追加・修正部分★★★ */
.risk-legend {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1em;
    color: #555; /* 凡例の文字色をグレーに設定 */
}

.risk-legend span {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    margin-right: 5px;
    border: 1px solid #aaa;
}

/* 凡例の色を背景色で設定 */
.risk-alert span { background-color: #9b59b6; }
.risk-danger span { background-color: #e74c3c; }
.risk-very-high-alert span { background-color: #f39c12; }
.risk-high-alert span { background-color: #f1c40f; }
.risk-caution span { background-color: #2ecc71; }
.risk-safe span { background-color: #3498db; }
/* ★★★ここまで凡例の追加・修正部分★★★ */

/* ★★★ここからグラフ凡例用の新しいスタイルを追加します★★★ */
.chart-legend-container {
    text-align: center;
    margin-top: 15px; /* グラフとの間隔 */
    font-size: 1.1em;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* 記号とテキストの間の隙間 */
}

.chart-legend-symbol {
    position: relative; /* 子要素の基準点とする */
    width: 25px; /* 線の長さに合わせる */
    height: 10px; /* 点の直径に合わせる */
}

.chart-legend-line,
.chart-legend-point {
    position: absolute; /* 親要素を基準に配置 */
    top: 50%; /* 縦方向の中央に */
    left: 50%; /* 横方向の中央に */
    transform: translate(-50%, -50%); /* 要素自体の半分戻すことで完全に中央に */
}

.chart-legend-line {
    width: 25px; /* 線の長さ */
    height: 2px;
    background-color: #3498db; /* グラフの線の色と一致 */
}

.chart-legend-point {
    width: 10px; /* 点の直径 */
    height: 10px;
    background-color: #3498db; /* グラフの点の背景色と一致 */
    border-radius: 50%;
    border: 2px solid #fff; /* 点の白い枠と一致 */
}
/* ★★★追加ここまで★★★ */