/**
 * 統計情報ページ専用スタイル
 *
 * @description 統計データページのタブ、テーブル、グラフ表示用のスタイル定義
 * @author Claude Code
 * @version 1.1.0
 * @since 2025-11-02
 * @updated 2025-11-02 - 既存シミュレーターとデザイン統一
 */

/* ================================
   Content Wrapper
   ================================ */
.content-wrapper {
    max-width: 1024px;
    margin: 0 auto;
    padding: 20px 20px 40px;
    background: transparent;
}

/* ================================
   Tab Navigation
   ================================ */
.tab-wrap {
    margin-bottom: 0;
    background-color: #EFEFEF;
    padding: 0;
}

.tab-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #ccc;
}

.tab-nav li {
    flex: 1;
    text-align: center;
    border-right: 1px solid #ccc;
}

.tab-nav li:first-child {
    border-left: 1px solid #ccc;
}

.tab-nav li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border: none;
    transition: all 0.2s ease;
    position: relative;
    background-color: #fff;
    border-top: 1px solid #ccc;
}

.tab-nav li a:hover {
    background-color: #f5f5f5;
    color: #333;
}

.tab-nav li a.selected {
    color: #fff;
    font-weight: 600;
    border-top: 1px solid #555;
}

/* タブごとの背景色 */
#tab_kinri a.selected {
    background-color: #ff9933; /* オレンジ */
}

#tab_yatin a.selected {
    background-color: #3399ff; /* 青 */
}

#tab_toti a.selected {
    background-color: #66cc66; /* 緑 */
}

#tab_kensetu a.selected {
    background-color: #ff6666; /* 赤 */
}

#tab_tyoki a.selected {
    background-color: #cc9966; /* 茶/ベージュ */
}

/* ================================
   Tab Content Container
   ================================ */
.stats-container {
    background: #fff;
    min-height: 500px;
    padding: 0;
    border: 1px solid #ddd;
    border-top: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.tab-item {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-item.tab-active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content {
    padding: 30px 20px;
}

/* h2は既にstyle.cssでグローバル定義済み（黒背景+白文字） */
.tab-content h2 {
    background-color: transparent;
    color: #333;
    border-bottom: none;
    padding: 0;
}

.tab-content h3 {
    font-size: 16px;
    color: #333;
    margin: 20px 0 12px;
    font-weight: 700;
    line-height: 1.5;
    padding: 0;
    background-color: transparent;
    border-left: none;
}

.tab-content h4 {
    font-size: 16px;
    color: #444;
    margin: 25px 0 10px;
    font-weight: 600;
}

.tab-content h5 {
    font-size: 15px;
    color: #555;
    margin: 20px 0 10px;
    font-weight: 600;
}

.tab-content p {
    line-height: 1.8;
    color: #333;
    margin: 15px 0;
}

/* ================================
   Images
   ================================ */
.image-container {
    margin: 30px 0;
    text-align: center;
    padding: 0 10px;
}

.stats-image {
    max-width: 95%;
    width: auto;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    margin: 15px auto;
    display: block;
}

/* ================================
   Data Tables
   ================================ */
.data-table {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background: #e8dcc8;
    color: #333;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #333333;
}

.data-table th {
    font-weight: 700;
    font-size: 14px;
}

.data-table td {
    color: #333;
    font-size: 14px;
}

.data-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.data-table tbody tr:hover {
    background: #e8f4f8;
}

/* ================================
   Statistics Summary
   ================================ */
.stats-summary {
    padding: 20px 20px 20px 0;
    margin: 20px 0;
}

.stats-summary dl {
    margin: 0;
}

.stats-summary dt {
    font-weight: 600;
    color: #023F64;
    margin: 15px 0 5px;
    font-size: 15px;
}

.stats-summary dt:first-child {
    margin-top: 0;
}

.stats-summary dd {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.stats-summary dd strong {
    color: #c00;
    font-size: 16px;
}

.stats-summary .note {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

/* ================================
   Rent Reference Section
   ================================ */
.rent-reference {
    padding: 20px;
    margin: 30px 0;
}

.rent-reference h3 {
    margin-top: 0;
}

/* ================================
   Land Price Report
   ================================ */
.land-price-report {
    margin-top: 40px;
    padding: 20px;
}

.report-section {
    padding: 20px;
    margin: 20px 0;
}

.report-section article {
    margin: 20px 0;
}

.report-section article h5 {
    margin: 20px 0 10px;
}

.report-section ul {
    line-height: 1.8;
    color: #333;
}

.report-section li {
    margin: 8px 0;
}

/* ================================
   Tax Tables
   ================================ */
.tax-section {
    margin: 30px 0;
}

.tax-section h3 {
    background-color: transparent;
    color: #333;
    padding: 0;
    border-left: none;
    margin: 20px 0 15px;
    font-size: 16px;
    font-weight: 700;
}

/* H3見出しのグローバルスタイル上書き（税セクション専用） */
.tab-content .tax-section h3 {
    background-color: transparent !important;
    color: #333 !important;
    padding: 0 !important;
    border-left: none !important;
}

.tax-section > ul {
    line-height: 1.8;
    margin: 15px 0;
    padding-left: 25px;
}

.loan-tax-table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff; /* 白背景 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
}

.loan-tax-table th,
.loan-tax-table td {
    border: 1px solid #9d9786;
    padding: 10px;
    text-align: center;
    background: #ffffff;
}

.loan-tax-table thead th {
    background: #e8dcc8; /* ベージュ系ヘッダー */
    font-weight: 700;
    color: #333;
}

.loan-tax-table tbody th {
    background: #e8dcc8; /* ベージュ系（項目名） */
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* カラム幅の調整 */
.loan-tax-table tbody tr th:first-child {
    width: 140px; /* 1列目：借入限度額など */
}

.loan-tax-table tbody tr th:nth-child(2) {
    width: 140px; /* 2列目：新築住宅・買取再販など */
}

.loan-tax-table tbody tr th:nth-child(3) {
    width: 180px; /* 3列目：一般住宅、省エネ基準適合住宅など */
}

.loan-tax-table .note {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    display: block;
    margin-top: 5px;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.other-tax-table {
    width: auto;
    max-width: 100%;
    margin: 20px auto;
    border-collapse: collapse;
    background: #ffffff; /* 白背景 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.other-tax-table th,
.other-tax-table td {
    border: 1px solid #9d9786;
    padding: 15px;
    background: #ffffff;
}

.other-tax-table thead th {
    background: #e8dcc8; /* ベージュヘッダー */
    color: #333;
    font-weight: 700;
}

.other-tax-table tbody th {
    background: #e8dcc8; /* ベージュ（項目名） */
    text-align: left;
    white-space: nowrap;
    color: #333;
    font-weight: 600;
}

.other-tax-table .highlight {
    background: #fffacd; /* 薄い黄色（認定住宅列） */
}

.other-tax-table ol {
    margin: 0;
    padding-left: 20px;
    text-align: left;
}

.other-tax-table ol li {
    margin: 5px 0;
}

/* 赤文字強調（金額等） */
.loan-tax-table .red-text,
.other-tax-table .red-text {
    color: #c00;
    font-weight: 600;
}

/* ================================
   Utility Classes
   ================================ */
.source {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 20px;
    font-style: italic;
}

.footnote {
    color: #555;
    margin: 10px 0;
    padding: 10px 15px;
    line-height: 1.6;
}

.footnote strong {
    color: #c00; /* 赤文字に変更 */
    font-weight: 600;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 768px) {
    .tab-nav {
        flex-direction: column;
    }

    .tab-nav li {
        width: 100%;
    }

    .tab-content {
        padding: 20px 15px;
    }

    .data-table,
    .loan-tax-table,
    .other-tax-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td,
    .loan-tax-table th,
    .loan-tax-table td,
    .other-tax-table th,
    .other-tax-table td {
        padding: 8px;
    }

    .table-container {
        overflow-x: scroll;
    }
}
