body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    font-family: sans-serif;
}

.calculator {
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

#display {
    width: calc(100% - 20px); /* Adjust width considering padding */
    padding: 10px;
    font-size: 2em;
    text-align: right;
    border: none;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box; /* Include padding in width calculation */
    background-color: #eee;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

button {
    padding: 20px;
    font-size: 1.2em;
    border: 1px solid #ddd;
    background-color: #fafafa;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #e0e0e0;
}

button:active {
    background-color: #d0d0d0;
}

/* Make equals button span two columns if needed, or style differently */
/* Example: Style operators differently */
button:nth-child(4n), /* Operators in the 4th column */
button:nth-child(3),  /* Division */
button:nth-child(4) { /* Multiplication */
    background-color: #f0ad4e;
    color: white;
}

button:nth-child(4n):hover,
button:nth-child(3):hover,
button:nth-child(4):hover {
    background-color: #ec971f;
}

button:nth-child(16) { /* Equals button */
    grid-column: span 2; /* Make equals button wider */
    background-color: #5cb85c;
    color: white;
}

button:nth-child(16):hover {
    background-color: #4cae4c;
}

button:nth-child(1), /* Clear button */
button:nth-child(2) { /* Delete button */
    background-color: #d9534f;
    color: white;
}

button:nth-child(1):hover,
button:nth-child(2):hover {
    background-color: #c9302c;
}