*, *::before, *::after {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    font-weight: normal;
}

body {
    padding: 0;
    margin: 0 0 40px 0;
    background: #e0e5ec;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 80px); 
    grid-template-rows: minmax(120px, auto) repeat(8, 60px);
    gap: 15px;
}

.calculator-grid > button {
    cursor: pointer;
    font-size: 1.2rem;
    border: none;
    outline: none;
    border-radius: 20px;
    background: #e0e5ec;
    color: #555;
    /* Deeper, softer shadow for more depth */
    box-shadow: -6px -6px 12px #ffffff, 6px 6px 12px #cbced1;
    /* We add 'transform' to the transition so the scaling is smooth */
    transition: box-shadow 0.1s ease-in-out, transform 0.1s ease-in-out;
    -webkit-tap-highlight-color: transparent;
}

.calculator-grid > button:active {
    /* Deeper inset shadow */
    box-shadow: inset -6px -6px 12px #ffffff, inset 6px 6px 12px #cbced1;
    /* The button will slightly shrink, enhancing the "press" feeling */
    transform: scale(0.98);
}

/* Differentiate special buttons by text color */
[data-operation], [data-sci-operation], [data-parenthesis] {
    color: #3498db;
}

[data-all-clear] {
    color: #e74c3c;
}

[data-equals] {
    color: #2ecc71;
    font-weight: bold;
}

.toggle-active {
    /* The active state for toggles is also the pressed-in look */
    box-shadow: inset -5px -5px 10px #ffffff, inset 5px 5px 10px #cbced1;
    color: #3498db;
    font-weight: bold;
}

.output {
    grid-column: 1 / -1;
    background: #e0e5ec;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px;
    word-wrap: break-word;
    word-break: break-all;
    border-radius: 20px;
    margin-bottom: 10px;
    box-shadow: inset -5px -5px 10px #ffffff, inset 5px 5px 10px #cbced1;
}

.output .previous-operand {
    color: #7f8c8d;
    font-size: 1.5rem;
}

.output .current-operand {
    color: #2c3e50;
    font-size: 2.5rem;
}

.material-icons {
    font-size: 1.5rem;
    vertical-align: middle;
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    color: #95a5a6;
    font-size: 0.9rem;
    background-color: #e0e5ec;
    }
