/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    color: #e0e0e0;
    background-color: #121212; /* Dark background */
}

h1, h2, label {
    color: #ffffff;
}

/* Container */
.container {
    padding: 0 1rem 1rem 1rem;
}

/* Form */
form.chart-filter {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

select {
    background-color: #2c2c2c;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 0.5rem;
}

button {
    background-color: #3f51b5;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #5c6bc0;
}

/* Buttons Row */
.filter-filter {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Chart */
.chart-container {
    margin: 1rem 0;
    background-color: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
}

/* Set minimum height for the canvas */
canvas {
    display: block;
    width: 100%; /* Ensure the width scales properly */
    max-width: 100%;
    height: 1000px; /* Default to auto height */
    min-height: 300px; /* Set a minimum height for all devices */
}

/* Tables */
.table-container {
    margin-top: 1rem;
}

.table-section {
    margin-bottom: 2rem;
    background-color: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
}

thead th {
    background-color: #3a3a3a;
    color: #ffffff;
    text-align: left;
    padding: 0.75rem;
}

tbody td {
    padding: 0.75rem;
    border-top: 1px solid #3a3a3a;
}

/* Rate classes */
.rate-green {
    background-color: #388e3c; /* Green for increasing rates */
    color: #ffffff;
}

.rate-red {
    background-color: #d32f2f; /* Red for decreasing rates */
    color: #ffffff;
}

.rate-default {
    background-color: #616161; /* Neutral gray */
    color: #ffffff;
}

/* Scroll indicator */
.scroll-indicator {
    font-size: 0.85rem;
    color: #9e9e9e;
    margin-top: 0.5rem;
    text-align: center;
}

/* Responsiveness */
@media (min-width: 768px) {
    canvas {
        height: 500px !important;
        min-height: 300px; /* Increase the height on mobile for better usability */
    }

    form.chart-filter {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
        padding-bottom: 60px;
    }

    .filter-field {
        flex: 1;
    }

    .filter-filter {
        position: absolute;
        bottom: 1rem;
        right: 1rem;
        gap: 1rem;
    }

    .table-container {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .table-container h1 {
        margin: 0;
        flex-basis: 100%;
    }

    .table-section {
        flex: 1;
        min-width: 48%;
    }
}

@media (min-width: 1024px) {
    .table-section {
        min-width: 30%;
    }
}
