:root {
    color-scheme: light dark;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins';
    color: light-dark(black, white);
    text-align: center;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

h2 {
    margin-top: 20px;
}

.container {
    display: flex;
    flex-direction: column;
    row-gap: 50px;
    position: relative;
    width: 100%;
    padding: 2%;
}

.topic-explorer {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
}

.titles {
    position: absolute;
    left: 5%;
    display: flex;
    flex-direction: column;
    align-items: start;
    text-align: left;
}

.titles h1 {
    margin: 0;
    font-size: clamp(2em, 5vw, 3em);
}

.titles p {
    width: 20%;
    padding-left: 5px;
    font-size: clamp(0.75em, 1.2vw, 1.5em);
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1600px;
    height: auto;
    transition: transform 0.5s ease-in-out;
}

.chart-container.shift {
    transform: translateX(-20%);
}

.chart {
    position: relative;
    width: 100%;
    height: auto;
}

.center-text {
    position: absolute;
    width: 80%;
    max-width: 200px;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.center-text h2 {
    font-size: clamp(0.5em, 2vw, 2em);
}

.center-text p {
    font-size: clamp(0.25em, 1vw, 1.2em);
}

.center-text-small {
    width: 100%;
    max-width: 0;
    align-items: center;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    visibility: hidden;
}

.center-text-small h2 {
    margin: 0;
}

.center-text-small p {
    margin: 0;
}

#undo {
    color: light-dark(grey, rgb(184, 183, 183));
    visibility: hidden;
}

.info-container {
    position: absolute;
    top: 10%;
    right: -100%;
    width: 45%;
    max-width: 30vw;
    height: auto;
    align-content: start;
    visibility: hidden;
    text-align: left;
    padding: 20px;
    overflow-y: auto;
    transition: all 0.5s ease-in-out;
}

.info-container.visible {
    right: 5%;
    visibility: visible;
}

.ex-prompt-container {
    max-height: 38vw;
    overflow-y: auto;
    padding: 10px;
    background-color: light-dark(white, #333);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.example-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.example-item {
    background-color: light-dark(#f9f9f9, #555);
    border: 1px solid light-dark(#ddd, #666);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    font-size: clamp(0.8em, 1vw, 1.2em);
}

@media screen and (min-width: 768px) {
    .center-text-small {
        max-width: 0;
        max-height: 0;
        visibility: hidden;
    }
}

@media screen and (max-width: 768px) {
    .topic-explorer {
        flex-direction: column;
        align-items: center;
    }

    .info-container {
        width: 100%;
        max-width: 95vw;
        align-items: center;
        text-align: center;
        position: relative;
        display: flex;
        flex-direction: column;
    }

    .info-container.visible {
        right: 0;
        padding-top: 0;
        visibility: visible;
    }

    .info-container h2 {
        margin: 0;
    }
    
    .info-container p {
        margin: 0;
    }

    .ex-prompt-container {
        margin-top: 5vw;
        max-height: 100vw;
        max-width: 95vw;
        overflow-x: hidden;
    }

    .titles {
        position: relative;
        top: auto;
        left: auto;
        width: 80%;
        align-items: center;
        text-align: center;
        padding-top: 5%;
    }

    .titles p {
        width: 100%;
    }

    .center-text {
        max-width: 100px;
    }

    .chart-container {
        max-width: 1000px;
    }

    .chart-container.shift {
        transform: translateX(0%);
    }
}