@font-face {
    font-family: "Museo Sans 500";
    src: url(../font/MuseoSans_500.otf);
}

:root {
    --rate-table-header-color: #ffffff;
    --rate-table-buy-sell-color: #000000;
    --rate-table-background-color: #ffffff;
    --rate-table-border-color: #000000;
    --rate-table-border-thickness: 2px;
    --header-font-size: 2vh;
    --cell-font-size: 1.5vw;
    --flag-width: calc(3.5vh * 1.5); /* 3:2 aspect ratio based on height */
    --flag-height: 3.5vh;
    --header-height: 4vh;
    --row-height: 3.5vh;
    --padding-left: 0.5vh;
}

.currency-table {
    border-collapse: collapse;
    width: 100%;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

.currency-widget-table-header {
    background-color: #4D72FA;
    color: #faff4e;
    font: bold var(--header-font-size) Arial; /* Larger font size for header */
    height: var(--header-height); /* Relative height for header */
}

tr.row_even,
tr.row_odd {
    background-color: var(--rate-table-background-color);
    font-family: DS-Digital, Arial;
    font-size: var(--cell-font-size); /* Font size for rows */
    color: #000000;
    border: var(--rate-table-border-thickness) solid var(--rate-table-border-color);
    height: var(--row-height); /* Relative height for rows */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

td {
    font-size: var(--cell-font-size); /* Font size for cells */
    padding: 0.5vh; /* Reduced padding */
    font-family: "Museo Sans 500", DS-Digital, Arial;
    vertical-align: middle;
    text-align: center;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

td.flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--flag-width); /* 3:2 aspect ratio based on height */
    height: var(--flag-height); /* Relative height for flag cells */
    margin-left: auto;
    margin-right: auto;
}

td.flag img {
    width: 100%; /* Stretch the flag images to fit within the cells */
    object-fit: fill; /* Ensures the image is stretched to fit the area */
    border: 1px solid grey; /* Add thin grey border */
}

.inversebuy,
.buy,
.sell,
.country,
.code {
    text-align: center;
    border: var(--rate-table-border-thickness) solid var(--rate-table-border-color);
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

.country {
    text-align: left;
    padding-left: var(--padding-left); /* Ensure left padding stays as it is */
}

.headerbuy,
.headersell,
.header {
    color: var(--rate-table-header-color);
    background-color: #ff0000;
    border: var(--rate-table-border-thickness) solid var(--rate-table-border-color);
    text-align: center;
    font-size: var(--header-font-size); /* Font size for header */
    height: var(--header-height); /* Relative height for header */
}

table .header {
    border-collapse: collapse;
    font-family: DS-Digital, Arial;
}

#currency_table {
    display: flex;
    justify-content: center; /* Center the container */
    align-items: center;
    gap: 0.5rem; /* Reduced space between the tables */
    width: 100%; /* Ensure the container takes 100% of the available width */
    margin: 0 auto; /* Center the container */
    flex-wrap: wrap;
}

.split-table {
    display: flex;
    justify-content: center; /* Center the tables within the container */
    gap: 0.5rem; /* Reduced space between the tables */
    width: 100%; /* Ensure the split-table takes full width of currency_table */
}

.split-table table {
    flex: 1 1 45%; /* Allow the tables to take up 45% each and grow/shrink */
    min-width: 45%;
    box-sizing: border-box; /* Ensure padding and border are included in the width and height */
}

.rate_table_row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    background-color: #FFF;
    text-align: center;
    vertical-align: top;
}

.rate_table_row > div {
    flex: 1 1 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 600px) {
    .rate_table_row > div {
        flex: 1 1 45%;
        max-width: 45%;
    }

    td {
        font-size: var(--cell-font-size)
    }
}

/* Media query for portrait mode */
@media (orientation: portrait) {
    :root {
        --flag-width: calc(3.5vh * 1.5); /* 3:2 aspect ratio based on half the original height */
        --flag-height: 3.5vh;
        --header-font-size: 1.6vh;
        --cell-font-size: 1.6vh; 
        --header-height: 3vh; 
        --row-height: 3.5vh; 
    }
}
