/* assets/css/tracks-list.css
   The "Alla turer i en lista" page (/tracks/lista). Layout mechanics plus
   a light default look -- colors/typography are Oskar's design pass.
   Filter panel on the left (same groups as the map's panel on /tracks),
   table on the right; stacks panel-above-table on narrow screens. */

.tracks-list-page {
    max-width: 75rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.tracks-list-panel {
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* Stays in view while a long table scrolls past. */
    position: sticky;
    top: 1rem;
}

.tracks-filter-group label {
    margin-right: 0.75rem;
    white-space: nowrap;
}

.tracks-filter-label {
    margin-bottom: 0.15rem;
}

.tracks-activity-list {
    display: flex;
    flex-direction: column;
}

.activity-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    vertical-align: middle;
}

.tracks-view-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
}

.tracks-view-link svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.tracks-view-link:hover {
    text-decoration: underline;
}

.tracks-list-main {
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    min-width: 0;
}

.tracks-list-main h1 {
    margin: 0;
}

.tracks-list-count {
    margin: 0.25rem 0 1rem;
    color: var(--color-text-muted);
}

.tracks-list-table-wrap {
    overflow-x: auto;
}

/* Same look as the profile page's trip table (profile.css), but the
   headers are links here -- sorting happens on the server, since a
   client-side sort would only reorder the current page. */
.tracks-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tracks-list-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.tracks-list-table th a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.tracks-list-table th a:hover,
.tracks-list-table th[aria-sort] a {
    color: var(--color-text);
}

.tracks-list-table th[aria-sort]::after {
    margin-left: 0.4em;
    font-size: 0.75em;
}

.tracks-list-table th[aria-sort="ascending"]::after {
    content: "\25B2";
}

.tracks-list-table th[aria-sort="descending"]::after {
    content: "\25BC";
}

.tracks-list-table td {
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.tracks-list-table td.tracks-list-title {
    white-space: normal;
}

.tracks-list-table th:last-child,
.tracks-list-table td:last-child {
    text-align: right;
}

.tracks-list-table td a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
}

.tracks-list-table td a:hover {
    color: var(--color-accent);
}

.tracks-list-table tbody tr:nth-child(even) {
    background: var(--color-border);
}

.tracks-list-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tracks-list-pagination a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 50rem) {
    .tracks-list-page {
        grid-template-columns: minmax(0, 1fr);
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .tracks-list-panel {
        position: static;
    }

    /* Activities side by side instead of a long column on a phone. */
    .tracks-activity-list {
        flex-direction: row;
        flex-wrap: wrap;
        column-gap: 0.75rem;
    }
}
