/* General styles */
body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
    overflow: hidden;
}

.dark-mode {
    background-color: #333;
    color: #f1f1f1;
}

.calculator {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, color 0.3s;
}

.calculator.dark-mode {
    background-color: #444;
    color: #f1f1f1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.display {
    width: 90%;
    padding: 15px;
    font-size: 24px;
    border: 1px solid #ccc;
    text-align: right;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: inherit;
    color: inherit;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

button {
    padding: 10px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
}

@media (max-width: 600px) {
    .calculator {
        width: 100%;
        max-width: 350px;
        padding: 5px;
    }

    button {
        font-size: 35px;
        /* Adjust button size */
    }
}

button:active {
    transform: scale(0.95);
}

/* Button styles */
.operator {
    background-color: #ff9800;
}

.number {
    background-color: #2196f3;
}

.clear,
.backspace,
.equal {
    background-color: #f44336;
    /* grid-column: span 2; */
}

.function {
    background-color: #4caf50;
}

.dark-mode button {
    color: #fff;
}

.toggle-history-btn,
.clear-history-btn {
    background-color: #d32f2f;
    color: #fff;
    padding: 5px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    width: 100%;
    border-radius: 4px;
    margin-top: 10px;
}

.toggle-dark-btn {
    position: fixed;
    left: 0;
    top: 0;
    margin: 5px;
}

.toggle-fullscreen-btn {
    position: fixed;
    right: 0;
    top: 0;
    margin: 5px;
}

.toggle-dark-btn,
.toggle-fullscreen-btn {
    background-color: #3f2fd3;
    color: #fff;
    padding: 5px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    width: 20%;
    border-radius: 4px;
    margin-top: 10px;
}

/* History section styles */
.history-section {
    display: none;
    max-height: 75vh;
    overflow-y: auto;
    border-top: 1px solid #ccc;
    /* padding-top: 10px; */
    margin-top: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.calculator.dark-mode .history-section {
    background-color: #555;
    color: #f1f1f1;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    padding: 5px 0;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
}

.history-item:last-child {
    border-bottom: none;
}