@import url('_color.css');
@import url('_shadow.css');


html, body, button, input, select {
    font-family: 'sans-serif';
}

html, body {
    margin: 0;
    user-select: none;
    height: 100%;
    overflow: hidden;
}

body {
    & > .main {
        height: 100%;
        display: flex;

        img.icon {
            height: 1.2em;
            vertical-align: middle;
            position: relative;
            top: -0.1em;
        }

        & > .panel-resizer {
            cursor: ew-resize;
            width: 0.4rem;
            flex-shrink: 0;
        }

        & > .left-panel {
            box-shadow: var(--box-shadow-4dp);
            width: 35rem;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            background-color: var(--color-grey-100);
            overflow: auto;

            .invalid {
                background-color: rgba(red, 0.3);
            }

            & > .header {
                flex-shrink: 0;
                margin: 1rem;
                display: flex;
                align-items: stretch;
                gap: 0.2rem;

                & > .title {
                    flex-grow: 1;
                    font-size: 1.4rem;
                    font-weight: 500;
                    color: var(--color-grey-700);

                    & > .version {
                        font-size: 0.8rem;
                        padding-left: 0.5rem;
                    }
                }
            }

            & > .form {
                display: grid;
                grid-template-columns: auto 1fr;
                grid-column-gap: 0.5rem;
                grid-row-gap: 0.3rem;
                align-items: center;
                margin: 1rem;

                & > .label {
                    font-weight: 600;
                    color: var(--color-grey-800);
                }
            }

            & > .content {
                flex-grow: 1;
                display: flex;
                flex-direction: column;
                margin: 1rem;
                margin-bottom: 0;
                align-items: stretch;
                overflow: auto;

                & > div {
                    margin-bottom: 1rem;

                    & > table {
                        width: 100%;

                        .col-quantity, .col-height, .col-width {
                            width: 5rem;

                            input {
                                text-align: right;
                            }
                        }

                        .col-rotate {
                            width: 4rem;
                        }

                        .col-delete {
                            width: 2rem;
                        }

                        & > thead {
                            th {
                                font-weight: 600;
                                color: var(--color-grey-800);
                                text-align: left;

                                &.col-rotate {
                                    text-align: center;
                                }
                            }
                        }

                        & > tbody {
                            td {
                                div {
                                    display: flex;
                                    align-content: stretch;

                                    & > * {
                                        flex-shrink: 1;
                                        flex-grow: 1;
                                        width: 1rem;
                                    }

                                }
                            }
                        }

                        & > tfoot {
                            td {
                                & > div {
                                    display: flex;

                                    & > .spacer {
                                        flex-grow: 1;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            & > .calculate {
                flex-shrink: 0;
                margin: 1rem;
                padding: 1rem;
            }

            .invalid {
                background-color: rgba(red, 0.2);
            }
        }

        & > .center-panel {
            flex-grow: 1;
            overflow: auto;
            padding: 1.5rem;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        & > .right-panel {
            box-shadow: var(--box-shadow-4dp);
            width: 20rem;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            background-color: var(--color-grey-100);
            overflow: auto;

            .form {
                display: grid;
                grid-template-columns: auto 1fr;
                grid-column-gap: 0.5rem;
                grid-row-gap: 0.3rem;
                align-items: center;
                margin: 1rem;

                & > .label {
                    font-weight: 600;
                    color: var(--color-grey-800);
                }
            }

            .panel {
                margin: 1.5rem 0;

                & > *:hover {
                    background-color: var(--color-grey-300);
                    cursor: pointer;
                }
            }

            .panel-name {
                padding: 0.4rem 1rem;
                overflow: hidden;
                text-overflow: ellipsis;
                font-weight: 600;
                color: var(--color-grey-800);
            }

            .item {
                padding: 0.4rem 1rem 0.4rem 2rem;
                display: flex;

                .item-name {
                    flex-grow: 1;
                }

                .item-rotate, .item-x, .item-y {
                    margin-left: 0.4rem;
                    font-weight: 600;
                    color: var(--color-grey-800);
                }
            }

            .selected {
                background-color: var(--color-grey-300);
            }
        }

        & > .overlay {
            position: absolute;
            z-index: 3;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(black, 0.3);
            display: flex;
            justify-content: center;
            align-items: center;

            & > .settings {
                background-color: var(--color-grey-100);
                border-radius: 0.2rem;

                & > .header {
                    display: flex;
                    padding: 0.2rem;
                    background-color: var(--color-grey-800);
                    align-items: center;
                    border-radius: 0.2rem;

                    & > .title {
                        flex-grow: 1;
                        text-align: center;
                        font-weight: 600;
                        color: var(--color-grey-200);
                    }

                    & > button {
                        font-size: 0.6rem;
                        padding: 0.2rem;
                    }
                }

                & > .form {
                    display: grid;
                    grid-template-columns: auto 1fr;
                    grid-column-gap: 0.5rem;
                    grid-row-gap: 0.3rem;
                    align-items: center;
                    margin: 1rem;

                    & > .label {
                        font-weight: 600;
                        color: var(--color-grey-800);
                    }

                    & > .title {
                        margin-top: 1rem;
                        grid-column-end: span 2;
                        background-color: var(--color-grey-600);
                        font-weight: 600;
                        color: var(--color-grey-200);
                        padding: 0.2rem 0.5rem;
                    }
                }
            }
        }
    }

    & > .notifications {
        position: absolute;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column-reverse;
        z-index: 2;

        & > div {
            margin: 0 0.5rem 0.5rem 0;
            padding: 1rem;
            border-radius: 0.2rem;
            background-color: var(--color-red-200);
        }
    }
}
