html, body{
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: #5fc9f3;
}
*, *::before, *::after {
    box-sizing: border-box;
}

*{
  font-family: sans-serif;
}

.mainGrid{
    height: 100%;
    width: 100%;
    padding: 5px;
    display: grid;
    gap: 6px 6px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 5fr 5fr 0.5fr;    
    font-size: 2.5vw;
    & >div {
        border: solid black 3px;
        padding: 3px;
        max-width: 100%;
        max-height: 100%;
        min-width: 0%;
        min-height: 0%;
        overflow: hidden;
    }

    & #topRow, #bottomRow{
        display: flex;
        flex-direction: row;
        grid-column-start: 1;
        grid-column-end: 3;
        align-items: center;
    }
    & #topRow{
    justify-content: space-between;
    align-items: center;
    padding-left: 5px;
    padding-right: 5px;
    }

    #topRow{
        & >div{
            min-width: 33.33%;
        }
        & #time{
            text-align: center;
        }
        & #dateHE{
            text-align: end;
        }
    }

    #bottomRow {
        font-size: 3vh;
        & button{
            margin-left: auto;
            height: 100%;
            aspect-ratio: 1/1;
            padding: 0px;
            font-size: 1.5vh;
            text-align: center;            
        }
    }

    .module th, .module td:not(.update > td) {
        border: 0.5px solid black;
        padding: 3px 8px;
        white-space: nowrap;
    }
}

table {
    border-collapse: collapse;
    max-width: 100%;
    width: 100%;
    max-height: 100%;
    height: 100%;
    overflow: hidden;
    table-layout: fixed;
    & th{
        font-size: 2vw;
    }
    & .centredTd{
        text-align: center;
    }
}


.mainGrid .update {
    font-size: 1.5vh;
    padding: 0.4em;
    height: 1.3em;
    td{
        font-size: inherit;
        border: none;
        padding: 0px;
    }
}


#trains{
    & tbody td:not(.update > td) {
        font-size: 1.5vw;
    }
    & thead th{
        font-size: 2vw;
    }

    & tr td:nth-child(4){
        color: rgb(177, 119, 11);
        &.onTime{
            color: rgb(12, 132, 12)
        };
        &.cancelled{
            color: red;
        };
        &.unknown{
            color: black;
        };
    }
}


#buses{
    & tbody td {
    font-size: 1.5vw;
    }
    & tr td > div{
        display: grid;
        grid-template-columns: 4fr 1fr;
        gap: 5px;
        border-bottom: 0.25px solid #80808098;    
        & div > div:nth-child(1){
            justify-self: left;
            max-width: 100%;
            overflow: hidden;
            white-space: pre-line;
        }
        & div > div:nth-child(2){
            justify-self: right;
            align-self: center;
        }
    }
}

#zmanim tbody td {
    font-size: 1.3vw;
}




#weather .weather {
    display: grid;
    grid-template-rows: 1fr 6fr 6fr;
    row-gap: 3px;
    align-items: center;
    width: clamp(100%, 100%, 100%);
    max-height: 100%;
    text-align: center;

    & .weatherForDay{
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        column-gap: 3px;
        overflow: hidden;
    }
    & .weatherForWeek{
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        column-gap: 3px;
        overflow: hidden; 
        font-size: 1vw;
        border-top: black 1px solid;     
        & > div {
            font-size: 1vw;
            & :nth-child(1){
                padding-top: 0.5em;
            }
        }
    }

    & > div > div {
        font-size: 1.3vw;
    }

    & .weatherTitle{
        text-align: center;
        & b{
            font-size: 1.5vw;
            vertical-align: middle;
        }
        & span{
            vertical-align: middle;
        }
    }
}


#settingsWindow{
    display: none;
    position: fixed;
    flex-direction: column;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99;
    width: 66%;
    height: 66%;
    border: solid black 1px;
    background-color: rgb(95, 201, 243);
    box-shadow: 10px 10px 50px;
    & .warning{
        color: red;
    }
}

#backgroundDim {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 98
}


#tabs{
    border: 1px solid #ccc;
    background-color: rgb(135, 177, 224);
    display: flex;
    padding: 2px;
    height: clamp(10%, 10%, 2em);
    font-size: 1.5vw;
    align-items: center;
    & > .tab {
        flex-basis: 12%;
        justify-content: left;
        background-color: inherit;
        font-size: inherit;
        border: none;
        outline: none;
        cursor: pointer;
        min-height: 100%;
        &:hover{
            background-color: rgb(116, 177, 201);            
        }
        &.activeTab{
            background-color: rgb(102, 170, 197);
        }
    }
    & > #settingsLabel{
        flex-basis: 15%;
    }
    & #manageButtons{
        margin-left: auto;
        & button{
            width: 1.5em;
            aspect-ratio: 1;
            font-size: 1.6vw;        
        }
    }
}


.tabContents{
    display: none;
    position: relative;
    justify-content: center;
    align-content: center;
    flex: 1 1 auto;
    font-size: 2vw;
    & > div{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: justify;
    }
}


#trainContents{
    gap: 1em;
    & input, button{
        height: 1.5em;
        font-size: inherit;        
    }
    & input{
        width: 5em;
    }
}


#busContents{
    gap: 0.5em;
    padding: 0.5em;
    display: flex;
    flex-direction: column;
    & input, button{
        height: 1.5em;
        font-size: smaller;
    }
    & .busRouteEntry{
        width: 4em;
    }
    & .busStopEntry{
        width: 13em;
    }
    & > div:not(#busSearchResults){
        display: flex;
        flex-direction: row;
        gap: 0.6em;
    }
    & label{
        align-self: start;
    }

    & #busSearchResults{
        display: none;
        position: absolute;
        font-size: 1.75vw;
        flex-direction: column;
        background-color: white;
        border: 1px solid black;
        & > div{
            border: 0.5px solid black;
            padding: 0.3em;
            cursor: pointer;
            text-align: left;
            & > div:nth-child(2){
                font-size: 1.25vw;
            }
            & > div:nth-child(3){
                font-size: 0.75vw;
            }            
        }
    }

}


.locationBasedSettings{
    gap: 1em;
    align-items: start;
    position: relative;
    & input, button {
        font-size: inherit;
        height: 1.5em;
    }
    & input{
        width: 25em;
    }
    & .locationSearchResults{
        display: none;
        position: absolute;
        flex-direction: column;
        font-size: 1.75vw;
        background-color: white;
        border: solid black 1px;
        z-index: 100;
        overflow-y: hidden;
        & > div{
            border-bottom: solid black 1px;
            min-width: 100%;
            padding: 0.3em;
            cursor: pointer;            
            & > div:nth-child(2){
                font-size: 1.25vw;
            }
        }
    }

}


.searchBoxParent{
    display: flex;
    flex-direction: row;
    background-color: white;
    border: 0.5px solid black;
    border-radius: 0.25em;
    & .searchButton {
        margin-left: auto;
        background-color: transparent;
        border: none;        
        font-size: inherit;
        aspect-ratio: 1;
        padding-right: 0.25em;
        cursor: pointer;
    }
    & input {
        border: none;
        background-color: transparent;
        outline: none;
    }

}

input{
    background-color: white;
}
