/* ==========================================
   analysis.css
   解析結果
========================================== */

/* =========================
   Loading
========================= */

#loading{

    display:none;

    margin:15px 0;

    text-align:center;

    font-size:18px;

    font-weight:bold;

    color:#007aff;
}

/* =========================
   Error
========================= */

#error{

    margin:15px 0;

    text-align:center;

    font-size:17px;

    font-weight:bold;

    color:#d60000;
}

/* =========================
   Result Card
========================= */

.analysis-card{

    padding:5px 0;
}

/* =========================
   Result Table
========================= */

.result-table{

    width:100%;

    border-collapse:separate;

    border-spacing:0 10px;

    table-layout:fixed;
}

.result-table tr{

    background:#ffffff;

    box-shadow:0 2px 6px rgba(0,0,0,.08);

    border-radius:10px;
}

.result-table td{

    padding:12px;

    vertical-align:middle;
}

.result-label{

    width:58%;

    font-size:16px;

    font-weight:500;
}

.result-value{

    width:42%;

    text-align:right;

    white-space:nowrap;

    font-size:16px;

    font-weight:600;
}

/* =========================
   Separator
========================= */

.separator-row td{

    border-top:2px solid #d9d9d9;

    padding-top:18px;
}

/* =========================
   Total Cells
========================= */

.total-row td{

    font-size:20px;

    font-weight:bold;
}

.total-row .result-label{

    color:#333333;
}

.total-cell{

    font-size:28px;

    font-weight:bold;

    color:#111111;
}

/* =========================
   Aoko Level
========================= */

.level-high{

    color:#e53935;

    font-weight:bold;
}

.level-mid{

    color:#fb8c00;

    font-weight:bold;
}

.level-low{

    color:#43a047;

    font-weight:bold;
}

.level-none{

    color:#888888;

    font-style:italic;
}

/* ==========================================
   棒グラフ
========================================== */

.bar-chart{

    margin-top:0px;
}

.bar-row{

    display:grid;

    grid-template-columns:52px 1fr 58px;

    align-items:center;

    gap:10px;

    margin-bottom:8px;
}

.bar-label{

    font-size:15px;

    font-weight:600;

    text-align:right;
}

.bar-container{

    width:100%;

    height:14px;

    background:#ececec;

    border-radius:999px;

    overflow:hidden;
}

.bar-fill{

    height:100%;

    border-radius:999px;

    background:linear-gradient(
        90deg,
        #4facfe,
        #00c6ff
    );

    transition:width .35s ease;
}

.bar-fill.active{

    background:linear-gradient(
        90deg,
        #ff7b54,
        #ffb347
    );
}

.bar-value{

    font-size:14px;

    font-weight:600;

    text-align:right;

    white-space:nowrap;
}

/* ==========================================
   ドーナツグラフ
========================================== */

.chart-wrapper{

    width:100%;

    max-width:360px;

    height:360px;

    margin:0 auto;

    display:flex;

    justify-content:center;

    align-items:center;
}

.chart-wrapper canvas{

    width:100% !important;

    height:100% !important;
}

/* ==========================================
   カスタム凡例
========================================== */

.custom-legend{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:12px;

    margin-top:20px;
}

.legend-item{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:10px 12px;

    border-radius:10px;

    background:#f8fafc;

    border:1px solid #eceff3;

    transition:.2s;
}

.legend-item:hover{

    background:#eef6ff;
}

.legend-left{

    display:flex;

    align-items:center;

    gap:8px;

    min-width:0;
}

.legend-color{

    width:12px;

    height:12px;

    border-radius:50%;

    flex-shrink:0;
}

.legend-label{

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

    font-size:15px;

    font-weight:500;
}

.legend-value{

    margin-left:12px;

    font-weight:bold;

    white-space:nowrap;

    flex-shrink:0;
}

/* ==========================================
   解析カード
========================================== */

.analysis-card{

    animation:fadeIn .35s ease;

    padding:15px 20px;

    margin-bottom:12px;
}

@keyframes fadeIn{

    from{

        opacity:0;

        transform:translateY(8px);
    }

    to{

        opacity:1;

        transform:none;
    }
}