:root {
    --background-light: #f4f4f4;
    --background-dark: #1e1e1e;
    --primary-light: #007bff;
    --primary-dark: #4a90e2;
    --text-light: #333;
    --text-dark: #f4f4f4;
    --border-light: #ccc;
    --border-dark: #555;
    --input-background-light: #fff;
    --input-background-dark: #2e2e2e;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--background-light);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

#main {
    width: 90%;
    max-width: 800px;
    background-color: var(--input-background-light);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: background-color 0.3s;
}

h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--input-background-dark);
}

#userStatus {
    margin-bottom: 20px;
}

#statusMessage {
    font-size: 18px;
    color: var(--text-light);
    background-color: var(--primary-dark);
    padding: 10px;
    border-radius: 5px;
}

i{
    color: black;
}

.converter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.flag {
    width: 40px;
    height: 40px;
}

select,
input[type="number"] {
    padding: 8px;
    font-size: 16px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    flex-grow: 1;
    max-width: 150px;
    background-color: var(--input-background-light);
    color: var(--text-light);
    transition: background-color 0.3s, border-color 0.3s;
    outline-color: orange;

}

input[type="number"] {
    width: 100%;
}

.arrow > i{
    font-size: 24px;
    color: var(--text-light);
}

button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    background-color: var(--primary-light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--primary-dark);
}

#toggleThemeBtn {
    margin-top: 10px;
}

#Output2{
    border: 1px solid;
    padding: 10px 20px;
    max-width: 130px;
    min-width: 100px;
    overflow-x:auto;
    border-radius: 5px;
}

@media (max-width: 320px) {
    body {
        font-size: 14px;
    }

    #main {
        width: 100%;
        padding: 10px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .converter {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group {
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-bottom: 10px;
    }

    .input-group img.flag {
        width: 30px;
        height: 30px;
        margin-bottom: 10px;
    }

    select,
    input[type="number"] {
        width: 100%;
        font-size: 14px;
        padding: 6px;
        margin: 4px 0;
    }

    .arrow i{
        font-size: 18px;
        transform: rotate(90deg);
    }

    #Output2 {
        font-size: 14px;
        margin-top: 10px;
    }

    button {
        width: 100%;
        padding: 8px;
        font-size: 14px;
    }
}

@media (min-width: 320px) and (max-width: 420px) {
    body {
        font-size: 16px;
    }

    #main {
        width: 95%;
        padding: 15px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .converter {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .input-group {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .input-group img.flag {
        width: 40px; 
        height: 40px;
        margin-bottom: 10px;
    }

    select,
    input[type="number"] {
        width: 100%;
        font-size: 16px;
        padding: 8px;
        margin: 5px 0;
    }

    .arrow i{
        font-size: 28px;
        margin: 10px 0;
        transform: rotate(90deg);
    }

    #Output2 {
        font-size: 16px;
        margin-top: 10px;
    }

    button {
        width: 100%;
        padding: 10px;
        font-size: 16px;
    }

    #toggleThemeBtn {
        margin-top: 15px; 
    }
}

@media (min-width: 420px) and (max-width: 700px) {
    body {
        font-size: 16px; 
        overflow: hidden; 
    }

    #main {
        width: 90%;
        max-width: 600px; 
        padding: 15px;
        box-sizing: border-box; 
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: auto;
    }

    #inner {
        padding: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 15px;
        text-align: center; 
    }

    .converter {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        width: 100%;
    }

    .input-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 500px; 
        margin: 0 auto; 
    }

    .input-group img.flag {
        width: 40px; 
        height: 40px;
        margin-bottom: 5px;
    }

    select,
    input[type="number"] {
        width: 100%;
        font-size: 16px;
        padding: 8px;
        margin: 4px 0;
        box-sizing: border-box;
    }

    .arrow i {
        transform: rotate(90deg);
        font-size: 24px; 
        margin: 10px 0;
        text-align: center;
    }

    #Output2 {
        font-size: 16px;
        margin-top: 10px;
    }

    button {
        width: 100%;
        padding: 10px;
        font-size: 16px;
        box-sizing: border-box; 
    }

    #convertBtn {
        margin-bottom: 15px; 
    }

    #toggleThemeBtn {
        font-size: 16px; 
        height: 40px; 
    }

    .input-group select,
    .input-group input {
        max-width: 100%;
    }

    .converter {
        margin-bottom: 10px; 
    }
}

@media (min-width: 700px) {
    body {
        font-size: 18px; 
    }

    #main {
        max-width: 800px; 
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .converter {
        flex-direction: row;
        justify-content: space-between;
    }

    .input-group {
        flex-direction: row;
        align-items: center;
        gap: 20px;
        max-width: 700px; 
    }

    .input-group img.flag {
        width: 50px;
        height: 50px;
    }
  
    select,
    input[type="number"] {
        width: auto; 
        font-size: 18px;
        padding: 10px;
    }

    .arrow i{
        font-size: 30px;
        margin: 0 20px;
    }

    button {
        width: auto;
        padding: 12px 24px;
        font-size: 18px;
    }
}

body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

body.dark-mode #main {
    background-color: var(--input-background-dark);
}

body.dark-mode select,
body.dark-mode input[type="number"] {
    background-color: var(--input-background-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-mode .input-group:last-of-type input {
    border-color: var(--primary-dark);
}

body.dark-mode h1, body.dark-mode  .arrow >i {
    color: var(--input-background-light);
}