:root {
    --dark-bg: #1E293B;
    --slate: #334155;
    --darkest: #0F172A;
    --light-bg: #E2E8F0;
    --blue: #2563EB;
    --green: #22C55E;
    --orange: #F59E0B;
    --red: #EF4444;
    --purple: #8B5CF6;
}

body {
    background-color: var(--light-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.display {
    background-color: var(--darkest);
    color: white;
    text-align: right;
    padding: 40px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 2.5rem;
    font-weight: 600;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.expression {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
    min-height: 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.result {
    outline: none;
    caret-color: #22C55E;
    font-size: 2.5rem;
    font-weight: 600;
    text-align: right;
    overflow-x: auto;
    white-space: nowrap;
}

.result::-webkit-scrollbar {
    display: none;
}

.result {
    scrollbar-width: none;
}

.calculator {
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    width: 500px;
    background-color: var(--dark-bg);
}

button:hover{
     cursor: pointer;
     background: var(--dark-bg);
}

button:focus {
    outline: none;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

button {
    background-color: var(--slate);
    color: var(--light-bg);
    border: none;
    border-radius: 20px;
    height: 100px;
    font-size: 1.5rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.ac {
    background-color: var(--red);
    color: white;
}

.c {
    background-color: var(--orange);
    color: white;
}

.percent {
    background-color: var(--purple);
    color: white;
}

.op {
    background-color: var(--blue);
    color: white;
}

.equal {
    background-color: var(--green);
    color: white;
}

.zero {
    grid-column: span 2;
}

@media screen and (max-width: 480px) {
    .calculator {
        width: 90%;
        max-width: 300px;
    }

    button {
        height: 50px;
        font-size: 1.2rem;
    }
}