/* Reset CSS to avoid inheritance issues */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter Tight", "Jost", Helvetica, Arial, sans-serif;
    background-color: #ffffff;
}

.chart-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.chart-wrapper svg {
    background-color: transparent;
    border-radius: 0 30px 30px 30px;
}

/* axis */
.domain {
    stroke: #333;
}

/* Hide x-axis domain line */
.x-axis .domain {
    display: none;
}

/* Hide x-axis tick lines */
.x-axis .tick line {
    display: none;
}

.tick line {
    /* stroke color set dynamically in JavaScript based on fund hlines */
    stroke-width: 1.5px;
}

.tick text {
    fill: #656565;
}

/* line */
g.series circle {
    stroke: none;
    opacity: 0.3;
}

g.series path {
    fill: none;
    stroke-width:2px;
}

/* chart-card
.card-wrapper {
    display: flex;
    flex: 0 0 50%;
    justify-content: space-between;
    font-size: 40px;
    padding-left: 20px;
    padding-right: 20px;
} */

/* Content wrapper - holds headline and legend side by side on desktop */
.content-wrapper {
    max-width: 1400px;
    margin: 0 auto 24px auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

/* Headline section */
.headline-wrapper {
    flex: 1;
    position: relative;
}

.fundinfo {
    font-family: "Inter Tight", "Jost", Sans-serif;
    font-size: 32px;
    font-weight: 400; /* 500 is according to design */
    color: #121212;
    margin-bottom: 16px;
    line-height: 1.2;
}

.funddesc {
    font-family: "Inter Tight", "Jost", Sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
    color: #656565;
    margin-bottom: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0));
    padding: 8px 0 40px 0;
    pointer-events: none;
}

/* Legend section with performance numbers */
.legend-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-shrink: 0;
}

.legend-item {
    display: grid;
    grid-template-columns: 12px auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 4px;
    align-items: start;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    grid-column: 1;
    grid-row: 1;
}

.legend-name {
    font-family: "Inter Tight", "Jost", Sans-serif;
    font-size: 14.4px;
    font-weight: 400;
    color: #656565;
    line-height: 1.2;
    grid-column: 2;
    grid-row: 1;
}

.legend-value {
    font-family: "Inter Tight", "Jost", Sans-serif;
    font-size: 28px;
    font-weight: 400; /* 500 is according to design */
    color: #121212;
    line-height: 1.2;
    grid-column: 1 / 3;
    grid-row: 2;
}

.datefield {
    font-family: "Inter Tight", "Jost", Sans-serif;
    font-size: 14px;
    color: #656565;
    text-align: center;
    margin-top: 16px;
}

.menu-wrapper{
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 24px;
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 20px;
    justify-content: flex-start;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chart-menu-container {
    flex: 1 1 0;
    min-width: 120px;
    display: flex;
}

.chart-menu {
    font-family: "Inter Tight", "Jost", Sans-serif;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 200;
    line-height: 1.4;
    color: #4195E9;
    text-align: center;
    background-color: #EDF6FF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    word-wrap: break-word;
}

.chart-menu:hover{
    background-color: #D8EBFF;
}

.highlight,
.chart-menu.highlight{
    background-color: #4195E9;
    color: #ffffff;
    font-weight: 200;
}

.chart-menu.highlight:hover{
    background-color: #2E7FD1;
}


/* add media query for growing and shrinking */
@media (max-width: 1100px) {

}

@media (max-width: 800px) {
    .menu-wrapper{
        margin-bottom: 12px;
        margin-left: 12px;
        margin-right: 12px;
    }
    
    .chart-menu{
        font-size: 14.14px;
        line-height: 20px;
        font-weight: 200;
        padding: 6px 12px;
        border-radius: 10px;
        min-height: 36px;
    }
    
    .chart-menu-container{
        flex: 1 1 0;
        min-width: 100px;
    }
    
    .content-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 0 12px;
    }
    
    .fundinfo {
        font-size: 26px;
        margin-bottom: 8px;
    }
    
    .funddesc {
        font-size: 14px;
        /* Revert overlay on mobile - use normal flow */
        position: static;
        background: none;
        padding: 0;
        pointer-events: auto;
    }
    
    .legend-wrapper {
        gap: 32px;
    }
    
    .legend-value {
        font-size: 24px;
    }
    
    .datefield {
        font-size: 12px;
        margin-top: 12px;
    }
    
    .chart-wrapper {
        padding: 0 12px;
    }
    
    .chart-wrapper svg {
        background-color: transparent;
        border-radius: 0 20px 20px 20px;
    }
}
@media (max-width: 570px) {
    .chart-menu-container{
        min-width: 60px;
    }
    .menu-wrapper{
        margin-left: 8px;
        margin-right: 8px;
    }
    .chart-menu{
        padding: 6px 8px;
        font-size: 12px;
        line-height: 15px;
        min-height: 32px;
    }
    
    .content-wrapper {
        padding: 0 8px;
    }
    g.series path {
        fill: none;
        stroke-width:1.5px;
    }
    
    .fundinfo {
        font-size: 22px;
    }
    
    .funddesc {
        font-size: 13px;
        /* Revert overlay on mobile - use normal flow */
        position: static;
        background: none;
        padding: 0;
        pointer-events: auto;
    }
    
    .legend-wrapper {
        gap: 24px;
    }
    
    .legend-value {
        font-size: 22px;
    }
    
    .legend-name {
        font-size: 13px;
    }
    
    .datefield {
        font-size: 11px;
        display: none;
    }
    
    .chart-wrapper {
        padding: 0 8px;
    }
}

