* {
    font-family: sans-serif;
}

:root {
    --sidebar-background-default: #B7094C;
    --sidebar-text-default: white;
    --sidebar-button-toggle-icon-hover-default: #5E548E;
    --sidebar-button-link-hover-default: #892B64;
    --sidebar-button-link-active-default: #A01A58;
    
    --sidebar-background-alternate: #3A4454;
    --sidebar-text-alternate: white;
    --sidebar-button-toggle-icon-hover-alternate: #53687E;
    --sidebar-button-link-hover-alternate: #53687E;
    --sidebar-button-link-active-alternate: #63768A;
}

body {
    width: 100%;
    flex-direction: row;
}

a.inline, a.inline:visited {
    color: var(--sidebar-button-link-hover-default);
    display: inline-block;
}

a.inline:hover, a.inline:active {
    color: var(--sidebar-button-link-active-alternate);
}

.sidebar {
    background: var(--sidebar-background-default);
    position: sticky;
    height: 100dvh;
    top: 0;
    
    div {
        width: 200px;
        transition: opacity 0.2s, width 0.2s;
        height: 100%;
        color: var(--sidebar-text-default);
        
        div.hidden {
            opacity: 0;
            height: auto;
            width: 70px;
            transition: opacity 0.2s, width 0.2s;
            
            a {
                pointer-events: none;
            }
        }
        
        div {
            overflow: hidden;
            height: auto;
            
            a {
                pointer-events: auto;
            }
        }
    }

    div.collapse {
        width: 70px;
    }

    button.toggle-icon {
        width: 70px;
        height: 70px;
        text-align: center;
        align-content: center;
        transition: 0.2s;
        justify-self: end;
        font-size: 2.2em;
    }

    button.toggle-icon:hover {
        background: var(--sidebar-button-toggle-icon-hover-default);
    }

    a {
        width: 100%;
        height: 50px;
        align-content: center;
        text-align: center;
        transition: 0.2s;
    }

    a:hover {
        background: var(--sidebar-button-link-hover-default);
    }

    a.active {
        background: var(--sidebar-button-link-active-default);
    }
}

@media (max-width: 1023px) {
    .sidebar {
        div {
            
        }
    }
}

.sidebar.alternate {
    background: var(--sidebar-background-alternate);

    div {
        color: var(--sidebar-text-alternate);
    }

    button.toggle-icon:hover {
        background: var(--sidebar-button-toggle-icon-hover-alternate);
    }

    a:hover {
        background: var(--sidebar-button-link-hover-alternate);
    }

    a.active {
        background: var(--sidebar-button-link-active-alternate);
    }
}

.sidebar.mirror {
    button.toggle-icon {
        justify-self: start;
        direction: rtl;
    }
}

.information-panel {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    color: white;
    height: 100%;
    transition-duration: 0.2s;
    transition-property: padding, background, width;
    width: 64px;
    background: transparent;
    overflow-x: hidden;
    padding: 10px 0 0 0;

    button {
        height: 40px;
        width: 40px;
        text-align: center;
        align-content: center;
        border: 2px solid var(--sidebar-background-default);
        border-radius: 50%;
        margin: 10px;
        font-size: 1.2em;
        color: var(--sidebar-background-default);
        transition: color, border-color 0.2s;
        position: absolute;
        left: 0;
        top: 0;
        background: white;
    }

    button:hover {
        color: white;
        background: var(--sidebar-background-default);
    }

    button.active {
        color: white;
        border-color: white;
        margin: 10px 0 0 10px;
        background: transparent;
        font-size: 1em;
    }

    button.active:hover {
        background: white;
        color: var(--sidebar-background-default);
    }

    .content {
        width: 0;
        overflow: hidden;
        transition: all 0.2s;

        h1 {
            margin-bottom: 20px;
            margin-left: 53px;
            padding-top: 3px;
        }

        p {
            margin-bottom: 20px;
        }

        a.inline, a.inline:visited {
            border: 2px solid white;
            padding: 10px 0;width: 100%;
            text-align: center;
            color: white;
            font-weight: 600;
        }

        a.inline:hover, a.inline:active {
            background: white;
            color: var(--sidebar-background-default);
        }
    }
}

.information-panel.active {
    padding: 10px 20px 0 20px;
    background: var(--sidebar-background-default);
    box-shadow: -2px 0 7px 2px rgba(0,0,0,0.5);
    width: 400px;

    .content {
        width: 360px;
    }
}

main {
    min-height: 100dvh;
    width: 100%;
}

.page-wrapper {
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: end;
}

.error-wrapper {
    height: 100%;
    align-content: center;
    text-align: center;
}

.home-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 40px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.local-storage-wrapper {
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

.stats {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 14px;

    p {
        margin-bottom: 10px;
    }

    button {
        display: inline-block;
        padding: 10px 5px;
        border:  1px solid black;
        width: 100px;
        text-align: center;
        margin: 0 5px;
    }
    
    button:hover {
        background: aliceblue;
    }

    button:first-of-type {
        margin-left: 0;
    }
}

.ball {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #0ff, #08f);
    box-shadow: 0 0 10px rgba(0,255,255,0.6);
}

.controls, .results {
    align-content: center;
    width: 50%;
    padding: 0 40px;
}

.controls > div {
    width: 100%;
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
    justify-content: end;
    flex-wrap: wrap;
}

.controls > div > div {
    display: flex;
    gap: 10px;
}

.controls label {
    align-content: center;
    margin-left: 20px;
}

.controls textarea {
    min-width: 147px;
    font-size: 1em;
    align-content: center;
    padding-left: 10px;
}

.controls button {
    display: inline-block;
    border:  1px solid black;
    border-radius: 3px;
    padding: 10px 10px 8px 10px;
    min-width: 100%;
    text-align: center;
    background: darkorange;
}

.results p {
    overflow-wrap: anywhere;
}

@media (max-width: 850px) {
    .local-storage-wrapper {
        flex-direction: column;
        justify-content: start;
        padding-top: 40px;
    }

    .controls, .results {
        align-content: center;
        width: auto;
        justify-content: start;
        padding: 0 40px;
    }
}