/* General chart styles */
.chart {
    margin-bottom: 10px;
}

.chart-section {
    border-right: 1px solid #C1C1C1;
}
.chart-section:last-child {
    border-right: none;
}
.chart-view >a{
    text-decoration: none;
}
.div-chart {
    width: 250px;
    height: 175px;
    margin: 0 auto;
    cursor: pointer;
    color: white;
    overflow: hidden;
}
.div-chart > h3 {
    padding: 0.5em;
    margin-left: 0; 
    margin-right: 0;
}

/************************* Map View Chart *****************/
#map[data-controller="map-view"] {
    min-height: 400px;
    min-width: 100%;
    background: #e7e8ea;
}

/*********  Analytics template **************/
.charts-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    width: 100%;
    margin: 0 auto;
}

.chart-box {
    flex: 1 1 40%;       
    min-width: 320px;    
    max-width: 500px;        
    height: 350px;           
    background-color: black;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5em;
    border-radius: 20px;
    border: 1px solid white;
}

/****************** Bar Chart Show ******************/
.chart-div {
    flex: 1 1 0;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.chart-div > div,
.chart-div canvas,
.chart-div svg {
    max-width: 100%;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
    display: block;
}

.charts-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    margin: 0 auto;
    flex-wrap: wrap;
    min-width: 0;
}

.chart-titles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
}

.chart-div:first-child {
    flex: 0 0 40%;
    max-width: 40%;
}

.chart-div:last-child {
    flex: 0 0 60%;
    max-width: 60%;
} 

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.month-selector {
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.chart-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.table-section {
    overflow-x: auto;
}

.table-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: center;
}

.table-section th,
.table-section td {
    border: 1px solid #ccc;
    padding: 0.3rem 0.5rem;
}

.table-section thead>tr th {
    background-color: #f9f9f9;
    font-weight: bold;
    color: black;
}

.table-section tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

/* Responsive styles for charts grid and chart sections */
.charts-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    width: 100%;
    margin: 0 auto;
}

.chart-section {
    flex: 1 1 320px;
    min-width: 260px;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .charts-grid {
        flex-direction: column;
        gap: 16px;
    }
    .chart-section {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .charts-grid {
        gap: 8px;
    }
    .chart-section {
        padding: 0 4px;
        margin-bottom: 12px;
    }
    .chart-title {
        font-size: 1em;
    }
}
