/**
 * 井上式貸借対照表面積グラフの拡張スタイル
 */

/* 全体コンテナ */
.bs-area-graph-container.enhanced {
    font-family: "Hiragino Kaku Gothic ProN", "メイリオ", sans-serif;
    max-width: 1100px;
    margin: 20px auto;
    background-color: #e6f2ff;
    padding: 15px;
    box-sizing: border-box;
    color: #333;
    font-size: 13px;
}

/* ヘッダー */
.bs-header {
    display: flex;
    background-color: #4b9cd3;
    color: white;
    padding: 10px 20px;
    align-items: center;
    font-weight: bold;
    margin-bottom: 20px;
    border-radius: 5px 5px 0 0;
}

.bs-header-left {
    flex: 1;
    font-size: 28px;
    font-weight: bold;
}

.bs-header-center {
    flex: 3;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
}

.bs-header-right {
    flex: 1;
    text-align: right;
    font-size: 16px;
}

/* 3カラムレイアウト */
.bs-area-three-column-layout {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.bs-area-column {
    flex: 1;
    background-color: white;
    padding: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 3px;
}

.section-title {
    text-align: center;
    background-color: white;
    padding: 8px;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 16px;
}

.arrow-down {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid #ddd;
    margin: 0 auto 10px;
}

.instruction-text {
    font-size: 12px;
    margin: 10px 0;
    padding: 8px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    line-height: 1.4;
    color: #555;
    border-radius: 3px;
}

/* テーブルヘッダー */
.bs-area-table-header {
    text-align: center;
    background-color: #a8d8f0;
    color: #333;
    padding: 8px;
    margin: 15px 0 0 0;
    font-size: 16px;
    font-weight: bold;
    border-radius: 3px 3px 0 0;
}

/* テーブルスタイル */
.bs-area-balance-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 12px;
}

.bs-area-balance-table th,
.bs-area-balance-table td {
    border: 1px solid #ddd;
    padding: 5px 8px;
}

.bs-area-balance-table th {
    background-color: #f5f5f5;
    text-align: center;
    font-weight: bold;
}

.bs-area-balance-table td:nth-child(2),
.bs-area-balance-table td:nth-child(3) {
    text-align: right;
}

.category-header td {
    background-color: #f0f0f0;
    font-weight: bold;
    text-align: center !important;
}

.subtotal td {
    background-color: #f8f8f8;
    border-top: 2px solid #ddd;
    font-weight: bold;
}

.total td {
    background-color: #e6f2ff;
    font-weight: bold;
    border-top: 2px solid #aaa;
}

/* 面積グラフ部分 */
.area-graph-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.bs-area-graph-title {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin: 0;
    background-color: #4b9cd3;
    color: white;
    padding: 8px;
}

.area-graph-content {
    display: flex;
    flex: 1;
    position: relative;
    min-height: 500px;
    margin: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
}

.area-graph-scale {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 100%;
    border-right: 1px solid #eee;
}

.scale-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #eee;
}

.scale-value {
    position: absolute;
    right: 5px;
    top: -8px;
    font-size: 10px;
    color: #666;
}

.area-graph-columns {
    display: flex;
    flex: 1;
    margin-left: 40px;
    height: 100%;
}

.area-graph-column {
    flex: 1;
    position: relative;
    border-right: 1px solid #eee;
}

.area-graph-column:last-child {
    border-right: none;
}

.area-graph-label {
    text-align: center;
    padding: 5px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    background-color: #f5f5f5;
    position: relative;
    z-index: 10;
}

.area-graph-blocks {
    position: relative;
    height: 500px;
}

.asset-block, .liab-equity-block {
    position: absolute;
    width: 100%;
    left: 0;
    border: 1px solid rgba(0,0,0,0.2);
    box-sizing: border-box;
    transition: opacity 0.2s;
    overflow: hidden;
}

.asset-block:hover, .liab-equity-block:hover {
    opacity: 0.8;
    cursor: pointer;
}

.block-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
    pointer-events: none;
}

/* フォーミュラボックス */
.company-strength-formula {
    margin: 15px 10px;
}

.formula-box {
    border: 1px solid #aaa;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.formula-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.formula-content, .formula-calculation {
    text-align: center;
    padding: 3px 0;
    font-size: 13px;
}

/* 指標セクション */
.bs-indicators-section {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.bs-indicators-column {
    flex: 1;
    background-color: white;
    padding: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 3px;
}

.indicator-row {
    display: flex;
    border-bottom: 1px dotted #ddd;
    padding: 6px 0;
    align-items: center;
    font-size: 12px;
}

.indicator-label {
    flex: 3;
    padding-right: 10px;
}

.indicator-value {
    flex: 1;
    text-align: right;
    font-weight: bold;
    border-bottom: 1px dotted #999;
    min-width: 60px;
}

/* フッター */
.bs-footer {
    text-align: right;
    font-size: 12px;
    padding: 8px 15px;
    background-color: #4b9cd3;
    color: white;
    border-radius: 0 0 5px 5px;
    margin-top: 10px;
}

.footer-text, .footer-note {
    margin: 2px 0;
}

/* アセットカラー */
.asset-cash { background-color: rgba(54, 162, 235, 0.8); }
.asset-notes_receivable { background-color: rgba(75, 192, 192, 0.8); }
.asset-accounts_receivable { background-color: rgba(153, 102, 255, 0.8); }
.asset-inventory { background-color: rgba(255, 99, 132, 0.8); }
.asset-other_current { background-color: rgba(255, 159, 64, 0.8); }
.asset-buildings { background-color: rgba(255, 206, 86, 0.8); }
.asset-equipment { background-color: rgba(75, 192, 192, 0.8); }
.asset-land { background-color: rgba(153, 102, 255, 0.8); }
.asset-investments { background-color: rgba(255, 99, 132, 0.8); }
.asset-other_fixed { background-color: rgba(54, 162, 235, 0.8); }

/* 負債資本カラー */
.equity-retained_earnings { background-color: rgba(255, 206, 86, 0.8); }
.equity-capital { background-color: rgba(255, 159, 64, 0.8); }
.fixed-liab-long_loans { background-color: rgba(75, 192, 192, 0.8); }
.fixed-liab-other_fixed { background-color: rgba(153, 102, 255, 0.8); }
.current-liab-short_loans { background-color: rgba(255, 99, 132, 0.8); }
.current-liab-discounted_notes { background-color: rgba(54, 162, 235, 0.8); }
.current-liab-accounts_payable { background-color: rgba(255, 206, 86, 0.8); }
.current-liab-notes_payable { background-color: rgba(255, 159, 64, 0.8); }
.current-liab-other_current { background-color: rgba(75, 192, 192, 0.8); }

/* レスポンシブデザイン */
@media screen and (max-width: 992px) {
    .bs-area-three-column-layout {
        flex-direction: column;
    }
    
    .bs-indicators-section {
        flex-direction: column;
    }
    
    .bs-header-center {
        font-size: 18px;
    }
    
    .bs-header-left,
    .bs-header-right {
        font-size: 14px;
    }
    
    .area-graph-content {
        min-height: 400px;
    }
    
    .area-graph-blocks {
        height: 400px;
    }
}

@media screen and (max-width: 576px) {
    .bs-area-graph-container.enhanced {
        padding: 5px;
    }
    
    .bs-header {
        flex-direction: column;
        padding: 5px;
    }
    
    .bs-header-left,
    .bs-header-right,
    .bs-header-center {
        text-align: center;
        width: 100%;
        margin: 3px 0;
    }
    
    .area-graph-content {
        min-height: 300px;
    }
    
    .area-graph-blocks {
        height: 300px;
    }
}