/* Stats独自スタイル - Tool共通CSSの上書き・追加用 */

/* Sticky Footer - フッターを常に最下部に配置 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.contents {
    flex: 1;
}

/* Stats用のグリッドレイアウト */
.contents .inner {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.contents .inner > h1,
.contents .inner > h2,
.contents .inner > h3,
.contents .inner > p,
.contents .inner > .no-data,
.contents .inner > .parts-index,
.contents .inner > #table_of_contents {
    grid-column: 1 / -1;
}

/* グラフコンテナ */
.chart-container {
    padding: 20px;
    background-color: #fafafa;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.chart-title {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    color: #555;
    text-align: center;
    min-width: 0;
}

canvas {
    max-height: 400px;
    max-width: 100%;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.period-selector {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    min-width: 80px;
    flex-shrink: 0;
}

.period-selector:hover {
    border-color: #4CAF50;
}

.period-selector:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* レスポンシブ対応：スマホでは1カラム */
@media (max-width: 768px) {
    .contents .inner {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .chart-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .chart-title {
        text-align: center;
        margin-bottom: 0;
    }

    .period-selector {
        width: 100%;
        min-width: auto;
        text-align: center;
    }

    .chart-container {
        padding: 15px;
    }
}

/* 目次スタイル */
#table_of_contents {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.toc_title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0 0 15px 0;
    padding:0 0 10px 10px;
    border-bottom: 2px solid #4CAF50;
}

.toc_list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toc_item {
    margin: 0;
}

.toc_link {
    display: block;
    color: #0066cc;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 1px solid #4CAF50;
}

.toc_link:hover {
    background-color: #e8f5e9;
    color: #2e7d32;
    text-decoration: none;
    transform: translateX(5px);
}

.toc_link:visited {
    color: #0066cc;
}

/* 目次のレスポンシブ対応 */
@media (max-width: 768px) {
    .toc_list {
        flex-direction: column;
    }
    .toc_link {
        border-bottom: none;
    }
}

/* パーツインデックス - ボタンスタイル */
.parts-index {
    margin: 30px 0;
}

.parts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.parts-list li {
    margin: 0;
}

.parts-list li a {
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.parts-list li a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.parts-list li a:visited {
    color: white;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .parts-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .parts-list {
        grid-template-columns: 1fr;
    }
}
