/*
 * Track.Hub Agenda — Frontend Stylesheet
 * Version: 1.3.0
 *
 * Changes v1.3.0:
 *   - Removed .tha-wrapper background
 *   - Parallelograms now have rounded corners (border-radius on pseudo before/after)
 *   - tha-cell--track narrower, tha-cell--info wider (more columns in grid)
 *   - tha-event-row::before accent stripe properly sized & aligned to skew angle
 *   - tha-track-bg gets clip-path left+right skewed edges matching the row shape
 */

/* ─── CSS Custom Properties ─────────────────────────────────────────────── */
.tha-wrapper,
.tha-track-widget {
    --tha-gold:        #FBB801;
    --tha-gold-dark:   #c4880a;
    --tha-blue:        #0496ff;
    --tha-blue-dark:   #0270c0;
    --tha-bg-glass:    rgba(18, 18, 22, 0.82);
    --tha-border:      rgba(255,255,255,0.07);
    --tha-border-gold: rgba(251,184,1,0.4);
    --tha-text:        #ffffff;
    --tha-text-muted:  #888888;
    --tha-text-dim:    #404040;
    --event-color:     #1565C0;

    /* Parallelogram cut size — used consistently everywhere */
    --tha-cut: 14px;

    font-family: Barlow, 'Helvetica Neue', Arial, sans-serif;
    color: var(--tha-text);
    font-size: 15px;
}

/* ─── Wrapper — NO background, NO border ────────────────────────────────── */
.tha-wrapper {
    overflow: visible;
    border: none;
    max-width: 100%;
    /* background intentionally omitted */
}

/*
 * ═══════════════════════════════════════════════════════════════════════════
 * PARALLELOGRAM SYSTEM
 *
 * clip-path cuts the shape: top-left corner cut (slanted /) and
 * bottom-right corner cut (slanted /) — same angle on all elements.
 *
 * For rounded feel we combine clip-path with a ::before border layer
 * that uses border-radius. The trick: the clip mask clips both layers,
 * so the border looks soft at the cut corners.
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* Shared parallelogram clip — referenced as a value below */
/* polygon: top-left cut | top-right | bottom-right cut | bottom-left */
/* With slight rounding added via SVG clip or border-radius on shell     */

/* ─── FILTER BAR ─────────────────────────────────────────────────────────── */
/*
 * BORDER TECHNIEK: .tha-filters-border = gouden wrapper (clip-path + goud)
 *                  .tha-filters        = donkere glasvulling, 1px kleiner
 */
.tha-filters-border {
    margin-bottom: 16px;
    background: var(--tha-border-gold);
    border-radius: 10px;
    clip-path: polygon(
        var(--tha-cut) 0%,
        100% 0%,
        calc(100% - var(--tha-cut)) 100%,
        0% 100%
    );
    padding: 1px;
    box-shadow: 0 4px 28px rgba(0,0,0,0.55);
    transition: background 0.2s;
}

.tha-filters {
    position: relative;
    padding: 16px 28px 14px 24px;
    background: var(--tha-bg-glass);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border-radius: 9px;
    clip-path: polygon(
        calc(var(--tha-cut) - 1px) 0%,
        100% 0%,
        calc(100% - var(--tha-cut) + 1px) 100%,
        0% 100%
    );
}

.tha-filter-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.tha-filter-row--main  { margin-bottom: 10px; }

/* ─── Search input ───────────────────────────────────────────────────────── */
.tha-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    height: 44px;
    display: flex;
    align-items: center;
    /* Gouden rand-laag: element zelf = goud, ::before = donkere vulling */
    background: rgba(255,255,255,0.18);
    border-radius: 6px;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    padding: 1px;
    transition: background 0.2s;
}

.tha-search-wrap:focus-within {
    background: var(--tha-gold);
}

.tha-search-wrap::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(18,18,22,0.92);
    border-radius: 5px;
    clip-path: polygon(7px 0%, 100% 0%, calc(100% - 7px) 100%, 0% 100%);
    pointer-events: none;
    z-index: 0;
    transition: background 0.2s;
}

.tha-search-wrap:focus-within::before {
    background: rgba(18,18,22,0.88);
}

.tha-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tha-text-muted);
    pointer-events: none;
    z-index: 2;
    width: 14px;
    height: 14px;
}

/* Override theme border with high specificity */
.tha-wrapper .tha-search-input,
.tha-wrapper .tha-search-input:focus,
.tha-wrapper input[type="text"].tha-search-input,
.tha-wrapper input[type="search"].tha-search-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 14px 0 42px;
    color: var(--tha-text);
    font-family: Barlow, sans-serif;
    font-size: 14px;
    position: relative;
    z-index: 1;
    height: 44px;
    box-sizing: border-box;
}

.tha-search-input::placeholder {
    color: var(--tha-text-muted);
    font-size: 13px;
}

/* ─── Filter group ───────────────────────────────────────────────────────── */
.tha-filter-group {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

/* ─── Select wraps ───────────────────────────────────────────────────────── */
.tha-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 44px;
    padding: 0 18px;
    color: var(--tha-text-muted);
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    transition: color 0.15s;
}

/* Gouden rand-laag op het element zelf */
.tha-select-wrap {
    background: rgba(255,255,255,0.18);
    border-radius: 6px;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    padding: 1px;
    transition: background 0.15s, color 0.15s;
}

.tha-select-wrap:hover,
.tha-select-wrap:focus-within {
    color: var(--tha-gold);
    background: var(--tha-gold);
}

/* Donkere vulling */
.tha-select-wrap::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(18,18,22,0.92);
    border-radius: 5px;
    clip-path: polygon(7px 0%, 100% 0%, calc(100% - 7px) 100%, 0% 100%);
    pointer-events: none;
    z-index: 0;
    transition: background 0.15s;
}

.tha-select-wrap:hover::before,
.tha-select-wrap:focus-within::before {
    background: rgba(18,18,22,0.85);
}

.tha-select-wrap > svg {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
	margin-left: 12px;
}

.tha-filter-select {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: inherit;
    font-family: Kinetika, KinetikaMedium, Barlow, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 1;
    padding-right: 2px;
}

.tha-filter-select option {
    background: #1a1a1a;
    color: #fff;
    font-family: Barlow, sans-serif;
    text-transform: none;
    letter-spacing: 0;
}

/* ─── Search button ──────────────────────────────────────────────────────── */
.tha-search-btn {
    position: relative;
    height: 44px;
    padding: 0 26px;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    z-index: 0;
    transition: filter 0.15s;
}

.tha-search-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--tha-blue) 0%, var(--tha-blue-dark) 100%);
    border-radius: 6px;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
    z-index: -1;
    box-shadow: 0 2px 14px rgba(4,150,255,0.35);
    transition: filter 0.15s;
}

.tha-search-btn:hover::before { filter: brightness(1.12); }

/* ─── Quick filter buttons ───────────────────────────────────────────────── */
.tha-quick-btn {
    position: relative;
    height: 44px;
    padding: 0 20px;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--tha-text-muted);
    font-family: Kinetika, KinetikaMedium, Barlow, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
    box-sizing: border-box;
    z-index: 0;
}

/* Gouden rand: element zelf, ::before = donkere vulling */
.tha-quick-btn {
    background: rgba(255,255,255,0.18) !important;
    border-radius: 6px;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.tha-quick-btn:hover,
.tha-quick-btn--active {
    color: var(--tha-gold);
    background: var(--tha-gold) !important;
}

.tha-quick-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(18,18,22,0.92);
    border-radius: 5px;
    clip-path: polygon(7px 0%, 100% 0%, calc(100% - 7px) 100%, 0% 100%);
    z-index: -1;
    transition: background 0.15s;
}

.tha-quick-btn:hover::before,
.tha-quick-btn--active::before {
    background: rgba(18,18,22,0.85);
}

/* Results count — now sits inline in the filter row */
.tha-results-count {
    font-size: 12px;
    color: #999;
    font-family: Barlow, sans-serif;
    white-space: nowrap;
    align-self: center;
    margin-left: 4px;
}

/* ─── Clear filters button ───────────────────────────────────────────────── */
.tha-clear-btn {
    position: relative;
    height: 44px;
    padding: 0 18px;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--tha-text-muted);
    font-family: Kinetika, KinetikaMedium, Barlow, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
    box-sizing: border-box;
    z-index: 0;
}

/* Gouden rand: element zelf = rood-tint rand, ::before = donkere vulling */
.tha-clear-btn {
    background: rgba(200,60,60,0.45) !important;
    border-radius: 6px;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.tha-clear-btn:hover {
    color: #e05555;
    background: #e05555 !important;
}

.tha-clear-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(18,18,22,0.92);
    border-radius: 5px;
    clip-path: polygon(7px 0%, 100% 0%, calc(100% - 7px) 100%, 0% 100%);
    z-index: -1;
    transition: background 0.15s;
}

.tha-clear-btn:hover::before {
    background: rgba(40,10,10,0.88);
}

/* ─── TABLE HEADER ───────────────────────────────────────────────────────── */
/* date(130) | track(1fr~240) | organizer(150) | type(145) | info(190) | action(115) */
.tha-table-header {
    display: grid;
    grid-template-columns: 130px 1fr 150px 145px 190px 115px;
    padding: 8px 0 6px;
    border-bottom: 1px solid rgba(251,184,1,0.15);
    margin-bottom: 6px;
}

.tha-col {
    padding: 0 10px;
    font-family: Kinetika, KinetikaMedium, Barlow, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #999;
}

/* ─── MONTH DIVIDER ──────────────────────────────────────────────────────── */
.tha-month-divider {
    position: relative;
    padding: 8px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: Kinetika, KinetikaBlack, Barlow, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(251,184,1,0.7);
    margin: 10px 0 6px;
    background: rgba(251,184,1,0.05);
    border-radius: 6px;
    clip-path: polygon(
        var(--tha-cut) 0%,
        100% 0%,
        calc(100% - var(--tha-cut)) 100%,
        0% 100%
    );
}

/* Gold border layer — borders removed, keep rule for specificity */
.tha-month-divider::before {
    content: none;
}

/* Line extending to right */
.tha-month-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(251,184,1,0.12);
}

/* Subsequent month dividers get extra space above */
.tha-month-divider--subsequent {
    margin-top: 50px;
}

/* ─── EVENT ROW ──────────────────────────────────────────────────────────── */
/* date(130) | track(1fr) | organizer(150) | type(145) | info(190) | action(115) */
.tha-event-row {
    display: grid;
    grid-template-columns: 130px 1fr 150px 145px 190px 115px;
    align-items: center;
    position: relative;
    min-height: 90px;
    margin-bottom: 8px;

    /* Glass fill */
    background: var(--tha-bg-glass);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);

    /* Rounded parallelogram */
    border-radius: 8px;
    clip-path: polygon(
        var(--tha-cut) 0%,
        100% 0%,
        calc(100% - var(--tha-cut)) 100%,
        0% 100%
    );

    box-shadow: 0 2px 16px rgba(0,0,0,0.45);
    transition: background 0.15s, box-shadow 0.15s;
}

.tha-event-row:hover {
    background: rgba(28, 28, 34, 0.92);
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

/*
 * Left accent stripe.
 *
 * The row uses clip-path polygon with a 14px diagonal cut at top-left.
 * overflow:hidden is removed so the ::before can bleed slightly, but clip-path
 * still clips the row background — the ::before lives INSIDE the clipped area.
 *
 * Strategy: make the stripe wide enough to fill the cut triangle (14px)
 * plus the visible stripe (6px) = 20px total. Apply a matching clip-path
 * to the stripe itself so its left edge follows the exact same diagonal.
 *
 * The stripe clip: top-left at (0,0), top-right at (20px,0),
 * bottom-right at (6px, 100%), bottom-left at (0, 100%)
 * This creates a parallelogram whose right edge is vertical (the stripe)
 * and whose left edge matches the row's diagonal cut.
 */
.tha-event-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 100%;
    background: var(--event-color);
    clip-path: polygon(0% 0%, 100% 0%, 6px 100%, 0% 100%);
    z-index: 4;
}

/* ─── CELLS ──────────────────────────────────────────────────────────────── */
.tha-cell {
    padding: 5px;
    position: relative;
    z-index: 1;
}

/* DATE */
.tha-cell--date {
    padding-left: 20px;
    padding-right: 8px;
    text-align: center;
}

.tha-date-number {
    font-family: Kinetika, KinetikaBlack, Barlow, sans-serif;
    font-weight: 900;
    line-height: 1;
    color: var(--tha-gold);
}

.tha-date-single { font-size: 34px; }
.tha-date-range  { font-size: 22px; }

.tha-date-month {
    font-family: Barlow, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.tha-days-badge {
    display: inline-block;
    margin-top: 5px;
    background: var(--event-color);
    color: #fff;
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}

/* ─── TRACK CELL ─────────────────────────────────────────────────────────── */
.tha-cell--track {
    position: relative;
    overflow: hidden;
    min-height: 90px;
    padding: 0;
    display: flex;
    align-items: stretch;
    /* Narrower: let 1fr resolve to ~200-220px based on available space */
}

/*
 * Track background — skewed LEFT and RIGHT edges to match the row's
 * parallelogram clip shape. Both left and right side have the / angle.
 * We use clip-path on the track-bg div itself.
 * The cut is 14px wide over 90px height ≈ same angle as the row.
 */
.tha-track-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 1;
    transition: opacity 0.3s;
    /* Skewed on both left and right edges */
    clip-path: polygon(
        14px 0%,
        100% 0%,
        calc(100% - 14px) 100%,
        0% 100%
    );
}

/* Fade overlay — left very dark → right transparent */
.tha-track-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(10,10,10,0.98)  0%,
        rgba(10,10,10,0.88)  22%,
        rgba(10,10,10,0.52)  58%,
        rgba(10,10,10,0.12) 100%
    );
}

.tha-track-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 0;
}

/* Circuit layout image */
.tha-circuit-img {
    flex-shrink: 0;
    width: auto !important;
    height: 75px !important;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.72);
    transition: filter 0.2s;
}

.tha-event-row:hover .tha-circuit-img {
    filter: brightness(0) invert(1) opacity(1);
}

/* SVG fallback */
.tha-circuit-svg {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.tha-circuit-svg svg { width: 100px; height: 100px; }

.tha-track-info {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.tha-track-name {
    display: block;
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
    letter-spacing: 0.3px;
}

a.tha-track-name:hover { color: var(--tha-gold); }

/* Clickable circuit layout image wrapper */
.tha-circuit-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.tha-circuit-img-link:hover {
    opacity: 0.75;
}

/* Info icon next to track name */
.tha-track-info-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    vertical-align: middle;
    transition: color 0.15s;
    position: relative;
    top: -1px;
}

.tha-track-name:hover .tha-track-info-icon {
    color: var(--tha-gold);
}

.tha-track-country {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.tha-flag-img {
    width: 20px;
    height: 15px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.tha-flag { font-size: 16px; line-height: 1; }

.tha-country-name {
    font-size: 14px;
    color: #ffffff;
    font-family: Barlow, sans-serif;
    font-weight: 500;
}

.tha-vehicle-tags {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.tha-vehicle-tag {
    font-family: Kinetika, Barlow, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
    color: var(--tha-text-muted);
    background: rgba(255,255,255,0.05);
    outline: 1px solid rgba(255,255,255,0.1);
}

/* ─── ORGANIZER ──────────────────────────────────────────────────────────── */
.tha-cell--org {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    margin: 0 auto;
}

.tha-org-logo-link,
.tha-org-logo-wrap {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
}

.tha-org-logo-link:hover {
    opacity: 0.8;
    transform: scale(1.04);
}

.tha-org-logo-img {
    max-width: 110px;
    max-height: 55px;
    object-fit: contain;
    /* Original colors — no filter */
}

.tha-org-name {
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

/* ─── TYPE ───────────────────────────────────────────────────────────────── */
.tha-cell--type {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 5px 8px;
}

.tha-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 16px;
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #fff;
    align-self: flex-start;
    border-radius: 4px;
    clip-path: polygon(7px 0%, 100% 0%, calc(100% - 7px) 100%, 0% 100%);
    position: relative;
    overflow: hidden;
}

/* Gradient overlay on badge (light top → dark bottom) */
.tha-type-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.18) 0%, rgba(0,0,0,0.28) 100%);
    pointer-events: none;
}

.tha-type-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--tha-text-muted);
}

.tha-type-note-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── INFO — wider column, icons wrap nicely ─────────────────────────────── */
.tha-cell--info {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    padding: 5px 8px;
    /* 190px column = room for 5×32px icons + gaps comfortably */
}

.tha-amenity-icon-display {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    clip-path: polygon(5px 0%, 100% 0%, calc(100% - 5px) 100%, 0% 100%);
    background: rgba(255,255,255,0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--tha-text-muted);
    cursor: default;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    outline: 1px solid rgba(255,255,255,0.08);
    outline-offset: -1px;
}

.tha-amenity-icon-display:hover {
    background: rgba(251,184,1,0.1);
    color: var(--tha-gold);
}

/* ─── ACTION ─────────────────────────────────────────────────────────────── */
.tha-cell--action {
    display: flex;
    justify-content: flex-end;
    padding-right: 20px;
    padding-left: 4px;
}

/* ─── DETAILS BUTTON ─────────────────────────────────────────────────────── */
.tha-details-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    height: 36px;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #000 !important;
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    z-index: 0;
    transition: filter 0.15s;
}

.tha-details-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--tha-gold) 0%, #c4880a 100%);
    border-radius: 5px;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
    z-index: -1;
    box-shadow: 0 2px 12px rgba(251,184,1,0.28);
    transition: filter 0.15s;
}

.tha-details-btn:hover        { color: #000 !important; filter: brightness(1.08); }
.tha-details-btn > *          { position: relative; z-index: 1; }
.tha-details-btn--sm          { height: 30px; padding: 0 14px; font-size: 10px; }

/* ─── EMPTY STATE ────────────────────────────────────────────────────────── */
.tha-no-events {
    padding: 48px 24px;
    text-align: center;
    color: var(--tha-text-muted);
    font-size: 15px;
}

/* ─── LOAD MORE ──────────────────────────────────────────────────────────── */
.tha-load-more-wrap {
    padding: 24px 20px;
    text-align: center;
    margin-top: 4px;
}

.tha-load-more-btn {
    position: relative;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 44px;
    height: 46px;
    color: var(--tha-gold);
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    min-width: 220px;
    z-index: 0;
    transition: filter 0.15s;
}

/* Gouden rand: element zelf = rand-laag, ::before = donkere vulling */
.tha-load-more-btn {
    background: rgba(251,184,1,0.45) !important;
    background-color: rgba(251,184,1,0.45) !important;
    clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
    border-radius: 6px;
    transition: background 0.15s, filter 0.15s;
	color: #fff;
}

.tha-load-more-btn:hover:not(:disabled) {
    background: var(--tha-gold) !important;
    background-color: var(--tha-gold) !important;
}

.tha-load-more-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--tha-bg-glass);
    border-radius: 5px;
    clip-path: polygon(11px 0%, 100% 0%, calc(100% - 11px) 100%, 0% 100%);
    backdrop-filter: blur(6px);
    z-index: -1;
    transition: background 0.15s;
}
.tha-load-more-btn:hover { color: #fff !important; }
.tha-load-more-btn:hover:not(:disabled)::before {
    background: rgba(18,18,22,0.80);
}

.tha-load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tha-load-more-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(251,184,1,0.3);
    border-top-color: var(--tha-gold);
    border-radius: 50%;
    animation: tha-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes tha-spin { to { transform: rotate(360deg); } }

.tha-pagination-count {
    font-size: 11px;
    color: #999;
    margin-top: 10px;
    font-family: Barlow, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ─── TRACK WIDGET ───────────────────────────────────────────────────────── */
.tha-track-widget {
    background: var(--tha-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 0 0 1px var(--tha-border-gold);
    border-radius: 8px;
    overflow: hidden;
}

.tha-track-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tha-track-widget__title {
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--tha-gold);
    margin: 0;
}

.tha-track-widget__count {
    background: rgba(251,184,1,0.12);
    color: var(--tha-gold);
    font-family: Barlow, sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}

.tha-track-widget__empty {
    padding: 20px 16px;
    color: #666;
    font-size: 13px;
    margin: 0;
}

.tha-track-widget__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.tha-track-widget__item {
    display: grid;
    grid-template-columns: 90px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-left: 3px solid var(--event-color);
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    transition: background 0.15s;
}

.tha-track-widget__item:hover { background: rgba(255,255,255,0.055); }

.tha-track-widget__date strong {
    font-family: Kinetika, KinetikaBold, Barlow, sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--tha-gold);
    line-height: 1;
    display: block;
}

.tha-track-widget__date span {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tha-track-widget__meta { display: flex; flex-direction: column; gap: 3px; }
.tha-track-widget__note { font-size: 11px; color: #666; }

.tha-track-widget__org {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.tha-track-widget__footer {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.tha-track-widget__view-all {
    color: var(--tha-gold);
    font-family: Kinetika, Barlow, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    transition: opacity 0.15s;
}

.tha-track-widget__view-all:hover { opacity: 0.75; }

/* Toggle knop en mobile-only elementen — verborgen op desktop */
.tha-filter-toggle    { display: none !important; }
.tha-date-track-info  { display: none; }
.tha-date-org         { display: none; }
.tha-mobile-type-inline { display: none; }

/* tha-mobile-meta wraps type + org for mobile layout.
   On desktop: acts as a transparent passthrough (display:contents) */
.tha-mobile-meta {
    display: contents;
}

/* ─── TABLET (max 1100px) ────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .tha-table-header,
    .tha-event-row {
        grid-template-columns: 120px 1fr 130px 130px 160px 110px;
    }
}

/* ─── MOBILE (max 700px) ─────────────────────────────────────────────────── */
@media (max-width: 700px) {

    /* ── Tabel header verbergen ──────────────────────────────────────── */
    .tha-table-header { display: none; }

    /* ── Filterbar — standaard verborgen, toggle onthult hem ─────────── */
    .tha-filters {
        padding: 0;
        margin-bottom: 10px;
        /* Clip-path blijft — zelfde schuine vorm als desktop */
    }

    /* Filter-toggle knop — beats Elementor/theme button styles */
    .tha-filter-toggle {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        height: 46px;
        padding: 0 20px;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: none !important;
        color: var(--tha-text-muted);
        font-family: Kinetika, Barlow, sans-serif;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
        cursor: pointer;
        clip-path: polygon(var(--tha-cut) 0%, 100% 0%, calc(100% - var(--tha-cut)) 100%, 0% 100%);
        transition: color 0.15s;
        position: relative;
    }

    /* Gouden rand op de toggle via element zelf + ::before als vulling */
    .tha-filter-toggle {
        background: var(--tha-border-gold) !important;
        clip-path: polygon(var(--tha-cut) 0%, 100% 0%, calc(100% - var(--tha-cut)) 100%, 0% 100%);
        border-radius: 6px;
        padding: 1px calc(var(--tha-cut) + 16px) !important;
    }

    .tha-filter-toggle::before {
        content: '';
        position: absolute;
        inset: 1px;
        background: var(--tha-bg-glass);
        border-radius: 5px;
        clip-path: polygon(calc(var(--tha-cut) - 1px) 0%, 100% 0%, calc(100% - var(--tha-cut) + 1px) 100%, 0% 100%);
        pointer-events: none;
        z-index: 0;
    }

    .tha-filter-toggle:hover,
    .tha-filter-toggle.active {
        background: var(--tha-gold) !important;
    }

    .tha-filter-toggle:hover,
    .tha-filter-toggle.active {
        color: var(--tha-gold);
    }

    .tha-filter-toggle-icon {
        font-size: 14px;
        transition: transform 0.2s;
    }

    .tha-filter-toggle.active .tha-filter-toggle-icon {
        transform: rotate(180deg);
    }

    .tha-filter-toggle-label { flex: 1; }

    .tha-filter-toggle-count {
        background: rgba(251,184,1,0.15);
        color: var(--tha-gold);
        font-size: 10px;
        padding: 1px 7px;
        clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
        display: none;
    }

    .tha-filter-toggle-count.has-filters {
        display: inline-block;
    }

    /* Filter inhoud — verborgen tot toggle actief */
    .tha-filters-body {
        display: none;
        padding: 12px 16px 14px;
        border-top: 1px solid rgba(251,184,1,0.15);
        flex-direction: column;
        gap: 8px;
    }

    .tha-filters-body.open {
        display: flex;
    }

    .tha-filter-row--main {
        flex-direction: column;
        gap: 8px;
    }

    .tha-search-wrap {
        min-width: 100%;
        height: 44px;
    }

    .tha-filter-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .tha-select-wrap {
        height: 44px;
        padding: 0 14px;
    }

    .tha-filter-actions {
        display: flex;
        gap: 8px;
    }

    .tha-search-btn,
    .tha-clear-btn {
        flex: 1;
        height: 44px;
    }

    /* Resultaten-teller */
    .tha-results-count {
        display: block;
        width: 100%;
        text-align: center;
        margin: 6px 0 0;
        font-size: 11px;
    }

    /* ── Maand-divider — schuine vorm behouden ───────────────────────── */
    .tha-month-divider {
        margin: 14px 0 6px;
    }

    .tha-month-divider--subsequent {
        margin-top: 28px;
    }

    /* ── EVENT RIJEN — kaartjes-layout, schuine hoeken behouden ─────── */
    .tha-event-row {
        display: block;
        position: relative;
        min-height: auto;
        margin-bottom: 10px;
        /* Clip-path schuine hoeken blijven */
        overflow: hidden;
    }

    /* Linker accent streep — zelfde clip-path als de rij zelf zodat de hoek klopt */
    .tha-event-row::before {
        top: 0;
        height: 100%;
        width: 20px;
        /* Zelfde parallelogram-wig als desktop: volgt de schuine linkerrand */
        clip-path: polygon(0% 0%, 100% 0%, 6px 100%, 0% 100%);
        transform: none;
    }

    /* ── RIJ 1: datum links + circuitnaam midden + logo rechts ───────── */
    .tha-cell--date {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 15px 10px 30px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        text-align: left;
    }

    /* Datum compact */
    .tha-date-number { flex-shrink: 0; min-width: 52px; }
    .tha-date-single { font-size: 26px; }
    .tha-date-range  { font-size: 19px; line-height: 1; }
    .tha-date-month  { font-size: 10px; margin-top: 1px; }
    .tha-days-badge  { margin-top: 3px; font-size: 10px; padding: 2px 7px; }

    /* Circuitinfo vult de rest */
    .tha-date-track-info {
        flex: 1;
        min-width: 0;
    }

    /* Logo aan de rechterkant van rij 1 */
    .tha-date-org {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        margin-left: auto;
    }

    .tha-date-org .tha-org-logo-img {
        max-height: 28px;
        max-width: 70px;
        object-fit: contain;
    }

    .tha-date-org .tha-org-name {
        font-size: 11px;
        color: var(--tha-text-muted);
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ── RIJ 2: circuit + land + type event + type-note rechts ──────── */
    .tha-cell--track {
        min-height: auto;
        padding: 0;
        display: block;
    }

    /* Achtergrond foto en circuit layout verbergen op mobiel */
    .tha-track-bg,
    .tha-circuit-img,
    .tha-circuit-svg {
        display: none !important;
    }

    .tha-track-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 9px 15px 9px 30px;
        width: 100%;
        box-sizing: border-box;
    }

    .tha-track-info {
        flex: 1;
        min-width: 0;
        padding-right: 0;
    }

    .tha-track-name {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tha-track-country { margin-top: 2px; }
    .tha-country-name  { font-size: 12px; }
    .tha-vehicle-tags  { margin-top: 3px; }

    /* Type + note inline rechts van het circuit */
    .tha-mobile-type-inline {
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        text-align: right;
    }

    .tha-mobile-type-inline .tha-type-badge {
        font-size: 10px;
        padding: 3px 12px;
    }

    .tha-mobile-type-inline .tha-type-note {
        font-size: 10px;
        justify-content: flex-end;
    }

    /* ── Verberg de aparte type/org cellen (zitten nu inline) ────────── */
    .tha-mobile-meta   { display: none !important; }
    .tha-cell--info    { display: none !important; }

    /* ── Details knop — volle breedte onderaan ───────────────────────── */
    .tha-cell--action {
        display: flex;
        justify-content: stretch;
        padding: 0;
    }

    .tha-details-btn {
        width: 100%;
        height: 40px;
        justify-content: center;
        font-size: 12px;
        /* clip-path blijft via de ::before */
    }

    /* Load more */
    .tha-load-more-btn {
        min-width: 0;
        width: 100%;
        max-width: 320px;
    }
}


