body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

html {
    background-image: url("/static/images/background_light.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    min-height: 100%;
}


.layout-container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    max-width: 1000px;
    width: 100%;
}

.wrapper {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
    margin-top: 80px;
    margin-left: 150px;
    min-height: 100vh;
}

.calculator {
    background-color: #333;
    padding: 20px;
    border-radius: 15px;
    width: 320px;
    box-shadow: 0 0 20px #000;
    flex-shrink: 0;
}

.screen {
    background-color: #111;
    color: #0f0;
    font-size: 28px;
    text-align: right;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    min-height: 40px;
    word-break: break-word;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.span-two {
    grid-column: span 2;
}

button {
    font-size: 20px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background-color: #444;
    color: white;
    cursor: pointer;
}

button.operator {
    background-color: #f57c00;
}

button.equal {
    background-color: #0d47a1;
    grid-column: span 2;
}

button.clear {
    background-color: #c62828;
}

button.backspace {
    background-color: #607d8b;
}

.history-box {
    background-color: #1e1e1e;
    border-radius: 10px;
    padding: 15px;
    width: 280px;
    max-height: 500px;
    overflow-y: auto;
    color: #ccc;
    box-shadow: 0 0 10px #000;
    flex-shrink: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.history-actions button {
    background-color: #444;
    color: white;
    border: none;
    padding: 5px 10px;
    margin-left: 5px;
    border-radius: 5px;
    cursor: pointer;
}

#history-list {
    list-style-type: none;
    padding-left: 0;
    margin-top: 10px;
}

#history-list li {
    margin-bottom: 8px;
    font-size: 14px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.auth-bar {
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    color: white;
}

.auth-bar a {
    color: #0bf;
    margin: 0 8px;
    text-decoration: none;
}

a.button {
    display: inline-block;
    padding: 10px 16px;
    background-color: #0d47a1;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

a.button:hover {
    background-color: #0a3690;
}

@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }

    .wrapper {
        flex-direction: column;
        align-items: center;
        margin: 0;
        min-height: auto;
    }

    .calculator,
    .history-box {
        width: 95%;
        max-width: 400px;
    }

    .history-box {
        max-height: none;
        overflow-y: visible;
    }

    .screen {
        font-size: 20px;
        padding: 10px;
    }

    .buttons button {
        font-size: 16px;
        padding: 10px;
    }

    .auth-bar {
        font-size: 14px;
    }

    .history-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}