/* Chart and Table Responsive Styles */

/* General responsive chart container */
.chart-container {
    position: relative;
    margin: 0 auto;
    height: 300px;
    max-width: 100%;
    overflow-x: auto;
}

/* Make large charts more responsive on mobile */
.large-chart {
    height: 350px;
}

/* Responsive adjustments based on screen size */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
        max-width: 80%;
        margin: 0;
        padding: 0;
    }
    
    .large-chart {
        height: 300px;
    }
    
    /* Ensure data cards stack properly on mobile */
    .data-card {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    /* Fix for grid layouts on mobile */
    #income-chart {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 200px;
        max-width: 80%;
        margin: 0;
        padding: 0;
    }
    
    .large-chart {
        height: 250px;
    }
}

/* Responsive table styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    width: 100%;
}

.benefits-table {
    width: 100%;
    min-width: 500px; /* Ensure tables don't get too narrow and maintain readability */
    border-collapse: collapse;
}

.benefits-table th,
.benefits-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.benefits-table th {
    background-color: #f3f4f6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.benefits-table tr:last-child td {
    border-bottom: none;
}

/* Responsive table for very small screens */
@media (max-width: 480px) {
    .table-container {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        border-radius: 0;
    }
    
    .benefits-table {
        min-width: 400px;
    }
    
    .benefits-table th,
    .benefits-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

/* Responsive steps section */
.steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 2rem 0;
    gap: 20px;
}

.step {
    flex: 1 1 200px;
    padding: 1.5rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .steps {
        flex-direction: column;
    }
    
    .step {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Fix for benefitscal-login image */
.benefitscal-login {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
}
