html, body {
    max-width: 100vw;
    overflow-x: hidden;
}
.controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-container {
    flex-grow: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
}

.table-container {
    position: relative;
    margin: 20px 0;
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
}

thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

th {
    position: relative;
    cursor: pointer;
    z-index: 1;
    padding-bottom: 40px; /* Make room for filter dropdown */
}

td {
    font-size: 0.75em;
}

th, td {
    text-align: left;
    vertical-align: top;
}

/* Updated filter styles */
.column-filter {
    position: relative;
    height: 100%;
    width: 100%;
    border-radius: 2px;
    cursor: pointer;
}

.filter-container {
    position: absolute;
    top: 0.25em;
    right: 0.5em;
    width: 1em;
    height: 1em;
}

.filter-image {
    width: 0.8em;
    height: 0.8em;
}

.filter-options-container {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.filter-dropdown {
    display: block;
    visibility: hidden;
    transform: scaleY(0);
    transform-origin: top;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    width: max-content;
    background-color: #2a2f4a;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 0.8em;
    border: 1px solid white;
}

.filter-dropdown.show {
    visibility: visible;
    transform: scaleY(1);
}

.filter-option {
    display: flex;
    align-items: center;
}

.filter-item {
    display:flex;
    align-items: center;
    padding: 0px;
/*    margin: -1em -2em;*/
}

.filter-item input[type="checkbox"] {
    margin: 0;
    padding: 0;
}

.filter-item label {
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.filter-item:hover {
    background-color: rgba(212, 212, 255, 0.035);
}

.filter-summary {
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    z-index: 2; 
}

.selected-count {
    position: absolute;
    background-color: purple;
    color: white;
    border-radius: 10px;
}


.stats-cell, .requirements-cell, .reward-cell {
    white-space: pre-line;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

.error {
    color: red;
    padding: 10px;
    border: 1px solid red;
    margin: 10px 0;
    background-color: #fff3f3;
}

th:hover {
/*    background-color: #45a049;*/
}

.filter-active {
/*    background-color: white;*/
}

.no-results {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

.stats-cell {
    white-space: pre-wrap;      /* Changed from pre-line */
    word-break: keep-all;       /* Prevents breaking within numbers */
/*    min-width: 80px;     */
    line-height: 1.4;          /* Adds some spacing between lines */
}
