body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: rgb(121, 199, 243);
    font-family: Arial, Helvetica, sans-serif;
    padding: 20px;
}

.calculadora{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 5px 5px;
    width: 215px;
    height: 320px;
    margin-top: 20px;
    /* añado efecto modal para la calculadora*/
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    /*Ajusto el tamaño para compesar el padding*/
    box-sizing: border-box;
    width: 265px;
    height: 380px;
}

.pantalla{
    grid-column: 1 / 5;
    grid-row: 1 / 2; 
    background-color: blanchedalmond;
    text-align: center;
    border-radius: 5px;
    /* width: 94%; */
    height: 80%;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: bold;
    box-shadow: 0 20px 20px rgba(0, 0, 0, 0.3);
}

.boton{
    border-radius: 50%;
    background-color: royalblue;
    display: flex;
    justify-content: center;
    align-items: center;
    color:antiquewhite;
    cursor: pointer;
    background-color: rgb(0, 120, 195);
    transition: background-color 0.3s ease;
    font-size: 1.1em;
    font-weight: bold;
    user-select: none;
}

.boton:hover{
    background-color: rgb(57, 144, 197);
    transform: translateY(-2px);
}

.boton.operacion{
    background-color: rgb(0, 157, 255);
}

.boton.operacion:hover{
    background-color: rgb(53, 170, 255);
    transform: translateY(-2px);
}

.boton.especial{
    background-color: orangered;
}

.boton.especial:hover{
    background-color: rgb(254, 123, 76);
    transform: translateY(-2px);
}

.boton:active{
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Historial */

.historial-panel{
    position: absolute;
    bottom: 58%;
    left:50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 300px;
    max-height: 80vh;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.historial-panel.show{
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.historial-header{
    padding: 20px 20px 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.historial-header h3{
    margin: 0;
    color: #333;
}

/* Boton Limpiar historiaL */

.btn-limpiar{
    background: orangered;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-limpiar:hover{
    background: rgb(254, 123, 76);
}

/* Historial Listado */

.historial-lista{
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 20px 20px;
}

.historial-item{
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.historial-item:hover{
    background-color: #f8f9fa;
    border-radius: 5px;
}

.historial-item:last-child{
    border-bottom: none;
}

.historial-vacio{
    text-align: center;
    color: #999;
    font-style: italic;
    margin: 20px 0;
}

/* Indicador de modo */

.modo-indicator{
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    z-index: 999;
}

/* Overlay para el historial */

.historial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.historial-overlay.active{
    opacity: 1;
    pointer-events: all;
}

/*Responsive*/

@media (max-width: 480px){
    .calculadora{
        width: 240px;
        height: 290px;
        padding: 15px;
    }
    .pantalla{
        font-size: 1.2em;
    }
    .boton{
        font-size: 1em;
    }
}



