@import "inc/bootstrap";
/* Style for the calculator component */

/* font size mixin specific to calculator to use em instead of rem unit */
@mixin calc-font-size($em) {
    font-size: calc(($em) * 1em) !important;
}

.dynamic-component-container {
    .calcContainer {
        width: 100%;
        height: 100%;
        background: none;
        border: none;
        bottom: auto;
        clear: none;
        color: $textColor;
        display: block;
        float: none;
        font-family: sans-serif;
        left: auto;
        line-height: normal;
        margin: 0;
        max-height: none;
        max-width: none;
        min-height: 0;
        min-width: 0;
        overflow: visible;
        padding: 0;
        position: static;
        right: auto;
        text-align: left;
        text-decoration: none;
        top: auto;
        visibility: visible;
        &:after {
            clear: both;
            content: ".";
            display: block;
            height: 0;
            visibility: hidden;
        }
        form {
            height: 100%;
            padding: 0 20px 20px;
            width: 100%;
            /*
            * the font-size of the parent element of the calculator will serve as the reference for the children.
            * the children must use em unit for font-sizing to ensure proportional increase when resized.
            */
            font-size: 10px;
            input, button {
                background-color: $uiClickableDefaultBg;
                border-radius: 0;
                padding: 0;
                border: none;
                color: $textColor !important;
                float: left;
                height: 14%;
                text-align: center;
                text-shadow: none;
                width: 25%;
                min-width: 0;
                cursor: pointer;
                &.div-1{
                    width: 100%;
                }
                &.div-2{
                    width: 50%;
                }
                &.div-3{
                    width: 33.33%;
                }
                &.div-4{
                    width: 25%;
                }
                &.div-5{
                    width: 20%;
                }
                &.calcFirst {
                    clear: left;
                }
                &.calcClear {
                    color: $info !important;
                    @include calc-font-size(1.8);
                }
                &.calcFunction {
                    @include calc-font-size(1.8);
                    sup {
                        top: -0.5em;
                        padding-right: 1px;
                        @include calc-font-size(0.8);
                    }
                    sub {
                        padding-left: 1px;
                        @include calc-font-size(1.0);
                    }
                    &.calcDivision, &.calcMultiplication, &.calcSubtraction, &.calcSum{
                        @include calc-font-size(2.2);
                    }
                }
                &.calcDisplay {
                    cursor: text;
                    opacity: 1 !important;
                    background: whiten($uiClickableDefaultBg, .7);
                    &:hover {
                        background: whiten($uiClickableDefaultBg, .9);
                    }
                    font-family: monospace;
                    text-align: right;
                    width: calc(100% + 40px);
                    max-width: none;
                    padding: 0 0.2em;
                    height: 16%;
                    font-size: 2.8em;
                    position: relative;
                    left: -20px;
                }
                &.calcInput {
                    font-weight: bold;
                    @include calc-font-size(1.8);
                }
                &.calcSubmit {
                    font-weight: bold;
                    color: $textColor !important;
                    background-color: #ddd;
                    text-shadow: none;
                    line-height: normal;
                }
                &:hover {
                    background: $uiClickableActiveBg;
                }
                &.triggered {
                    background: whiten($uiClickableHoverBg, .2);
                }
            }
        }
    }
}
