.container {
    display: flex;
    width: 1300px;
    margin: 20px auto;
    height: 100vh;
    background-color: #f8fafc;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease;
    gap: 1px;
}
.container:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.chart-section {
    position: fixed;
    width: 900px;
    height: auto;
    max-height: 90vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    resize: both; /* 양방향 리사이즈 가능 */
    min-width: 400px;
    min-height: 300px;
    max-width: 90vw;
    max-height: 90vh;
}
.chart-section.dashboard-chart-section {
    width: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    color: #6b7280;
}
.chart-section:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* 차트 헤더 (드래그 가능 영역) */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f8fafc, #e5e7eb);
    border-bottom: 1px solid #d1d5db;
    border-radius: 8px 8px 0 0;
    cursor: grab;
    user-select: none;
}

.chart-header:active {
    cursor: grabbing;
}

.chart-header .chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

/* 편집 중인 차트 헤더 하이라이트 */
.chart-header-editing {
    background: linear-gradient(to bottom, #dbeafe, #bfdbfe) !important;
    border-bottom: 2px solid #3b82f6 !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
    animation: pulse-highlight 2s ease-in-out infinite;
}

@keyframes pulse-highlight {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(59, 130, 246, 0.5);
    }
}

.chart-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.chart-close-btn:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

/* 차트 내용 영역 */
#chart {
    flex: 1;
    overflow: auto;
    padding: 10px;
}
.panel-section {
    width: 400px;
    height: 100%;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}
.panel-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.saved-charts-section {
    width: 400px;
    height: 100%;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}
.saved-charts-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.saved-charts-section h3 {
    font-size: 1.2em;
    color: #1f2937;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #2563eb;
    font-weight: 600;
}
#savedChartsList {
    flex-grow: 1;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}
#savedChartsList .option {
    padding: 14px;
    margin: 4px 0;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    color: #1f2937;
    display: flex;
    justify-content: space-between;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#savedChartsList .option:hover {
    background-color: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
#savedChartsList .delete-btn {
    color: #ef4444;
    cursor: pointer;
    transition: color 0.2s ease;
}
#savedChartsList .delete-btn:hover {
    color: #b91c1c;
}
#chartAddButton {
    padding: 12px 24px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    align-self: center;
}
#chartAddButton::before {
    content: '+';
    font-size: 1.2em;
    font-weight: bold;
}
#chartAddButton:hover {
    background-color: #1e40af;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
#chartAddButton:active {
    transform: scale(0.95);
    box-shadow: none;
}
#chartTypeModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background-color: #ffffff;
    z-index: 1001;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    transition: opacity 0.3s ease;
}
#chartTypeModal .close {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 20px;
    cursor: pointer;
    color: #4b5563;
    transition: color 0.2s ease;
}
#chartTypeModal .close:hover {
    color: #2563eb;
}
#chartTypeOptions {
    max-height: 200px;
    overflow-y: auto;
}
#chartTypeOptions .option {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1em;
    color: #1f2937;
    transition: background-color 0.2s ease;
}
#chartTypeOptions .option:hover {
    background-color: #eff6ff;
}
.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    background-color: #f8fafc;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}
.tab-button {
    padding: 8px 14px;
    cursor: pointer;
    background-color: #e5e7eb;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
    color: #1f2937;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.tab-button.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.tab-button:hover:not(.active) {
    background-color: #d1d5db;
}
.main-button {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    cursor: pointer;
    background-color: #2563eb;
    color: #ffffff;
    border: 1px solid #1e40af;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.main-button:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
}
.main-button:active {
    transform: translateY(0);
    box-shadow: none;
}
.main-button-icon {
    margin-right: 6px;
}
.tab-content {
    display: none;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}
.tab-content.active {
    display: block;
}
.panel-item {
    margin-bottom: 15px;
    position: relative;
}
.panel-item label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
/*     display: block; */
}
.custom-select {
    position: relative;
    width: 100%;
}
.custom-select input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-sizing: border-box;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234b5563' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #1f2937;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.custom-select input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    outline: none;
}
.modal {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    z-index: 1000;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 6px;
}
.modal-content {
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}
.modal-content input {
    width: calc(100% - 30px);
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    color: #1f2937;
    transition: border-color 0.3s ease;
}
.modal-content input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    outline: none;
}
.modal-content .options {
    max-height: 300px;
    overflow-y: auto;
}
.modal-content .option {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    color: #1f2937;
    transition: background-color 0.2s ease;
}
.modal-content .option:hover {
    background-color: #eff6ff;
}
.modal-content .option.selected {
    background-color: #dbeafe;
    color: #1e40af;
}
.modal-content .close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    cursor: pointer;
    color: #4b5563;
    transition: color 0.2s ease;
}
.modal-content .close:hover {
    color: #2563eb;
}
.modal-content .complete-btn {
    display: block;
    width: 95%;
    padding: 8px;
    margin-top: 12px;
    text-align: center;
    background-color: #2563eb;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.modal-content .complete-btn:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
}
.value-list {
    margin-top: 6px;
    padding: 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: #ffffff;
}
.value-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #f8f8f8;
    margin: 4px 0;
    border-radius: 4px;
}
.value-item .remove-btn {
    margin-left: 6px;
    cursor: pointer;
    color: #ef4444;
    font-size: 12px;
    transition: color 0.2s ease;
}
.value-item .remove-btn:hover {
    color: #b91c1c;
}
.bar {
    transition: opacity 0.3s ease;
}
.bar:hover {
    opacity: 0.85;
}
.label {
    font-size: 12px;
    text-anchor: middle;
    fill: #1f2937;
    font-weight: 500;
}

.axis-label {
    font-size: 14px;
    font-weight: 600;
    fill: #1f2937;
}
.warning {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}
.select-btn {
    padding: 8px 12px;
    background-color: #2563eb;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    margin-top: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.select-btn:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
}
.select-btn.disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: background-color 0.4s ease;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    transition: transform 0.4s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
input:checked + .slider {
    background-color: #2563eb;
}
input:checked + .slider:before {
    transform: translateX(24px);
}
.tooltip {
    position: absolute;
    background-color: #1f2937;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
}
.legend {
    font-size: 12px;
    color: #1f2937;
    font-weight: 500;
}
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.legend-color {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    display: inline-block;
    border-radius: 2px;
}
.grid line {
    stroke: #d1d5db;
    stroke-opacity: 0.7;
    shape-rendering: crispEdges;
}
.grid path {
    stroke-width: 0;
}

/* lineChart.css에서 추가된 스타일 */
.line {
    fill: none;
    stroke-width: 2;
}
.dot {
    stroke: none;
    /*r: 5;*/
}
.dot:hover {
    opacity: 0.8;
}

/* 파이 차트 모드 선택 버튼 */
.mode-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    background-color: #f8fafc;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}

.mode-button {
    padding: 8px 14px;
    cursor: pointer;
    background-color: #e5e7eb;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    color: #1f2937;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.mode-button.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-button:hover:not(.active) {
    background-color: #d1d5db;
}

/* 파이 차트 조각 호버 효과 */
.arc path:hover {
    opacity: 0.8;
}

.arc .label-line {
    display: none;
    stroke: none;
}

/* 히스토그램 */
.section-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.stats-panel {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.chart-title {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
}

.chart-desc {
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.legend-title {
    font-size: 12px;
    font-weight: bold;
}

#overlay-color-modal {
    display: none;
    position: fixed; /* 뷰포트 기준 */
    top: 0; /* JS에서 동적으로 설정 */
    left: 0; /* JS에서 동적으로 설정 */
    width: 250px;
    z-index: 2001; /* 다른 요소 위로 */
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#overlay-color-modal .modal-content {
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    position: relative;
    width: 100%;
    height: 280px;
}

#overlay-color-modal .modal-content .close {
    position: absolute;
    top: -3px;
    right: 5px;
    font-size: 18px;
    cursor: pointer;
    color: #fff;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
    z-index: 1002;
}

#overlay-color-modal .modal-content input[type="color"] {
    position: absolute;
    top: -259px;
    left: 9px;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1001;
}

.color-thumbnail {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: auto;
}


/* 박스플롯 고유 스타일 */
.box {
    stroke: black;
}
.median {
    stroke: black;
    stroke-width: 2;
}
.whisker {
    stroke: black;
}
.outlier {
    fill: red;
    stroke: none;
}

#color-modal {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    z-index: 1000;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
#color-modal .modal-content {
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    position: relative;
    width: 100%;
    height: 280px;
}
#color-modal .modal-content .close {
    position: absolute;
    top: -3px;
    right: 5px;
    font-size: 18px;
    cursor: pointer;
    color: #fff;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
    z-index: 1002;
}
#color-modal .modal-content input[type="color"] {
    position: absolute;
    top: -259px;
    left: 9px;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1001;
}

/* 대시보드 추가 버튼 (하단 고정) */
.fixed-bottom-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 1));
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    margin: 0 -15px -15px -15px;
    border-radius: 0 0 4px 4px;
    backdrop-filter: blur(8px);
    z-index: 10;
}

.dashboard-add-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.dashboard-add-btn:hover:not(:disabled) {
    background: linear-gradient(to right, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.dashboard-add-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.dashboard-add-btn:disabled {
    background: linear-gradient(to right, #9ca3af, #6b7280);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(156, 163, 175, 0.2);
}

.dashboard-add-btn i {
    font-size: 16px;
}

/* 차트 저장 버튼 스타일 (기존) */
#save-chart-btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
/*     width: 100%; */
    text-align: center;
}
#save-chart-btn:hover:not(:disabled) {
    background-color: #d0d0d0;
}
#save-chart-btn:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
}