* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f4f4f4;
}
.title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.calculator {
    width: 100%;
    max-width: 400px;
    background-color: #222;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    overflow: hidden;
}

.display {
    width: 100%;
    padding: 20px;
    background-color: #000;
    color: #fff;
    font-size: 1.8rem;
    text-align: right;
    border: none;
}

.history-display {
    max-height: 100px;
    overflow-y: auto;
    background-color: #333;
    color: #ccc;
    padding: 10px;
    font-size: 0.9rem;
    display: none;
}
.calculator-container {
    text-align: center;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
}

.bottom-buttons {
    display: flex;
    justify-content: space-between;
    padding: 10px;
}

.btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 20px;
    font-size: 1.4rem;
    border-radius: 5px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.btn:hover {
    background-color: #555;
}

.clear {
    background-color: #e74c3c;
}

.clear:hover {
    background-color: #c0392b;
}

.equal {
    background-color: #27ae60;
}

.equal:hover {
    background-color: #1e8449;
}

.zero {
    grid-column: span 2;
}

.history {
    background-color: #2980b9;
}

.history:hover {
    background-color: #1f618d;
}

.mode {
    background-color: #8e44ad;
}

.mode:hover {
    background-color: #6c3483;
}

@media (max-width: 500px) {
    .btn {
        padding: 15px;
        font-size: 1.2rem;
    }
    .display {
        font-size: 1.4rem;
        padding: 15px;
    }
    .history-display {
        font-size: 0.8rem;
    }
}
