.cluster-results {
    padding: 0;
    margin: 0;
}

.bar-chart-container {
    margin-top: 20px;
}

.bars-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    gap: 20px;
}

.bar-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar-wrapper {
    width: 100%;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    min-height: 1px;
    border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;
    transition: height 0.3s ease;
}

.count-label {
    margin-bottom: 8px;
    color: var(--color-text-primary);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.category-label {
    margin-top: 8px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-align: center;
    font-weight: 500;
}

.error {
    color: var(--color-error);
    padding: var(--padding-card);
}

.identified-clusters {
    margin-top: 32px;
    padding: 0;
}

.cluster-list-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cluster-list-item:last-child {
    border-bottom: none;
}

.cluster-number {
    color: var(--color-text-secondary );
    font-weight: 500;
}

.cluster-size {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.cluster-item p {
    margin: 5px 0;
}

.cluster-analysis {
    margin-top: 20px;
}

.cluster-analysis h4 {
    margin-bottom: 10px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.cluster-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
    padding: 0;
}

.cluster-toggle {
    width: 100%;
    padding: 12px 12px 0 12px;
    margin-bottom: 4px;
    border: none;
    border-radius: 8px;
    background: var(--card-background);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.cluster-toggle:hover {
    background: var(--hover-background);
}

.cluster-toggle.active {
    border-left: 4px solid var(--accent-color);
}

.cluster-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 0;
}

.cluster-title {
    color: var(--color-text-primary);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background-color: var(--background);
    border: 2px solid var(--toggle-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-handle {
    width: 12px;
    height: 12px;
    background-color: var(--toggle-color);
    border-radius: 50%;
    position: absolute;
    left: 2px;
    top: 2px;
    transition: transform 0.2s ease;
}

.cluster-toggle.expanded .toggle-handle {
    transform: translateX(16px);
}

.cluster-header-left {
    display: flex;
    align-items: center;
}

.cluster-name {
    display: none;
}

.cluster-count {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.cluster-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cluster-toggle.expanded .cluster-details {
    max-height: 5000px;
    overflow: visible;
    border-top: 3px solid rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.cluster-toggle.expanded:hover {
    background: var(--card-background);
}

.cluster-toggle:not(.expanded):hover {
    background: var(--hover-background);
}

.cluster-toggle.expanded {
    padding-bottom: 0;
}

.cluster-stats {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    padding: 0;
    font-weight: 500;
}

.cluster-stats p {
    margin: 4px 0;
}

.cluster-item[data-cluster-id="${activeClusterId}"] {
    display: flex;
}

.cluster-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin-bottom: 4px;
}

.cluster-bar-container {
    width: 100%;
    padding: 0;
    margin: 4px 0;
    overflow: visible;
    height: 24px;
}

.cluster-chart {
    width: 100%;
    height: 24px;
    position: relative;
    overflow: visible !important;
}

.cluster-chart canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
    position: relative;
}

.cluster-visualization {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
}

.cluster-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    padding-left: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    position: relative;
}

.legend-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.cluster-toggle:last-child {
    border-bottom: none;
}

.select-cluster-button {
    display: none;
}

/* Add font-weight to headings */
.identified-clusters h4 {
    font-weight: 500;
}

.main-title {
    font-size: var(--font-size-main);
    color: var(--color-text-primary);
    font-weight: 500;
    margin-bottom: 16px;
}

.section-title {
    font-size: var(--font-size-main);
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.info-label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.info-value {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

/* Remove old styles */
.cluster-analysis h4,
.identified-clusters h4 {
    font-weight: 500;
}

.general-info {
    margin-bottom: 20px;
}

/* Simplify the popup styling to match mobility analysis */
.legend-popup {
    position: absolute;
    background: var(--color-background);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    color: var(--color-text-primary);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    box-shadow: var(--shadow-elevation-medium);
    overflow: hidden;
}

.legend-item:hover .legend-popup {
    visibility: visible;
    opacity: 1;
    overflow: hidden;
    border-radius: 20px;
}

/* Ensure all parent containers allow overflow */
.content-section-content,
.cluster-results,
.cluster-visualization,
.cluster-chart,
.cluster-legend,
.legend-item,
.legend-item-content {
    overflow: visible !important;
}
