@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;500;600;700&display=swap');

:root {
    --bg: #2b2625;
    --description: #a7a7a7;
    --btn: #171614;
    --text: #ffffff;
    --base-font-size: 24px;
}

html {
    font-size: var(--base-font-size);
}

body {
    background-color: var(--bg);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text);
    overflow: auto; /* Allow scrolling */
}

.wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
    width: 100%;
    max-width: 800px;
}

#title {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    text-shadow: 1px 1px 8px rgba(111, 118, 146, 0.4);
    transition: text-shadow 0.3s ease-in-out;
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
}

.divider {
    margin: 20px 0;
    font-size: 1.2rem;
    color: var(--description);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.divider span {
    margin-bottom: 2px; /* Decrease space between text and divider */
}

.divider hr {
    width: 80%; /* Make the divider wider */
    border: 0;
    border-top: 1px solid var(--description);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 40px; /* Increase spacing between input fields */
    width: 100%;
}

.grid-container > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px; /* Add space between divs */
}

div h2 {
    margin-bottom: 10px; /* Add margin below the currency name */
}

input[type="number"] {
    width: 100%;
    padding: 0.3125rem; /* 5px to rem */
    margin: 0; /* Remove margin */
    font-size: 1rem; /* 16px to rem */
    border: 0; /* 0px to rem */
    border-radius: 0.3125rem; /* 5px to rem */
    color: var(--text);
    background-color: var(--btn);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5); /* 2px and 4px to rem */
    transition: box-shadow 0.3s ease-in-out;
    text-align: center; /* Center the numbers inside the input fields */
}

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

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

/* Footer styling */
footer {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--description);
}

/* Media Queries */

/* Small devices (phones, 600px and down) */
@media (max-width: 600px) {
    :root {
        --base-font-size: 16px;
    }

    html {
        font-size: var(--base-font-size);
    }

    body {
        padding: 5px;
    }

    #title {
        font-size: 1.2rem;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 40px; /* Increase spacing between input fields */
    }

    .wrapper {
        width: 100%;
    }
}

/* Medium devices (tablets, 600px to 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    :root {
        --base-font-size: 20px;
    }

    html {
        font-size: var(--base-font-size);
    }

    body {
        padding: 10px;
    }

    #title {
        font-size: 1.5rem;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 40px; /* Increase spacing between input fields */
    }

    .wrapper {
        width: 80%;
    }
}

/* Large devices (desktops, 768px and up) */
@media (min-width: 769px) {
    :root {
        --base-font-size: 24px;
    }

    html {
        font-size: var(--base-font-size);
    }

    body {
        padding: 15px;
    }

    #title {
        font-size: 2rem;
    }

    .grid-container {
        grid-template-columns: repeat(4, 1fr); /* Ensure max 4 input fields per row */
        gap: 40px; /* Increase spacing between input fields */
    }

    .wrapper {
        width: 60%;
    }
}