/* SG PM2.5 Haze Heatmap Styles */

body {
    font-family: -apple-system, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Swiper container styling */
.swiper {
    width: 100%;
    max-width: 1000px;
    padding-bottom: 40px; /* Space for pagination */
}

.swiper-slide {
    height: auto;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
    max-width: 1000px;
    width: 100%;
}

h1 {
    font-size: 1.5rem;
    margin-top: 0;
    color: #1c1e21;
    text-align: center;
}

h2 {
    font-size: 1.2rem;
    margin-top: 20px;
    color: #1c1e21;
    text-align: center;
}

img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.meta {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #65676b;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-wrap: wrap;
}

.item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
}

.table-container {
    margin-top: 20px;
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
}

.data-table {
    border-collapse: collapse;
    width: 100%;
    font-family: -apple-system, sans-serif;
    font-size: 0.9rem;
    table-layout: fixed;
}

.data-table th, .data-table td {
    padding: 4px;
    text-align: center;
    font-weight: bold;
}

.data-table th:first-child, .data-table td:first-child {
    text-align: left;
    white-space: nowrap;
    font-size: 0.75rem;
    width: 110px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #333;
    color: white;
}

.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #eee;
    padding: 10px;
    font-size: 0.85rem;
    color: #65676b;
    text-align: center;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 600px) {
    .card {
        padding: 10px;
    }

    h1 {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 1rem;
    }

    .legend {
        gap: 10px;
        font-size: 0.7rem;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th, .data-table td {
        padding: 3px 1px;
        min-width: 35px;
    }

    .data-table th:first-child, .data-table td:first-child {
        width: 90px;
        font-size: 0.65rem;
    }
}

/* Ensure the Tabulator container doesn't force a horizontal scroll */
.tabulator {
    font-size: 0.75rem !important; /* Slightly smaller for better fit */
    border: none !important;
}

.tabulator-cell {
    padding: 4px 2px !important; /* Tighten up the cells */
}

/* Adjust table header font size for better fit */
.tabulator .tabulator-header .tabulator-col {
    font-size: 0.75rem !important;
}

/* 1. Hide the arrow container for all devices */
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {
    display: none !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 4px 2px !important;
}


/* 3. Force the sort icon to hide even if it's nested deep in mobile themes */
[class^="tabulator-arrow"] {
    display: none !important;
}


/* 2. Prevent the header text from truncating with ellipsis */
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
    text-overflow: clip !important;
    white-space: normal !important;
    overflow: visible !important;
}

/* 3. Ensure the table container allows the full width to be used */
.table-container {
    width: 100%;
    margin-top: 20px;
    overflow-x: auto; /* Keep this for smaller mobile screens */
}

/* Ensure the Tabulator element itself controls the scroll */
#haze-table {
    border-radius: 8px;
    overflow: hidden;
}

/* Remove the max-height from the container so it doesn't conflict */
.table-container {
    max-height: none !important;
    overflow: visible !imporstant;
}

