
:root {
    --header-bg: #1e293b;
    --header-text: #fff;
    --footer-bg: #1e293b;
    --footer-text: #fff;
    --main-bg: #fff;
    --main-text: #222;
    --divider-h: 40px;
}

body {
    font-family: "Century Gothic";
    margin: 0;
    padding: 0;
    background-color: #3c3c3c;

    application {
        max-width: 600px;
        margin: 0 auto;
        background-color: white;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        height: 100vh;
        position: relative;

        header {
            background-color: var(--header-bg);
            color: var(--header-text);
            & > svg.divider {
                display: none;
                height: var(--divider-h);
                line-height: 0;
                margin: 0;
                pointer-events: none;
                width: 100%;
            }
            
            span {
                display: flex;
                flex-direction: column;

                img {
                    display: none;
                    height: 100px;
                    margin: 0.5rem auto;
                    vertical-align: middle;
                }

                h2 {
                    display: flex;
                    gap: 0.5rem;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    margin: 0.75rem;
                    font-weight: normal;
                    align-items: center;

                    svg { cursor: pointer; }
                }
            }
        }

        main {
            flex: 1 1 auto;
            overflow-y: auto;
            

            .List {
                
                &.List--grid {
                    display: grid;
                    grid-template-columns: repeat(3, 1fr);
                    gap: 1rem;
                    padding: 1rem;

                    .List__Item {
                        display: flex;
                        flex-direction: column;
                        gap: 0.5rem;
                        border-bottom: 0px solid transparent;
                        padding: 0rem;
            
                        h3 {
                                font-size: 1.25rem;
                                text-align: center;
                                width: 100%;
                                word-break: break-word;
                                margin: 0.5rem 0;
                                padding: 0;
                        }

                        span {
                            display: block;
                            width: 100%;
                            height: auto;
                            aspect-ratio: 1 / 1;
                            background-color: #336799;
                            border-radius: 0.5rem;
                            position: relative;
                            overflow: hidden;
                            background-size: cover;
                            background-image: var(--image);
                            background-position: center;
                        }

                        & > svg {
                            display: none;
                        }

                        text-decoration: none;
                        color: inherit;
                    }

                    .List__Item span::before {
                                                font-size: 6rem;
                    }
                }  
                
                    .List__Item span::before {
                        content: var(--icon, '');
                        font-family: "Material Symbols Outlined";
                        font-size: 2rem;
                        color: white;
                        text-align: center;
                        line-height: 2rem;
                        pointer-events: none;
                        font-weight: 100;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        inset: 0;

                        position: absolute;
                    }

                
                .List--empty {
                    display: none!important;
                }
                .List__Item {
                    margin: 0;
                    padding: 1rem;
                    display: flex;
                    flex-direction: row;
                    align-items: center;
                    gap: 1rem;
                    border-bottom: 1px solid #ccc;
                    text-decoration: none;
                    color: inherit;

                    h3 {
                        font-size: 1.25rem;
                        margin: 0;
                        padding: 0;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                        flex: 1 1 auto;
                    }

                    span {
                        display: block;
                        width: 3rem;
                        height: 3rem;
                        background-color: #336799;
                        border-radius: 0.5rem;
                        position: relative;
                        overflow: hidden;
                        background-size: cover;
                        background-image: var(--image);
                        background-position: center;
                        flex: 0 0 auto;
                    }


                }   
            }
        }

        footer {
            background-color: var(--footer-bg);
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            align-items: center;
            padding: 0.5em 0;

            button {
                background-color: transparent;
                border: none;
                color: var(--footer-text);
                cursor: pointer;
                font-size: large;

                svg {
                    margin: 0.5rem;
                    stroke: var(--footer-text);
                }
            }
        }

        indicator {
            position: absolute;
            right: 0px;

            #icon-online { display: block; }
            #icon-offline { display: none; }
        }        
    }

    &.root {
        application{
            header {
                span {
                    img { display: block; }
                    h2 { display: none; }
                }
                & > svg.divider {
                    display: block;
                    height: var(--divider-h);
                }                
            }
        }
    }

    &.offline {
        application {
            indicator {
                #icon-online { display: none; }
                #icon-offline { display: block; }
            }
        }
    }
  }




  
