@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,300..800;1,300..800&display=swap');

#dominance-chart-container {
    position: relative;
    max-width: 850px;
    width: 100%;
    /*height: 540px;*/
    box-sizing: border-box;
    padding: 24px;
    border: 1px solid #e8e8e8;
    border-bottom-width: 8px;
    background-color: #ffffff;
    font-family: 'Noto Sans', sans-serif;
    overflow: hidden;
    container-type: inline-size;
    container-name: widget;
}

/* Chart Title */
.cdp-chart-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
}

.cdp-chart-title img {
    width: 25px;
    height: auto;
    margin-right: 7px;
    transform: translateY(-2px);
}

/* Button bar (Desktop) */
#dominance-buttons {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
    justify-content: center;
    border-bottom: 1px solid #dfeff6;
}

/* Buttons */
.dominance-button {
    height: 36px;
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    /*padding: 0px 12px 2px 12px;*/
    padding: 2px 9px;
    color: #211b2e;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.3s, border-bottom-color 0.3s;
    background-color: transparent !important;
    border: none;
    border-bottom-width: 4px;
    border-bottom-style: solid;
    border-bottom-color: transparent;
    border-radius: 0;
    appearance: none;
    outline: none;
}

.dominance-button:hover {
    color: #888;
    background-color: transparent !important;
}

.dominance-button--active {
    color: #211b2e !important;
    border-bottom-color: #888;
}

.cdp-chart-holder {
    width: 100%;
    /* margin-top: 50px;  */
}

@container widget (max-width: 849px) {

    .cdp-chart-holder {
        overflow-x: auto;
        height: calc(450px + 4px); /* value applied from js to child */
    }

    /* webkit - chrome, safari, opera */
    .cdp-chart-holder::-webkit-scrollbar {
        height: 4px;
    }

    .cdp-chart-holder::-webkit-scrollbar-track {
        background: #e8e8e8;
    }

    .cdp-chart-holder::-webkit-scrollbar-thumb {
        background-color: #cccccc;
        border-radius: 0;
        border: none;
        transition: background-color 0.3s ease-in-out;
    }

    .cdp-chart-holder::-webkit-scrollbar-thumb:hover {
        background: #000000;
    }
}

#dominance-chart {
    width: 800px !important;
    height: 450px !important;
    margin: 0 auto;
    overflow: hidden;
}

#dominance-chart > div:not(.cdp-tooltip) {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive - Tablet/Mobile */
@media only screen and (max-width: 768px) {

    #dominance-chart-container {
        padding: 14px;
        /*height: 570px;*/
    }

    .cdp-chart-holder {
        margin-top: 20px;
        overflow-x: scroll;
    }

    /* Move buttons below title or just remove absolute positioning */
    #dominance-buttons {
        position: static;
        margin-top: 8px;
        justify-content: space-between;
    }

    /*#dominance-chart {*/
    /*    height: 350px;*/
    /*}*/
}

.cdp-tooltip > div {
    display: flex !important;
    flex-direction: column;
    gap: 7px;
}
