@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&family=Shippori+Mincho+B1&display=swap');

:root {
    --bg: #DEDEDE;
    --bg-dark: white;
    --bg-border: rgb(245, 245, 245);
    --bg-red: white;
    --text: black;
    --text-muted: black;
    --text-label: rgb(109, 109, 109);
    --blue: #006894;
    --red: #B02E01;
    --green: #0b652e;
    --purple: #8E6A90;
    --gold: #FFB300;
    --republican: var(--red);
    --democrat: var(--blue);
    --independent: color-mix(in srgb, var(--purple), black 25%);
    --hover: var(--blue);
    --btn-bg: color-mix(in srgb, var(--blue), black 30%);
    --btn-border: rgb(47, 47, 47);
    --nav-bg: #f8f8f8;
    --box-shadow: #cecece;
}

body {
    /* min-height: 100vh; */
    height: 100vh;
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text);
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    /* display: flex;
    flex-direction: column; */
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

button {
    box-shadow: none;
    text-decoration: none;
    border: none;
    font-weight: bold;
    background-color: var(--btn-bg);
    color: var(--bg);
}

input[type="submit"] {
    background-color: var(--green);
    color: var(--bg);
    font-weight: bold;
}

button:hover:not(.disabled) {
    background-color: color-mix(in srgb, var(--btn-bg), black 30%);
}

.disabled {
    filter: grayscale(1);
}

input[type="submit"]:hover {
    background-color: color-mix(in srgb, var(--green), black 30%);
    /* background-color: var(--hover); */
}

.Republican {
    color: var(--republican);
}

.Democrat {
    color: var(--democrat);
}

.Independent {
    color: var(--independent);
}

.party-fill {
    color: var(--bg-dark);
}

.party-fill.Republican {
    background-color: var(--republican);
}

.party-fill.Democrat {
    background-color: var(--democrat);
}

.party-fill.Independent {
    background-color: var(--independent);
}

.party-fill.Republican:hover {
    background-color: color-mix(in srgb, var(--republican), black 30%);
}

.party-fill.Democrat:hover {
    background-color: color-mix(in srgb, var(--democrat), black 30%);
}

.party-fill.Independent:hover {
    background-color: color-mix(in srgb, var(--independent), black 30%);
}

.round-button {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: none;
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.button-icon {
    fill: var(--bg);
    width: 75%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
}

.button-icon-height {
    fill: var(--bg);
    height: 75%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
}

.button-icon-small {
    fill: var(--bg);
    width: 60%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
}

.ongoing, tr.speaker.ongoing {
    animation: color-flash 1s infinite;
    font-weight: bold;
}

.ongoing {
    animation: color-flash 1s infinite;
    font-weight: bold;
}

.hidden {
    display: none;
}

@keyframes bg-color-flash {
    50% { background-color: var(--red) }
}

@keyframes color-flash {
    50% { color: var(--red) }
}

tr.speaker.ongoing {
    td {
        animation: bg-color-flash 1s infinite;
    }
}

.ongoing-button {
  animation: bg-color-flash 1s infinite;
}

article.small-overlay {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    z-index: 199999;
    width: 40rem;
    background-color: var(--bg-dark);
    color: var(--text);
    padding: 1.75rem;
    border: 1px solid var(--bg);
    box-shadow: 8px 8px 0 var(--box-shadow);
    overflow: hidden;
    button#close {
        position: absolute;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        top: 1.75rem;
        right: 1.75rem;
        width: 2.5rem;
        aspect-ratio: 1 / 1;
        border-radius: 25%;
        font-size: 3.5rem;
        line-height: 1;
    }
    h1 {
        margin-top: 0;
        padding-top: 0;
    }
}

article.overlay {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    justify-content: center;
    align-items: center;
    position: absolute;
    z-index: 99999;
    width: calc(100% - 8rem);
    height: calc(100% - 8rem);
    background-color: var(--bg-dark);
    color: var(--text);
    padding: 1.75rem;
    border: 1px solid var(--bg);
    box-shadow: 8px 8px 0 var(--box-shadow);
    overflow: hidden;
    button#close {
        position: absolute;
        display: flex;
        justify-content: center;
        align-items: center;
        top: 1.75rem;
        left: 1.75rem;
        width: 3.5rem;
        aspect-ratio: 1 / 1;
        border-radius: 25%;
        font-size: 3.5rem;
        line-height: 1;
    }

    button#go-back {
        position: absolute;
        display: flex;
        justify-content: center;
        align-items: center;
        top: 1.75rem;
        left: 6.25rem;
        width: 3.5rem;
        aspect-ratio: 1 / 1;
        border-radius: 25%;
        font-size: 3.5rem;
        line-height: 1;
    }
    button.aside-btn {
        width: 100%;
        box-sizing: border-box;
        padding: 1rem;
        font-size: 1.25rem;
        font-weight: bold;
        margin: 0;
        margin-top: 1rem;
        margin-right: 1rem;
        border-radius: 0.5rem;
        cursor: pointer;
    }
    h1 {
        margin: 0;
        font-size: 2.5rem;
        text-align: center;
        width: 100%;
    }
    aside {
        height: 100%;
        min-width: 25%;
        max-width: 25%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    div#right-panel {
        flex-grow: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: start;
        align-items: center;
        padding-bottom: 1rem;
        border-left: 1px solid var(--text);
        padding-left: 0.5rem;
        margin-left: 0.5rem;
        form {
            display: flex;
            width: 100%;
            height: 100%;
            padding-left: 0.5rem;
            box-sizing: border-box;
        }
        nav#view-nav {
            margin-left: -0.5rem;
            width: calc(100% + 0.5rem);
            display: flex;
            flex-direction: row;
            margin-bottom: 1rem;

            button {
                box-sizing: border-box;
                background-color: var(--bg-border);
                color: var(--text-label);
                border: 1px solid var(--text);
                border-top: 0;
                padding: 1rem;
                flex: 1 1 0;
                font-size: 1rem;

                p.small-end {
                    font-size: 0.8em;
                    line-height: 0.8em;
                    font-weight: lighter;
                    font-style: italic;
                    padding: 0;
                    margin: 0;
                }
            }

            button#add-btn {
                flex: 0 0 auto;
                width: auto;
                aspect-ratio: 1 / 1;
                padding: 0;

                .button-icon {
                    width: 2rem;
                    color: var(--text-label);
                }
            }

            button#add-btn:hover {
                background-color: var(--btn-bg);
                cursor: pointer;
                .button-icon {
                    color: var(--bg-dark);
                }
            }

            button:first-child {
                border-left: 0;
            }

            button:not(:last-child) {
                border-right: 0;
            }

            button:hover:not(#add-btn),
            button.active {
                box-sizing: border-box;
                border-bottom: 0.5rem solid var(--gold);
            }
        }
    }
    form {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        font-size: 1.5rem;
        gap: 1rem;
        span {
            width: 100%;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            gap: 0.5rem;

            label {
                color: var(--text);
            }
            input,
            select,
            ::picker(select) {
                width: 75%;
                padding: 0.5rem;
                padding-left: 2rem;
                margin: 0;
                background-color: var(--bg);
                color: var(--text);
                box-shadow: none;
                border: none;
                border-radius: 0.5em;
                font-size: 1rem;
                box-sizing: border-box;
            }

            select,
            ::picker(select) {
                /* font-size: 1.5rem; */
                appearance: base-select;
            }

            ::picker(select) {
                line-height: 2rem;
                padding-left: 0.5rem !important;
            }

            input[type="submit"] {
                width: 100%;
                font-size: 2rem;
                padding: 1rem;
                background-color: var(--green);
                color: var(--bg);
                /* font-weight: bold; */
            }

            input[type="submit"]:hover {
                background-color: color-mix(in srgb, var(--green), black 30%);
            }
        }
    }
}

.backdrop {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.25);
}

.large-subtitle {
    margin: 0;
    font-size: 2rem;
    text-align: center;
    width: 100%;
}

@media screen and (max-width: 768px) {
    article.small-overlay {
        width: 100%;
        height: 100%;
        margin: 0;
        box-shadow: none;
        border: 0;
        button#close {
            top: 1rem;
            right: 1rem;
            padding: 0.1rem;
        }
    }
    article.overlay {
        width: 100%;
        height: 100%;
        flex-direction: column;
        box-shadow: none;
        border: 0;
        button#close {
            top: 2.5rem;
            right: 2.5rem;
            left: auto;
            font-size: 2.5rem;
            width: 2.5rem;
            padding: 0.1rem;
        }
        button.aside-btn {
            border-radius: 0rem;
            margin-right: 0;
        }
        aside {
            border-right: none;
            height: fit-content;
            box-sizing: border-box;
            min-width: 100%;
            max-width: 100%;
            & > :last-child:not(button) {
                margin-bottom: 1rem;
            }
            h1 {
                margin-top: 1rem;
                font-size: 2rem;
            }
            .large-subtitle {
                margin: 0;
                font-size: 1.5rem;
                text-align: center;
                width: 100%;
            }
        }
        div#right-panel {
            width: 100%;
            box-sizing: border-box;
            overflow-x: hidden;
            padding-left: 0;
            margin-left: 0;
            border-left: 0;
            padding-right: 0;
            margin-right: 0;
            overflow-y: auto;
            nav#view-nav {
                margin-left: 0;
                width: 100%;
                margin-right: 0;
                padding-left: 0;
                padding-right: 0;

                button {
                    padding: 0.5rem;
                }

                button.active {
                    border-top: 0;
                }
            }
        }
    }
}