.center-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    /* Adjust for header */
}

.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: minmax(120px, auto) repeat(5, 100px);
    gap: 12px;
    width: 100%;
    max-width: 400px;
    background: var(--surface-color);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgb(0 0 0 / 0.1));
    border: 1px solid var(--border-color);
}

.display {
    grid-column: 1 / -1;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    flex-direction: column;
    padding: 20px;
    word-wrap: break-word;
    word-break: break-all;
    border-radius: 12px;
    margin-bottom: 8px;
    color: white;
}

[data-theme="dark"] .display {
    background-color: rgba(0, 0, 0, 0.4);
}

.previous-operand {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.2rem;
    min-height: 1.5rem;
}

.current-operand {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

button {
    cursor: pointer;
    font-size: 1.5rem;
    border: 1px solid var(--border-color);
    outline: none;
    background-color: var(--bg-color);
    border-radius: 12px;
    transition: all 0.2s;
    color: var(--text-color);
    font-weight: 500;
}

button:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.operator {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.operator:hover {
    background-color: var(--primary-hover);
}

.span-2 {
    grid-column: span 2;
}

/* Mobile Adjustments */
@media (max-width: 500px) {
    .calculator {
        grid-template-rows: minmax(100px, auto) repeat(5, 80px);
        max-width: 100%;
        gap: 8px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        height: 100%;
        /* Fill screen */
    }

    .center-content {
        align-items: flex-start;
        padding: 0;
    }

    .container {
        padding: 0;
    }
}