* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f4f9;
}

.calculator-container {
    display: flex;
    gap: 20px;
}

.calculator {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 320px;
    max-width: 100%;
}

.display {
    width: 100%;
    height: 50px;
    font-size: 24px;
    text-align: right;
    padding: 10px;
    margin-bottom: 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

button {
    padding: 20px;
    font-size: 18px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #e0e0e0;
}

.history {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 300px;
    max-width: 100%;
    height: 350px;
    overflow-y: auto;
}

h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

#history-list {
    list-style-type: none;
}

#history-list li {
    padding: 5px;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
}

@media (max-width: 600px) {
    .calculator-container {
        flex-direction: column;
        gap: 10px;
    }

    .calculator {
        width: 100%;
        padding: 10px;
    }

    .display {
        font-size: 20px;
    }

    button {
        padding: 15px;
        font-size: 16px;
    }

    .history {
        width: 100%;
    }
}

.clear-history-btn {
    font-size: 14px;
    background-color: #ff6f61;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 10px; /* To add some space between the header text and the button */
}

.clear-history-btn:hover {
    background-color: #e25746;
}



