/* 基本的なリセットとbodyのスタイル */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column; /* 電卓と履歴を縦に並べるために変更 */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4;
    margin: 0;
}

.calculator-container {
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    width: 300px;
    padding: 20px;
    margin-bottom: 20px; /* 電卓と履歴の間のスペース */
}

.display {
    background-color: #222;
    color: #eee;
    font-size: 2.5em;
    padding: 15px;
    border-radius: 5px;
    text-align: right;
    margin-bottom: 20px;
    overflow: hidden; /* 長い数字に対応するため */
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.buttons button {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.buttons button:hover {
    background-color: #777;
}

.buttons .equals {
    background-color: #ff9500;
    grid-column: span 2; /* イコールボタンを2列に拡張 */
}

.buttons .equals:hover {
    background-color: #e08400;
}

.buttons .zero-button {
    grid-column: span 2; /* ゼロボタンを2列に拡張 */
}

/* 履歴部分のスタイル */
.history-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 300px;
    padding: 20px;
    text-align: center;
}

.history-container h2 {
    color: #333;
    margin-top: 0;
}

#history-list {
    list-style: none;
    padding: 0;
    max-height: 200px; /* スクロールバーのために高さを制限 */
    overflow-y: auto; /* 垂直スクロールを有効にする */
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: left;
    padding-left: 10px;
}

#history-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    color: #555;
    font-size: 0.9em;
}

#history-list li:last-child {
    border-bottom: none;
}

.history-container button {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.history-container button:hover {
    background-color: #c82333;
}