/* Centered container for the table with a max-width */
.table-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    overflow: hidden; /* Ensures border-radius is respected by the table */
    max-width: 900px;
    margin: 2rem auto 0 auto; /* Centers the container */
}

.prospects-table {
    width: 100%;
    border-collapse: collapse;
}

.prospects-table th,
.prospects-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.prospects-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

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

.prospects-table td {
    font-size: 0.95rem;
}

.prospects-table tbody tr:hover {
    background-color: #f9f9f9;
}

.col-handle { width: 40%; }
.col-rank, .col-karma, .col-days { width: 20%; text-align: center; }

.prospects-table td:not(:first-child) {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 1rem;
}

/* --- Sorting Styles --- */
.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sortable .sort-arrow {
    display: inline-block;
    width: 1em;
    height: 1em;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.sortable:hover {
    background-color: #f1f3f5;
}

.sortable:hover .sort-arrow {
    opacity: 0.8;
}

.sortable .sort-arrow::after {
    content: '↕';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.sortable.sorted-asc .sort-arrow::after {
    content: '↑';
}

.sortable.sorted-desc .sort-arrow::after {
    content: '↓';
}

.sortable.sorted-asc .sort-arrow,
.sortable.sorted-desc .sort-arrow {
    opacity: 1;
}

/* --- Dark Mode --- */
.dark-mode .table-container {
    background-color: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dark-mode .prospects-table th {
    background-color: #2c2c2c;
    color: #aaa;
}

.dark-mode .prospects-table td {
    border-bottom-color: #333;
}

.dark-mode .prospects-table tbody tr:hover {
    background-color: #2a2a2a;
}

.dark-mode .sortable:hover {
    background-color: #383838;
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {
    .mobile-hide {
        display: none;
    }

    .prospects-table th,
    .prospects-table td {
        padding: 0.8rem 0.75rem; /* Reduce padding on mobile */
    }

    .col-handle { width: 40%; }
    .col-rank, .col-days { width: 30%; } /* Updated widths */

    .sortable .sort-arrow::after {
        right: 0.5rem; /* Adjust arrow position */
    }
}