* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    -webkit-fontso-smoothing: antialiased;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
}

#main-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

#header {
    text-align: center;
    margin-bottom: 30px;
}

#header img {
    width: 100px;
    margin-bottom: 10px;
}

#header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
}

#header p {
    font-size: 1rem;
    color: #7f8c8d;
}

#tables-container {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    /* flex-wrap: wrap; */
}

.table-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    flex: 1 1 calc(50% - 20px);
    min-width: 555px;
    max-width: 100%;
    /* overflow-x: auto; */
}

.table-card h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #34495e;
    display: flex;
    align-items: center;
    gap: 10px;
}

table {
    width: 50%;
    border-collapse: collapse;
    table-layout: auto;
}

th,
td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

th {
    background-color: #34495e;
    color: #fff;
    padding: 5px 10px;
    text-align: center;
}

tr:hover {
    background-color: #f1f1f1;
}

#dolar-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    justify-content: center;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

#dolar-container h2 {
    font-size: 1.5rem;
    color: #34495e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

#valorUSD {
    font-size: 1.6rem;
    font-weight: bold;
    color: #27ae60;
}

.table-card canvas {
    max-width: 90%;
    margin-top: 5px;
    border-radius: 8px;
    background: #fff;
    padding: 5px;
}

footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Estilos para os filtros */
#coin-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.coin-filter {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.3s;
}

.coin-filter.active {
    background: #34495e;
    color: white;
}

.coin-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* =================================================== */
/* RESPONSIVIDADE (NOVAS REGRAS ADICIONADAS ABAIXO) */
/* =================================================== */

@media (max-width: 1400px) {
    table {
        width: 100%;
        display: contents;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #tables-container {
        flex-wrap: wrap-reverse;
        display: flex
    }

    .table-card {
        flex: 1 1 100%;
        min-width: unset;
        justify-items: center;
    }

    #coin-filters {
        justify-content: center;
    }

    .coin-filter {
        flex: 0 1 calc(13% - 10px);
        font-size: 0.9rem;
        text-align: center;
        display: flex;
    }
}

@media (max-width: 1200px) {
    table {
        width: 100%;
        display: contents;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #tables-container {
        flex-wrap: wrap-reverse;
        display: flex
    }

    .table-card {
        flex: 1 1 100%;
        min-width: unset;
        justify-items: center;
    }

    #coin-filters {
        justify-content: center;
    }

    .coin-filter {
        flex: 0 1 calc(14% - 10px);
        font-size: 0.9rem;
        text-align: center;
        display: flex;
    }
}

@media (max-width: 780px) {
    table {
        width: 100%;
        display: contents;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #coin-filters {
        justify-content: center;
        display: flex;
    }

    .coin-filter {
        flex: 0 1 calc(14% - 10px);
        font-size: 0.9rem;
        text-align: center;
        display: flex;
    }
}

@media (max-width: 600px) {
    #header h1 {
        font-size: 2rem;
    }

    #header p {
        font-size: 1rem;
    }

    .table-card {
        padding: 15px;
    }

    th,
    td {
        padding: 8px;
        font-size: 0.9em;
    }

    #dolar-container h2 {
        font-size: 1.3rem;
    }

    #valorUSD {
        font-size: 1.5rem;
    }

    #coin-filters {
        justify-content: center;
    }

    .coin-filter {
        flex: 0 1 calc(14% - 10px);
        font-size: 0.7rem;
        text-align: center;
        display: flex;
    }
}

@media (max-width: 540px) {
    #header img {
        width: 80px;
    }

    #header h1 {
        font-size: 1.2rem;
    }

    .table-card h2 {
        font-size: 1.1rem;
    }

    th,
    td {
        padding: 4px;
        font-size: 0.70em;
    }

    #coin-filters {
        justify-content: center;
        /* display: flex; */
    }

    .coin-filter {
        flex: 0 1 calc(13% - 10px);
        padding: 8px 10px;
        font-size: 0.7rem;
        text-align: center;
        display: flex;
    }
}

@media (max-width: 430px) {
    #header img {
        width: 50px;
    }

    #header h1 {
        font-size: 1rem;

    }

    .table-card {
        padding: 10px;
        justify-content: center;
    }

    .table-card h2 {
        font-size: 1rem;
    }

    th,
    td {
        padding: 4px;
        font-size: 0.75rem;
    }

    #dolar-container h2 {
        font-size: 1rem;
    }

    #valorUSD {
        font-size: 1rem;
    }

    #coin-filters {
        justify-content: center;
    }

    .coin-filter {
        flex: 0 1 calc(2% - 10px);
        padding: 7px 10px;
        font-size: 0.7rem;
        text-align: center;
        display: flex;
    }
}
