/* General Styles */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e0eafc;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 36px;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.flex-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 5%;
}

.flex-child {
    flex: 1;
    margin: 20px;
    border: 2px solid transparent;
}

/* Calculator Styles */
.calculator {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 320px;
    text-align: center;
    transition: transform 0.3s ease;
}

.calculator:hover {
    transform: scale(1.05);
}

#display {
    width: 100%;
    height: 60px;
    font-size: 28px;
    text-align: right;
    margin-bottom: 20px;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 10px 15px;
    box-sizing: border-box;
    color: #34495e;
    background-color: #ecf0f1;
}

.keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 15px;
}

button {
    font-size: 22px;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: #3498db;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
    background-color: #2980b9;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* History Styles */
.history {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 240px;
    max-height: 450px;
    overflow-y: auto;
}

.history h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.history ul {
    list-style-type: none;
    padding: 0;
}

.history li {
    font-size: 20px;
    color: #34495e;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

/* Scrollbar Styling */
.history::-webkit-scrollbar {
    width: 8px;
}

.history::-webkit-scrollbar-thumb {
    background-color: #3498db;
    border-radius: 10px;
}

.history::-webkit-scrollbar-track {
    background-color: #ecf0f1;
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .flex-container {
        flex-direction: column;
        align-items: center;
    }

    .calculator {
        width: 90%;
        margin-bottom: 20px;
    }

    .history {
        width: 90%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 28px;
    }

    .calculator {
        padding: 15px;
    }

    #display {
        height: 50px;
        font-size: 24px;
    }

    button {
        font-size: 18px;
        padding: 12px;
    }

    .history h2 {
        font-size: 24px;
    }

    .history li {
        font-size: 18px;
    }
}
