/* Estilos Gerais do Módulo */
.esic-stats-module {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

/* Contêiner do Filtro */
.esic-stats-module .filter-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Aumenta o espaçamento */
    margin-bottom: 20px;
    min-width: 250px; /* Garante espaço para o label */
}

.esic-stats-module .export-buttons {
    text-align: end;
}


.esic-stats-module .export-buttons button{
    padding: 3px 10px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.esic-stats-module .filter-container label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

@media only screen and (min-width: 468px) and (max-width: 992px) {
    .esic-stats-module .charts-container {
        display: flex;
        flex-direction: column;
    }
}

@media only screen and (max-width: 450px) {
    .esic-stats-module .filter-container label {
        display: none;
    }
}

.esic-stats-module .filter-container select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    min-width: 200px; /* Aumenta a largura mínima */
    transition: border-color 0.2s;
}

.esic-stats-module .filter-container select:focus {
    outline: none;
    border-color: #007bff;
}

/* Tabela de Estatísticas */
.esic-stats-module table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.esic-stats-module th,
.esic-stats-module td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.esic-stats-module thead th {
    background-color: #007bff;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.esic-stats-module tbody tr:nth-of-type(even) {
    background-color: #f2f2f2;
}

.esic-stats-module tbody tr:hover {
    background-color: #e9ecef;
}

/* Botões de Ação */
.esic-stats-module .download-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    margin-right: 5px;
}

.esic-stats-module .download-btn.csv-btn {
    background-color: #28a745;
}

.esic-stats-module .download-btn.json-btn {
    background-color: #17a2b8;
}

.esic-stats-module .download-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Contêiner dos Gráficos */
.esic-stats-module .charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-around;
    margin-top: 20px;
}

.esic-stats-module .chart-wrapper {
    position: relative;
    flex: 1 1 45%;
    min-width: 250px;
    max-height: 500px; /* Aumenta a altura máxima */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.esic-stats-module .chart-wrapper canvas {
    max-width: 100%;
    max-height: 350px; /* Limita a altura do canvas */
    height: auto !important; /* Garante que a altura seja automática */
    margin: 0;
}

.esic-stats-module .chart-wrapper h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #444;
    font-size: 1.1rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .esic-stats-module .charts-container {
        flex-direction: column;
    }

    .esic-stats-module .chart-wrapper {
        flex-basis: 100%;
    }
}
