/**
 * 파일경로: /assets/css/ll-graph.css
 * 파일역할: D 계층 그래프 스타일 (Ver 14.1 - Layout Fix)
 * * [긴급수정] 그래프 영역(.ll-graph-body) 높이를 340px로 확장하여 하단 버튼 노출 보장
 */

/* Container */
.ll-graph-wrap {
    margin-top: 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

/* Header */
.ll-graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}

.ll-graph-header:active {
    background-color: #f9f9f9;
}

.ll-graph-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ll-graph-toggle-icon {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s;
}

/* Collapsed State */
.ll-graph-wrap.collapsed .ll-graph-tabs,
.ll-graph-wrap.collapsed .ll-graph-period,
.ll-graph-wrap.collapsed .ll-graph-controls { display: none; }
.ll-graph-wrap.collapsed .ll-graph-body,
.ll-graph-wrap.collapsed .ll-graph-footer { display: none; }
.ll-graph-wrap.collapsed .ll-graph-header { border-bottom: none; }
.ll-graph-wrap.collapsed .ll-graph-toggle-icon { transform: rotate(-90deg); }

/* Tabs & Controls */
.ll-graph-tabs {
    display: flex;
    gap: 8px;
    background: #f5f7fa;
    padding: 4px;
    border-radius: 12px;
}

.ll-graph-tab {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #808e9b;
    cursor: pointer;
    transition: all 0.2s;
}
.ll-graph-tab.active {
    background: #fff;
    color: #1e272e;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ll-graph-period {
    display: flex;
    gap: 5px;
}
.ll-period-btn {
    border: 1px solid #eee;
    background: #fff;
    color: #888;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}
.ll-period-btn.active {
    background: #4b7bec;
    color: #fff;
    border-color: #4b7bec;
}

/* Chart Area [FIXED HEIGHT] */
.ll-graph-body {
    padding: 20px;
    position: relative;
    /* 그래프(220px) + 컨트롤 버튼 영역 확보를 위해 높이 증가 */
    height: 340px; 
    display: flex;
    flex-direction: column;
}
.ll-trend-chart {
    flex: 1;
    width: 100%;
    overflow: visible;
}
.ll-graph-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* [NEW] Bottom Controls (Chips) */
.ll-graph-controls {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0; /* 크기 줄어들지 않게 고정 */
}
.ll-graph-controls::-webkit-scrollbar { display: none; }

.ll-control-chip {
    border: 1px solid #eee;
    background: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #636e72;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.ll-control-chip:hover { background: #f5f6fa; }
.ll-control-chip.active {
    background: #e5edff;
    color: #4b7bec;
    border-color: #4b7bec;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(75, 123, 236, 0.2);
}

/* Chart Elements */
.chart-grid-line {
    stroke: #f0f0f0;
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

.chart-path {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: d 0.5s ease;
}
.chart-path.physical { stroke: #4b7bec; }
.chart-path.mental { stroke: #a55eea; }
.chart-path.peer { stroke: #dfe6e9; stroke-width: 2; } 

.chart-point {
    fill: #fff;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s;
}
.chart-point.physical { stroke: #4b7bec; }
.chart-point.mental { stroke: #a55eea; }
.chart-point:hover { r: 6; }

.chart-label-x {
    font-size: 10px;
    fill: #999;
    text-anchor: middle;
}

/* Footer */
.ll-graph-footer {
    padding: 15px 20px;
    background: #f9fbfc;
    border-top: 1px solid #f5f5f5;
    font-size: 13px;
    color: #57606f;
    line-height: 1.5;
}
.ll-trend-highlight { font-weight: 700; color: #4b7bec; }
.ll-graph-message { 
    position: absolute; top: 40%; left: 50%; 
    transform: translate(-50%, -50%); 
    color: #999; font-size: 14px; text-align: center; width: 100%;
}

/* --- Mobile Responsive Fix --- */
@media (max-width: 480px) {
    .ll-graph-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }
    .ll-graph-title {
        width: 100%;
        justify-content: space-between;
        font-size: 15px;
    }
    .ll-graph-header > div:not(.ll-graph-title) {
        width: 100%;
        justify-content: space-between;
    }
    .ll-graph-tab, .ll-period-btn {
        flex: 1;
        text-align: center;
        padding: 8px 0;
        font-size: 12px;
    }
    /* 모바일에서도 높이 충분히 확보 */
    .ll-graph-body {
        height: 300px; 
        padding: 10px;
    }
}