/* =========================================================== */
/*                      25.10.12 추가                           */
/*                  simulation platform page                   */
/* =========================================================== */

.simulation-container {
    display: flex;
    gap: 2rem;
    padding: 1rem 3rem;
    /*height: calc(100vh - 200px);*/
    min-height: 700px;
    max-height: 1300px;

    font-size: 1rem;
}

.simulation-filters {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 1rem;
}

/* 스크롤바 스타일링 */
.simulation-filters::-webkit-scrollbar {
    width: 6px;
}

.simulation-filters::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.simulation-filters::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.simulation-filters::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.filter-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
    flex-shrink: 0;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group-title {
    /*font-size: 1.2rem;*/
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.filter-group-title svg {
    width: 20px;
    height: 20px;
}

/* 국가 필터 헤더 - 타이틀과 검색창을 가로로 배치 */
.filter-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-group-header .filter-group-title {
    margin-bottom: 0;
    /*font-size: 1.2rem;*/
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-group-search {
    flex: 1;
    min-width: 0;
}

.filter-group-content {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

.filter-group-content::-webkit-scrollbar {
    width: 4px;
}

.filter-group-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.filter-group-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* =========================================================== */
/*                    Tom Select 커스터마이징                    */
/* =========================================================== */

.ts-wrapper {
    width: 100%;
}

/* 검색창 스타일 - 컴팩트하게 */
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    border-radius: 4px;
    border: none;
    background-color: #F5F6F8;
    padding: 0.4rem 0.6rem;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.ts-wrapper.single .ts-control:hover,
.ts-wrapper.multi .ts-control:hover {
    border-color: #888;
}

.ts-wrapper.focus .ts-control {
    border-color: #0E2841;
    box-shadow: 0 0 0 1px #0E2841;
}

/* 검색 input 스타일 */
.ts-control > input {
    width: 100% !important;
    padding: 0 !important;
    padding-left: 1.8rem !important;
    border: none !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%239CA0B2" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>') no-repeat left center !important;
    background-size: 14px 14px;
}

.ts-control > input::placeholder {
    color: #9CA0B2;
    font-size: 0.9rem;
}

.ts-control > input:focus {
    outline: none;
}

.ts-wrapper.multi .ts-control > div.item {
    display: none !important;
}

/* 드롭다운 스타일 */
.ts-dropdown {
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.ts-dropdown .option {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    gap: 0.5rem;
}

.ts-dropdown .option:last-child {
    border-bottom: none;
}

.ts-dropdown .option:hover {
    background-color: #f0f0f0;
}

.ts-dropdown .option.active {
    background-color: #0E2841;
    color: #fff;
}

.ts-dropdown .option.selected {
    background-color: #e7f0ff;
    color: #0E2841;
}

/* 선택된 국가 아이템 스타일 (filter-group-content 안에 커스텀 렌더링) */
.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.75rem;
    background-color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.country-item:hover {
    background-color: #f9f9f9;
}

.country-item .country-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 1;
    text-align: center;
    color: #aaa;
    font-weight: bold;
    cursor: pointer;
    margin-left: auto;
    border-radius: 3px;
    font-size: 1rem;
}

.country-item .country-remove:hover {
    color: #fff;
    background-color: #ff4444;
}

/* 국가 아이콘/색상 점 스타일 */
.country-flag-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.legend-indicator-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.country-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* =========================================================== */
/*                         트리 필터                            */
/* =========================================================== */

.tree-filter {
    list-style: none;
    padding: 0 0 0 1rem;
    margin: 0 0 0 1rem;
    border-left: 1px solid #ccc;
}

.tree-parent-item {
    margin-bottom: 0.3rem;
}

.tree-parent-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #555;
}

.tree-parent-label:hover {
    background-color: #f0f0f0;
}

.tree-parent-label .accordion-icon {
    width: 10px;
    height: 16px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-parent-label .accordion-icon svg {
    width: 100%;
    height: 100%;
}

.tree-parent-item.active .accordion-icon {
    transform: rotate(90deg);
}

.tree-child-list {
    list-style: none;
    padding: 0 0 0 1rem;
    margin: 0 0 0 1rem;
    border-left: 1px solid #ccc;
    display: none;
}

/* =========================================================== */
/*                         필터 리스트                          */
/* =========================================================== */

.filter-list {
    list-style: none;
    margin: 0;
    overflow-y: auto;
    padding: 0.5rem;
    max-height: 200px;
}

.filter-list::-webkit-scrollbar {
    width: 4px;
}

.filter-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.filter-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.tree-input, .filter-input {
    display: none;
}

.tree-child-label, .filter-label {
    display: block;
    padding: 0.2rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.filter-label {
    padding-left: 2.5rem;
}

.tree-child-label:hover, .filter-label:hover {
    background-color: #f0f0f0;
}

/* 체크박스 커스텀 스타일 */
.filter-label::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.filter-input:checked + .filter-label::before {
    border-color: #0088FF;
}

.filter-input:checked + .filter-label::after {
    content: '';
    position: absolute;
    left: 1.35rem;
    top: 50%;
    transform: translateY(-65%) rotate(45deg);
    width: 6px;
    height: 10px;
    border: solid #0088FF;
    border-width: 0 2px 2px 0;
}

.filter-input:checked + .filter-label {
    background-color: transparent;
    font-weight: normal;
    color: #333;
}

.tree-input:checked + .tree-child-label {
    background-color: #0E2841;
    color: white;
    font-weight: bold;
}

/* =========================================================== */
/*                      메인 콘텐츠 영역                         */
/* =========================================================== */

.simulation-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    gap: 2rem;
}

.simulation-content {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    height: 100%;
    min-width: 0;
}

.simulation-chartArea {
    flex: 1;
    position: relative;
    /*display: flex;*/
    /*flex-direction: column;*/
    min-width: 800px;
    height: 100%;
}
.simulation-chartContainer{
    flex:1;
    /*width:100%;*/
    /*height:100%;*/
}
.chart-top-items {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    flex-shrink: 0;
    gap: 0.5rem;
}

.chart-download-btn {
    padding: 0.5rem 1.5rem;
    background-color: #0E2841;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.chart-download-btn:hover {
    background-color: #1a3a5c;
}

#simulationChart {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
}

#noDataMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 1.2em;
    display: none;
}
.simulation-annotation{
    min-width: 800px;
}
.simulation-annotation span{
    font-size: 1rem;
}

/* =========================================================== */
/*                         레전드 영역                          */
/* =========================================================== */

.custom-legend-area {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    overflow-y: auto;
    padding-left: 1rem;
}

.custom-legend-area::-webkit-scrollbar {
    width: 6px;
}

.custom-legend-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-legend-area::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.legend-group {
    flex-shrink: 0;
}

.legend-group h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    color: #767676;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.legend-style {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-indicator {
    width: 24px;
    /*height: 12px;*/
    border-radius: 2px;
}

.legend-label {
    font-size: 0.85rem;
    color: #555;
}

.legend-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.legend-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0E2841;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* =========================================================== */
/*                      반응형 디자인                           */
/* =========================================================== */

/*
@media (max-height: 900px) {
    .simulation-container {
        max-height: 700px;
    }
}

@media (max-height: 768px) {
    .simulation-container {
        max-height: 600px;
        min-height: 600px;
    }
}
*/