* {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-weight: 500;

}

*::selection {
    background-color: gray;
    color: white;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to right top, #0f0c29, #302b63, #24243e);
    color: white;
}

#outer-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    padding: 2%;
}

#container {
    font-weight: 400;
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 0.5rem 0.5rem;

    margin: 0.5rem;
}

#top-row {
    grid-row: 1 / span 1;
    grid-column: 1 / span 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 0.5rem;
}

#numbers {
    grid-row: 2/ span 3;
    grid-column: 1/ span 3;

    display: grid;
    grid-template-rows: repeat(3, 1fr);
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 0.5rem 0.5rem;

}

#right-side {
    grid-row: 2/ span 4;
    grid-column: 4/ span 1;

    display: grid;
    grid-template-rows: repeat(4, 1fr);
    grid-gap: 0.5rem 0.5rem;
}

#lower-row {
    grid-row: 5/span 1;
    grid-column: 1/span 3;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 0.5rem 0.5rem;
}


.digit, .operator, .function-btn {
    font-size: 1.25rem;
    cursor: pointer;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    height: 4rem;
    width: 4rem;

    transition: all 0.3s ease;
}

.function-btn {
    width: 100%;
    border-radius: 2rem;
}

.digit:hover, .operator:hover, .function-btn:hover {
    transform: scale(1.1);
    border: 2px solid #ff00cc;
    background: rgba(0, 0, 0, 0.6);
    color: #00d2ff;
    box-shadow: 0 0 20px #ff00cc, 0 0 40px #00d2ff;
}

#calculation-input {
    font-size: 1rem;
    padding: 0 1rem 0 1rem;
    margin: 0.5rem 0 0.5rem 0;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10rem;
    width: 15rem;
    height: 2.5rem;
    text-align: right;
}

#calculation-input:focus {
    outline: none;
    border: 1px solid #ff00cc;
    box-shadow: 0 0 10px rgba(255, 0, 204, 0.5);
}

/* Remove autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-background-clip: text;
    -webkit-text-fill-color: white;
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 20px 20px rgba(0, 0, 0, 0);
}

@media (max-width: 480px) {
    #outer-box {
        padding: 1rem;
        width: 90%;
        max-width: 350px;
    }

    .digit, .operator, .function-btn {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1rem;
    }
    
    .function-btn {
        width: 100%;
    }

    #calculation-input {
        width: 12rem;
        font-size: 1.2rem;
    }
}

@media (max-width: 350px) {
    .digit, .operator, .function-btn {
        width: 3rem;
        height: 3rem;
        font-size: 0.9rem;
    }

    .function-btn {
        width: 100%;
    }

    #calculation-input {
        width: 10rem;
    }
}