/* GraphSection Component Styles */
.graph-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 4px 0 #dff4ff;
}

.graph-section .title { 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.graph-section .dateRangeContainer {
    display: flex;
    align-items: center;
    gap: 24px;
}

.graph-section .dateRangeContainer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin: 0;
}

.graph-section.open .dateRangeContainer {
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
    margin: 8px 0;
    /* Ensure overflow is visible when expanded so calendar can show */
    overflow: visible;
}

.graph-section .dateRangeContainer .dateRange {
    font-family: "Metropolis Regular";
    font-size: 17px;
    line-height: 18px;
    letter-spacing: 0.17px;
    color: #4B4A4A;
}

/* Ensure date picker works correctly when container is expanded */
.graph-section .dateRangeContainer .rangedatepicker {
    position: relative;
    z-index: 10;
}

.graph-section .dateRangeContainer .rangedatepicker .dateText {
    border: 1.5px solid var(--date-picker-color, #55BF50);
    position: relative;
    z-index: 11;
}

/* Ensure Flatpickr calendar appears above everything when container is expanded */
.graph-section.open .flatpickr-calendar {
    z-index: 9999 !important;
    position: absolute !important;
    right: 0;
}

.graph-section .title-text {
    font-family: "Metropolis Semi Bold";
    font-size: 20px;
    line-height: normal;
    letter-spacing: 0.3px;
    color: #4B4A4A;
}

.graph-section .reference-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin: 0;
}

.graph-section.open .reference-container {
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
    margin: 8px 0;
}

/* Apply z-index -1 when flatpickr calendar is open with specific classes */
body:has(.flatpickr-calendar.rangeMode.static.arrowTop.arrowCenter.open) .graph-section.open .reference-container {
    z-index: -1;
}

.graph-section .reference-container .title {
    font-family: "Metropolis Semi Bold";
    font-size:17px;
    line-height: normal;
    letter-spacing: 0.17px;
    color: #4B4A4A;
}

.graph-section .reference-container .items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.graph-section .reference-container .items .item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.graph-section .reference-container .items .item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4B4A4A;
}

.graph-section .reference-container .items .item .label {
    font-family: "Metropolis Regular";
    font-size: 17px;
    line-height: normal;
    letter-spacing: 0.17px;
    color: #4B4A4A;
}

.graph-section .reference-container .items .item .dashed {
    width: 40px;
    height: 2px;
    border-top: 5px dashed #4B4A4A;
}

/* action-text Button Styles */
.graph-section .action-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.graph-section .action-text .action-label {
    font-family: "Metropolis Semi Bold";
    font-size: 17px;
    line-height: 18px;
    color: #4B4A4A;
    letter-spacing: 0.17px;
}

.graph-section .action-text .arrow-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='35' height='37' viewBox='0 0 35 35' fill='none'%3E%3Cpath d='M9.06013 12.2686L14.9305 18.0647L20.7266 12.1943' stroke='var(--arrow-color, %231471DB)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: -2px -2px;
    background-size: 40px 40px;
    width: 30px;
    height: 30px;
}

.graph-section .action-text .arrow-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.graph-section.open .action-text .arrow-icon {
    transform: rotate(180deg);
}

.dark .graph-section {
    background-color: #1F2120;
    box-shadow: none;
}

.dark .graph-section .reference-container .title,
.dark .graph-section .reference-container .items .item .label,
.dark .graph-section .action-text .action-label,
.dark .graph-section .title-text,
.dark .rangedatepicker .dateText,
.dark .graph-section .dateRangeContainer .dateRange  {
    color: #fff;
}

.dark .graph-section .reference-container .items .item .label {
    color: #fff;
}

.dark .graph-section .reference-container .items .item .dashed {
    border-top-color: rgba(255, 255, 255, 0.87);
}

@media (max-width: 820px) {
    .graph-section {
        padding: 16px;
    }
    .graph-section .title-text {
        font-size: 18px;
    }
}