:root {
    --bar-border-radius: 8px;
    --red-gradient: linear-gradient(to top, rgba(254, 14, 14, 0) 0%, rgba(254, 14, 14, 1) 100%);
}


/* ChartColumn Component */
.chart-column {
    background-color: #ffffff;
    border: 1px solid rgba(205, 210, 228, 0.66);
    border-radius: 24px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 17px;
    width: 100%;
    position: relative;
    min-height: 389px;
}

/* Header Section */
.chart-column__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.chart-column__title {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: normal;
    color: #304261;
    margin: 0;
}

.chart-column__info-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chart-column__info-btn:hover {
    opacity: 0.7;
}

.chart-column__info-icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* Content Section */
.chart-column__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.chart-column__subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: normal;
    color: #304261;
    text-align: center;
    margin: 0;
    width: 100%;
}

/* Chart Container */
.chart-column__chart {
    display: flex;
    width: 100%;
    gap: 12px;
}

/* Y-Axis Scale */
.chart-column__y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    width: 32px;
    flex-shrink: 0;
    padding-bottom: 100px; /* Item labels (may wrap) + group labels */
}

.chart-column__y-label {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 10px;
    line-height: 15px;
    color: #304261;
    text-align: right;
}

/* Chart Area */
.chart-column__chart-area {
    flex: 1;
    position: relative;
    min-height: 280px;
}

/* Grid Lines */
.chart-column__grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 100px; /* Item labels (may wrap) + group labels */
    pointer-events: none;
}

.chart-column__grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed rgba(205, 210, 228, 0.8);
    z-index: 1;
}

/* Groups Container */
.chart-column__groups {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Individual Group */
.chart-column__group {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Group Background */
.chart-column__group-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    /* Only clear the group title row; item labels stay inside the tinted area */
    bottom: 56px;
    border-radius: 15px;
    z-index: 0;
    transition: opacity 0.4s ease-in-out;
    height: 217px;
}

/* Group Bars Container */
.chart-column__group-bars {
    flex: 1;
    display: flex;
    justify-content: space-evenly;
    /* flex-start: bar wrappers share the same top edge when item labels wrap to different heights */
    align-items: flex-start;
    padding: 0 8px;
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}

/* Group Label */
.chart-column__group-label {
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: normal;
    color: #304261;
    text-align: center;
    padding-top: 29px;
    height: 44px;
    flex-shrink: 0;
}

/* Bar Container — equal share of group width so labels wrap in-column */
.chart-column__bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}

/* Bar Value (above the bar) */
.chart-column__bar-value {
    position: absolute;
    top: -26px;
    left: 0;
    right: 0;
    bottom: 0;

    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: normal;
    color: #304261;
    text-align: center;
    min-height: 14px;
    margin: 0 auto;
    transition: opacity 0.4s ease-in-out;
}

/* Bar Wrapper - fixed height container for percentage-based bar height */
.chart-column__bar-wrapper {
    position: relative;
    width: 50px;
    /* height: 180px; Fixed height for the bar area */
    height: 224px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    justify-content: flex-end;
    padding-bottom: 7px;
}

/* The Bar itself */
.chart-column__bar {
    position: relative;
    width: 50px;
    background-color: #bac1d9;
    border-top-left-radius: var(--bar-border-radius);
    border-top-right-radius: var(--bar-border-radius);
    min-height: 4px;
    transition: height 0.4s ease-in-out;
}

/* Highlighted Bar (above threshold) */
.chart-column__bar--highlighted {
    border: 2px solid transparent;
    border-bottom: none;
    box-sizing: border-box;
    background-color: #bac1d9;
    background-clip: padding-box;
    position: relative;
}

.chart-column__bar--highlighted::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: calc(var(--bar-border-radius) - 2px);
    padding: 2px;
    background: var(--red-gradient);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Bar Label (below the bar) — in-flow, wraps within column */
.chart-column__bar-label {
    height: 26px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 2px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 10px;
    line-height: 1.3;
    color: #304261;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    flex-shrink: 0;
}

/* No Data State (aligned with summary component) */
.chart-column__subtitle,
.chart-column__chart {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.chart-column.is-no-data .chart-column__subtitle,
.chart-column.is-no-data .chart-column__chart {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Fill space below header and vertically center the empty state in the card */
.chart-column.is-no-data .chart-column__content {
    flex: 1;
    justify-content: center;
    min-height: 0;
}

.chart-column__no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
    animation: chart-column-no-data-appear 0.4s ease-out forwards;
}

.chart-column__no-data-icon {
    color: #9CA3AF;
    opacity: 0;
    transform: scale(0.8);
    animation: chart-column-no-data-icon-appear 0.4s ease-out 0.1s forwards;
}

.chart-column__no-data-text {
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    opacity: 0;
    transform: translateY(8px);
    animation: chart-column-no-data-text-appear 0.4s ease-out 0.2s forwards;
}

@keyframes chart-column-no-data-appear {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes chart-column-no-data-icon-appear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes chart-column-no-data-text-appear {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-column {
        padding: 16px;
    }

    .chart-column__groups {
        flex-wrap: wrap;
    }

    .chart-column__group {
        min-width: 100%;
        margin-bottom: 20px;
    }

    .chart-column__group:last-child {
        margin-bottom: 0;
    }

    .chart-column__group-bars {
        flex-wrap: nowrap;
        gap: 16px;
    }

    .chart-column__bar-container {
        /* flex: 0 0 calc(50% - 8px); */
    }

    .chart-column__y-axis {
        display: none;
    }

    .chart-column__chart-area {
        min-height: auto;
    }

    .chart-column__grid {
        display: none;
    }
}

