@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to right top, #654ea3, #eaafc8); /* A nice gradient background */
    font-family: 'Poppins', sans-serif;
    margin: 0;
    overflow: hidden;
}

.calculator {
    position: relative;
    width: 320px;
    background: rgba(255, 255, 255, 0.1); /* Slightly transparent white for glass effect */
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(10px); /* The key to glassmorphism */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.calculator::before,
.calculator::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    filter: blur(20px);
    z-index: -1;
}

.calculator::before {
    width: 100px;
    height: 100px;
    top: -30px;
    left: -30px;
}

.calculator::after {
    width: 120px;
    height: 120px;
    bottom: -40px;
    right: -40px;
}

.display-screen {
    background: rgba(255, 255, 255, 0.2); /* Glass effect for the display area */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
    display: flex; /* Use flexbox to arrange the two display inputs */
    flex-direction: column; /* Stack them vertically */
    align-items: flex-end; /* Align text to the right */
    justify-content: space-between; /* Space out the two inputs */
    height: 90px; /* Give enough height for both displays */
    box-sizing: border-box;
}

#expression-display,
#result-display {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    text-align: right;
    padding: 0 5px; /* Adjust padding for better spacing */
    box-sizing: border-box;
    outline: none;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.2); /* Subtle text shadow for readability */
}

#expression-display {
    font-size: 1.2em; /* Smaller font for the expression */
    opacity: 0.7; /* Slightly faded */
    min-height: 25px; /* Ensure it has some height even if empty */
}

#result-display {
    font-size: 2.5em; /* Larger font for the main result */
    font-weight: 500;
    min-height: 45px; /* Ensure it has some height */
}


.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.button {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 20px 0;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.button.operator {
    background: rgba(255, 178, 71, 0.3); /* Orange tint for operators */
    border-color: rgba(255, 178, 71, 0.5);
}

.button.operator:hover {
    background: rgba(255, 178, 71, 0.4);
}

.button.equal {
    background: rgba(100, 200, 100, 0.3); /* Green tint for equals */
    border-color: rgba(100, 200, 100, 0.5);
    grid-column: span 1;
}

.button.equal:hover {
    background: rgba(100, 200, 100, 0.4);
}

.button.zero {
    grid-column: span 2;
}