﻿/*.calc-template {
    position: relative;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    height: 54vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: 70px 70px 70px 70px;
    grid-template-rows: 70px 70px 70px 70px;
    justify-items: center;
}

    .grid-container :hover {
        box-shadow: 0px 0px 7px 1px rgba(141, 207, 252, 0.3);
    }

    .grid-container :active {
        border: none;
        box-shadow: 0px 0px 7px 1px #8dcffc;
        color: #8dcffc;
        font-size: 13px;
    }


.calc-screen-primary {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: right;
    align-items: end;
    padding: 6px 4px;
    position: absolute;
    top: 20px;
    left: 0px;
    border: none;
    margin: 10px;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-size: 17px;
    line-height: 40px;
    color: #424242;
    transform: translate(0px, -30px);
}

.calc-screen-secondary {
    width: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: right;
    align-items: end;
    padding: 6px 4px;
    position: absolute;
    top: 5px;
    left: 0px;
    border: none;
    transform: translate(0px, 20px);
    margin: 10px;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-size: 32px;
    line-height: 50px;
    color: #424242;
    white-space: nowrap;
    overflow: visible;
}

.calc-button {
    display: grid;
    color: black;
    height: 62px;
    width: 62px;
    margin: 30px;
    box-shadow: -2px -1px 20px 10px rgba(0,0,0,0.05);
    border: none;
    align-items: center;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    line-height: 48px;
    font-size: 18px;
    box-sizing: border-box;
    background: #FFFFFF;
    border: 1px solid #FFFFFF;
    backdrop-filter: blur(12px);
    border-radius: 16px;
}

.special-button {
    box-sizing: border-box;
    display: grid;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 62px;
    height: 40px;
    background: #FFFFFF;
    border: 1px solid #FFFFFF;
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: -2px -1px 20px 10px rgba(0,0,0,0.05);
    margin: 48px;
    color: #7CC9FF;
    font-size: 18px;
    font-family: 'Montserrat';
    font-style: oblique;
    font-weight: 500;
}

.op-button {
    display: grid;
    color: black;
    height: 62px;
    width: 62px;
    margin: 30px;
    box-shadow: -2px -1px 8px 4px #deeaff;
    border: none;
    color: #109DFF;
    align-items: center;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    line-height: 48px;
    font-size: 18px;
    box-sizing: border-box;
    background-color: #ADE2FF;
    border: 1px solid #ADE2FF;
    backdrop-filter: blur(12px);
    border-radius: 16px;
}

.num-button {
    display: grid;
    color: black;
    height: 62px;
    width: 62px;
    margin: 30px;
    box-shadow: -2px -1px 20px 10px rgba(0,0,0,0.05);
    border: none;
    color: #38B9FF;
    align-items: center;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    line-height: 48px;
    font-size: 18px;
    box-sizing: border-box;
    background: #FFFFFF;
    border: 1px solid #FFFFFF;
    backdrop-filter: blur(12px);
    border-radius: 16px;
}

.dot-button {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 4px;
    position: absolute;
    align-items: center;
    text-align: center;
    width: 62px;
    height: 62px;
    background: #FFFFFF;
    border: 1px solid #FFFFFF;
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: -2px -1px 20px 10px rgba(0,0,0,0.05);
    margin: 48px;
    color: #7CC9FF;
    font-size: 18px;
    font-family: 'Montserrat';
    font-style: oblique;
    font-weight: 500;
    transform: translate(35px, 263px);
}

    .dot-button :active {
        border: none;
        box-shadow: 0px 0px 7px 1px #8dcffc;
        color: #8dcffc;
        font-size: 13px;
    }

.coma-button {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 4px;
    position: absolute;
    align-items: center;
    text-align: center;
    width: 62px;
    height: 62px;
    background: #FFFFFF;
    border: 1px solid #FFFFFF;
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: -2px -1px 20px 10px rgba(0,0,0,0.05);
    margin: 48px;
    color: #7CC9FF;
    font-size: 18px;
    font-family: 'Montserrat';
    font-style: oblique;
    font-weight: 500;
    transform: translate(-105px, 263px);
}

    .coma-button :active {
        border: none;
        box-shadow: 0px 0px 7px 1px #8dcffc;
        color: #8dcffc;
        font-size: 13px;
    }

.eq-button {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 4px;
    position: absolute;
    align-items: center;
    text-align: center;
    width: 62px;
    height: 133px;
    background: #FFFFFF;
    border: none;
    border-radius: 12px;
    backdrop-filter: blur(12px);
    box-shadow: -2px -1px 10px 3px rgba(25, 172, 255, 0.5);
    margin: 48px;
    color: #7CC9FF;
    font-size: 18px;
    font-family: 'Montserrat';
    font-style: oblique;
    font-weight: 500;
    transform: translate(105px, 263px);
    background: #19ACFF;
}

    .eq-button :active {
        border: none;
        box-shadow: 0px 0px 7px 1px #8dcffc;
        color: #8dcffc;
        font-size: 13px;
    }

.zero-button {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 4px;
    position: absolute;
    align-items: center;
    text-align: center;
    width: 62px;
    height: 62px;
    background: #FFFFFF;
    border: 1px solid #FFFFFF;
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: -2px -1px 20px 10px rgba(0,0,0,0.05);
    margin: 48px;
    color: #7CC9FF;
    font-size: 18px;
    font-family: 'Montserrat';
    font-weight: 500;
    transform: translate(-35px, 263px);
    transition: 0.3s;
}

.btn-container {
    display: grid;
    justify-items: end;
    align-items: end;
    justify-content: center;
    transform: translate(-58px, -175px)
}

    .btn-container :active {
        border: none;
        box-shadow: 0px 0px 7px 1px #8dcffc;
        color: #8dcffc;
        font-size: 13px;
    }

@media(max-height:720px) {
    .calc-template {
        position: page;
        height: 87vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: -10px 20px;
        zoom: 0.7;
    }

    .btn-container {
        transform: translate(-60px, -175px);
    }
}*/

/* Container e Telas */
.calc-template {
    position: relative;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.calc-screen-primary, .calc-screen-secondary {
    width: 100%;
    text-align: right;
    padding: 0 10px;
    color: #424242;
}

.calc-screen-primary {
    font-size: 17px;
    height: 25px;
    margin-top: 10px;
}

.calc-screen-secondary {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Grid Única */
.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 65px); /* 4 colunas */
    gap: 12px;
    justify-content: center;
}

    /* Estilo Universal para todos os botões */
    .grid-container div, .grid-container button {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 62px;
        height: 62px;
        border-radius: 16px;
        font-size: 18px;
        font-weight: 500;
        cursor: pointer;
        transition: 0.2s;
        border: 1px solid #FFFFFF;
        background: #FFFFFF;
        box-shadow: -2px -1px 15px rgba(0,0,0,0.05);
    }

/* Cores Específicas */
.num-button, .zero-button {
    color: black;
}

.dot-button, .coma-button {
    color: #7CC9FF;
    font-style: oblique;
}

.calc-button {
    color: #109DFF;
}

.op-button {
    background: #ADE2FF;
    border-color: #ADE2FF;
    color: #109DFF;
}

.eq-button {
    display: flex !important;
    justify-content: center;
    align-items: center;
    background: #19ACFF !important;
    color: white !important;
    border: none !important;
    font-size: 24px !important;
    font-weight: 600;
    width: 52px !important;
    height: 62px;
    border-radius: 16px;
    box-shadow: 0px 4px 10px rgba(25, 172, 255, 0.5);
    cursor: pointer;
    position: static;
    transform: none;
    margin: 0;
}

/* Interações */
.grid-container div:active, .grid-container button:active {
    transform: scale(0.9);
    box-shadow: 0px 0px 7px 1px #8dcffc;
}

@media(max-height: 720px) {
    .calc-template {
        zoom: 0.8;
    }
}

.calc-screen-primary, .calc-screen-secondary {
    width: 100%;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adiciona "..." se o número for grande demais */
    display: block;
    direction: ltr; /* Garante que o corte seja feito no final do número */
}

.calc-screen-secondary {
    font-size: 28px; 
    letter-spacing: -1px;
}



.history-modal {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 70%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    border-top: 1px solid #eee;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

    .history-modal.open {
        bottom: 0;
    }

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: bold;
    color: #444;
}

.history-content {
    flex-grow: 1;
    overflow-y: auto;
    text-align: right;
}

.history-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #f9f9f9;
    padding-bottom: 10px;
}

.history-expr {
    font-size: 12px;
    color: #999;
}

.history-res {
    font-size: 18px;
    color: #19ACFF;
    font-weight: 600;
}

.clear-history-btn {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 12px;
    padding-top: 10px;
}

.dot1-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid #eee;
    aspect-ratio: 1 / 1;
}

    .dot1-button:hover {
        background-color: #e9ecef;
        transform: translateY(-2px);
    }

    .dot1-button:active {
        transform: scale(0.95);
    }