* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: white;
    font-family: "Poppins", serif;
}

body {
    background-image: url("bg.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1); /* Black overlay with 50% opacity */
    z-index: -1; /* Ensures it stays behind your content */
  }

.container {
    padding: 48px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 48px 0px rgba(61, 61, 61, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 600px;
}

.head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.head div{
    margin-top: 4px;
}

h1 {
    font-size: 1.5em;
    text-shadow: 1px 1px 16px rgba(61, 61, 61, 0.8);
    text-align: center;
}

#averageForm {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-field {
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 16px;
}

.input-field label {
    max-width: 250px;
    text-shadow: 1px 1px 8px rgba(61, 61, 61, 0.8);
}

.input-field input {
    background: transparent;
    border: none;
    border-bottom: 1px solid white;
    text-align: center;
}

.input-field input:focus{
    outline: none;
    border: none;
    border-bottom: 1px solid white;
}

/* Hide spinner for Chrome, Edge, and Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Hide spinner for Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="submit"] {
    margin-top: 16px;
    padding: 8px;
    border: none;
    cursor: pointer;
    border: 1px solid white;
    background: transparent;
    border-radius: 8px;
    transition: 0.3s;
    font-size: 14px;
}

input[type="submit"]:hover {
    border: none;
    border: 1px solid transparent;
    background: white;
    color: #5914BC;
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.1);
}

.result {
    display: none;
    font-style: italic;
    margin-top: 16px;
    margin-bottom: -8px;
    text-align: center;
    text-shadow: 1px 1px 8px rgba(61, 61, 61, 0.8);

}

@media screen and (max-width: 500px) {

    body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        overflow: hidden;
    }

    .container {
        padding: 32px;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 48px 0px rgba(61, 61, 61, 0.3);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        max-width: none;
        width: 100%;
        height: 100%;
    }

    .input-field label {
        max-width: 210px;
        text-shadow: 1px 1px 8px rgba(61, 61, 61, 0.8);
    }

}
