*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    
}
body{
    font-family: 'Roboto', sans-serif;
    background-color: #f5f5f5;
    font-size: 16px;
    
}
.calculator{
    /* height: HALF OW HEIGHT SCREEN*/
    width: 99%;
    margin: 0 auto;
    background-color: #CACFD7;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 20px;
}
.screen{
    width: 100%;
    /* height: 100px; */
    height:45vh;
    background-color: #f5f5f5;
    border-radius: 5px;
    display: flex;
    flex-direction: column-reverse;
    color: #333;
    /* enable scroll*/
    overflow-y: auto;
    border: solid 1px blue;
    font-size: 1.5rem;
    .clone *{
        background-color: #f5f5f5;
    }
    .sub-screen{
        width: 100%;

        display: flex;
        flex-direction: column;
        justify-content: center;
        background-color: #ffffff;
        outline: 1px solid blue;
        .main-result
                {
                    display : flex;
                }
                #invalid-container
                {
                    display: none;
                }
                .invalid-container
                {
                    display: flex;
                    position: relative;
                    align-items: center;
                    margin-bottom: 1px;

                    .warning
                    {
                        width: 25px;
                        position: relative;
                        z-index: 100;
                    }
                    .invalid
                    {
                        position: relative;
                        z-index: 100;
                        font-size: 16px;
                        color: red;
                        margin-left: 5px;
                        /*prevent break line*/
                        white-space: nowrap;
                    }
                }

        #main-input{

            width: 100%;
            overflow-x: hidden;
            

        }
        #main-result{

            width: fit-content;
        }
        math-field{
            width: 100%;
            border: none ;
            outline: none;
            
            
        }
        math-field::part(content) {
            overflow-x: auto !important;
            display: block;
            max-width: 100%;
            

        }
        math-field::part(content)::-webkit-scrollbar {
            height: 8px; /* Grosimea barei */
        }
        
        math-field::part(content)::-webkit-scrollbar-track {
            background: #f1f1f1; /* Fundalul track-ului */
            border-radius: 10px;
        }
        
        math-field::part(content)::-webkit-scrollbar-thumb {
            background: #CACFD7; /* Culoarea barei de scroll */
            border-radius: 10px;
        }
        
        math-field::part(content)::-webkit-scrollbar-thumb:hover {
            background: #555; /* Culoarea la hover */
        }
        
        
    }
}
.controls{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
    #open-keyboard{
        padding: 10px;
        font-size: 1.5rem;
        border: none;
        border-radius: 5px;
        background-color: #a0a9b8;
        cursor: pointer;
        transition: all 0.3s;
        &:hover{
            background-color: #7d8795;
        }
        &:active{
            background-color: #a0a9b8;
        }
    }
    #AC{
        padding: 10px;
        font-size: 1.2rem;
        border: none;
        border-radius: 5px;
        background-color: #a0a9b8;
        cursor: pointer;
        transition: all 0.3s;
        &:hover{
            background-color: #7d8795;
        }
        &:active{
            background-color: #a0a9b8;
        }
    }
    #clear{
        padding: 10px;
        font-size: 1.5rem;
        border: none;
        border-radius: 5px;
        background-color: #a0a9b8;
        cursor: pointer;
        transition: all 0.3s;
        &:hover{
            background-color: #7d8795;
        }
        &:active{
            background-color: #a0a9b8;
        }
    }
    #enter{
        padding: 10px;
        font-size: 1.5rem;
        border: none;
        border-radius: 5px;
        background-color: #a0a9b8;
        cursor: pointer;
        transition: all 0.3s;
        &:hover{
            background-color: #7d8795;
        }
        &:active{
            background-color: #a0a9b8;
        }
    }
    .control-b{
        font-size: 1rem;
    }
}

@media screen and (max-width: 480px){
    
    math-field{
        font-size: 1.1rem !important;
    }
    .controls{
        grid-template-columns: repeat(2, 1fr);
    }
    
}
@media screen and (max-width: 320px){
    math-field{
        font-size: 1rem !important;
    }
}