* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    padding: 20px;
}

.calculator-container {
    display: flex;
    max-width: 900px;
    width: 100%;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.calculator {
    flex: 1;
    padding: 20px;
    background-color: #f8f9fa;
}

.history {
    width: 300px;
    background-color: #fff;
    border-left: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
    max-height: 500px;
}

.calculator-screen {
    width: 100%;
    height: 80px;
    background-color: #2c3e50;
    color: #fff;
    text-align: right;
    font-size: 2.5rem;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    margin-bottom: 15px;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 10px;
}

button {
    height: 60px;
    border: none;
    border-radius: 5px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    transform: scale(1.05);
}

.operator {
    background-color: #3498db;
    color: #fff;
}

.operator:hover {
    background-color: #2980b9;
}

.equal {
    background-color: #e74c3c;
    color: #fff;
    grid-column: span 2;
}

.equal:hover {
    background-color: #c0392b;
}

.clear, .clear-entry {
    background-color: #95a5a6;
    color: #fff;
}

.clear:hover, .clear-entry:hover {
    background-color: #7f8c8d;
}

.number {
    background-color: #ecf0f1;
}

.number:hover {
    background-color: #bdc3c7;
}

.history h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-list {
    list-style-type: none;
}

.history-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.history-expression {
    color: #7f8c8d;
    font-size: 14px;
}

.history-result {
    color: #2c3e50;
    font-weight: bold;
    font-size: 16px;
}

.clear-history-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    height: auto;
}

.clear-history-btn:hover {
    background-color: #c0392b;
}

.delete-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 16px;
    height: auto;
    padding: 2px 5px;
}

.delete-item:hover {
    color: #c0392b;
}

@media (max-width: 768px) {
    .calculator-container {
        flex-direction: column;
    }
    
    .history {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        max-height: 200px;
    }
}