/* ============================================================
   TEBA Transactions Pro — Frontend Styles v3.1
   Theme: TEBA League dark — #2b2b38 bg, #2c2c3f card,
   #bcae8b gold accent. Layout unchanged from v3.0.
   ============================================================ */

/* ── Reset inside container ──────────────────────────────── */
.tebatrx-container *,
.tebatrx-container *::before,
.tebatrx-container *::after {
    box-sizing: border-box;
}

/* ── CSS Custom Properties ───────────────────────────────── */
.tebatrx-container {
    --trx-bg:           #2c2c3f;        /* card surface */
    --trx-page-bg:      #2b2b38;        /* page background */
    --trx-border:       rgba(255,255,255,.08);
    --trx-text:         #f0ece4;        /* warm off-white */
    --trx-muted:        #9b96a8;        /* desaturated lavender-grey */
    --trx-accent:       #bcae8b;        /* TEBA gold */
    --trx-select-bg:    #23232f;        /* slightly darker than card */
    --trx-select-hover: #1e1e29;
    --trx-row-hover:    rgba(188,174,139,.06);   /* gold tint on hover */
    --trx-separator:    rgba(255,255,255,.07);
    --trx-font-head:    'Antonio', 'Barlow Condensed', sans-serif;
    --trx-font-body:    'Source Sans 3', 'Barlow', sans-serif;
    --trx-transition:   140ms ease;
    --trx-date-col:     140px;
    --trx-logo-col:     120px;
    --trx-team-size:    50px;
    --trx-player-size:  50px;
}

/* ── Container ───────────────────────────────────────────── */
.tebatrx-container {
    position: relative;
    font-family: var(--trx-font-body);
    background: #2b2b38;
    color: var(--trx-text);
    max-width: 889px;
    margin: 0 auto;
    padding: 0 0 32px;
}

/* ── Page heading ────────────────────────────────────────── */
.tebatrx-heading {
    font-family: var(--trx-font-head);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--trx-text);
    margin: 0 0 18px;
    padding: 0;
    line-height: 1.2;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.tebatrx-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-bottom: 28px;
    align-items: flex-end;
}

.tebatrx-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 148px;
}

.tebatrx-filter-label {
    font-family: var(--trx-font-head);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--trx-muted);
}

/* Gold chevron for dark background */
.tebatrx-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--trx-select-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23bcae8b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid rgba(188,174,139,.25);
    border-radius: 4px;
    color: var(--trx-text);
    font-family: var(--trx-font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 32px 9px 12px;
    cursor: pointer;
    transition: border-color var(--trx-transition), background-color var(--trx-transition);
    width: 100%;
    line-height: 1.4;
}

.tebatrx-select:hover {
    border-color: rgba(188,174,139,.55);
    background-color: var(--trx-select-hover);
}

.tebatrx-select:focus {
    outline: 2px solid var(--trx-accent);
    outline-offset: 1px;
    border-color: var(--trx-accent);
}

.tebatrx-select option {
    background: #23232f;
    color: var(--trx-text);
}

/* ── Custom dropdown (replaces native select) ────────────── */
.tebatrx-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}

.tebatrx-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--trx-select-bg);
    border: 1px solid rgba(188,174,139,.25);
    border-radius: 4px;
    color: var(--trx-text);
    font-family: var(--trx-font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 12px;
    cursor: pointer;
    transition: border-color var(--trx-transition), background-color var(--trx-transition);
    width: 100%;
    text-align: left;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

.tebatrx-dropdown-trigger:hover {
    border-color: rgba(188,174,139,.55);
    background-color: var(--trx-select-hover);
}

.tebatrx-dropdown.is-open .tebatrx-dropdown-trigger {
    border-color: var(--trx-accent);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.tebatrx-dropdown-trigger-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tebatrx-dropdown-chevron {
    flex-shrink: 0;
    width: 10px;
    height: 6px;
    transition: transform var(--trx-transition);
}

.tebatrx-dropdown.is-open .tebatrx-dropdown-chevron {
    transform: rotate(180deg);
}

/* The panel */
.tebatrx-dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #23232f;
    border: 1px solid var(--trx-accent);
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 999;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(188,174,139,.3) transparent;
}

.tebatrx-dropdown-panel::-webkit-scrollbar {
    width: 4px;
}
.tebatrx-dropdown-panel::-webkit-scrollbar-track {
    background: transparent;
}
.tebatrx-dropdown-panel::-webkit-scrollbar-thumb {
    background: rgba(188,174,139,.3);
    border-radius: 2px;
}

.tebatrx-dropdown.is-open .tebatrx-dropdown-panel {
    display: block;
}

/* Individual options */
.tebatrx-dropdown-option {
    padding: 10px 14px;
    font-family: var(--trx-font-body);
    font-size: 14px;
    color: #c8c4d4;
    cursor: pointer;
    transition: background var(--trx-transition), color var(--trx-transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tebatrx-dropdown-option:hover {
    background: rgba(188,174,139,.12);
    color: var(--trx-text);
}

.tebatrx-dropdown-option.is-selected {
    background: rgba(188,174,139,.18);
    color: var(--trx-accent);
    font-weight: 600;
}

/* ── Results wrapper ─────────────────────────────────────── */
.tebatrx-results {
    transition: opacity 150ms ease;
}

.tebatrx-results.is-loading {
    opacity: .35;
    pointer-events: none;
}

/* ── Date group container ────────────────────────────────── */
.tebatrx-date-group {
    display: block;
}

/* ── Individual row: date | logos | sentence ─────────────── */
.tebatrx-row {
    display: flex;
    align-items: center;
    min-height: 68px;
    border-bottom: 1px solid var(--trx-separator);
    transition: background var(--trx-transition);
}

.tebatrx-row:last-child {
    border-bottom: none;
}

.tebatrx-row:hover {
    background: var(--trx-row-hover);
}

/* ── Date column ─────────────────────────────────────────── */
.tebatrx-row-date {
    flex: 0 0 var(--trx-date-col);
    padding: 16px 12px 16px 0;
    align-self: flex-start;
    padding-top: 20px;
}

.tebatrx-row-date-text {
    font-family: var(--trx-font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--trx-accent);       /* gold date labels match TEBA brand */
    line-height: 1.45;
    display: block;
}

/* The date is split into two spans: day+month+day / year */
.tebatrx-row-date-line1 {
    display: block;
}
.tebatrx-row-date-line2 {
    display: block;
}

/* ── Logos column ────────────────────────────────────────── */
.tebatrx-row-logos {
    flex: 0 0 var(--trx-logo-col);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px 12px 0;
}

.tebatrx-avatar {
    width: var(--trx-team-size);
    height: var(--trx-team-size);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

/* Team logo: transparent — logos already have their own bg */
.tebatrx-avatar--team {
    background: transparent;
}

/* Player headshot: dark circle matching the card surface */
.tebatrx-avatar--player {
    background: #3a3a50;
}

.tebatrx-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Team logo image: contain to show full logo */
.tebatrx-avatar--team img {
    object-fit: contain;
    object-position: center;
}

.tebatrx-avatar-initials {
    font-family: var(--trx-font-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--trx-muted);
    letter-spacing: -.01em;
    line-height: 1;
}

/* Silhouette for player fallback */
.tebatrx-avatar--player.tebatrx-avatar--no-img::after {
    content: '';
    display: block;
    width: 60%;
    height: 60%;
    background: #6b6680;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── Body column (sentence + notes) ─────────────────────── */
.tebatrx-row-body {
    flex: 1 1 0;
    padding: 14px 0;
    min-width: 0;
}

.tebatrx-sentence {
    font-family: var(--trx-font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--trx-text);
}

.tebatrx-sentence a {
    color: var(--trx-text);
    text-decoration: none;
    font-weight: 400;
}

.tebatrx-sentence a:hover {
    color: var(--trx-accent);
    text-decoration: none;
}

.tebatrx-sentence strong {
    font-weight: 400;
}

.tebatrx-notes {
    display: block;
    font-size: 12px;
    color: var(--trx-muted);
    margin-top: 3px;
    font-style: italic;
}

/* ── Empty state ─────────────────────────────────────────── */
.tebatrx-empty {
    padding: 48px 0;
    text-align: center;
    color: var(--trx-muted);
    font-size: 15px;
    font-family: var(--trx-font-body);
}

/* ── "See More" button — gold on dark ───────────────────── */
.tebatrx-see-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.tebatrx-see-more {
    display: inline-block;
    font-family: var(--trx-font-head);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #1e1e29;
    background: var(--trx-accent);
    border: none;
    border-radius: 4px;
    padding: 14px 48px;
    cursor: pointer;
    transition: background var(--trx-transition), transform 80ms ease;
    min-width: 160px;
    text-align: center;
    line-height: 1;
}

.tebatrx-see-more:hover {
    background: #cdc09f;
}

.tebatrx-see-more:active {
    transform: scale(.97);
}

.tebatrx-see-more:disabled {
    opacity: .4;
    cursor: default;
    transform: none;
}

/* ── Inline loading spinner ──────────────────────────────── */
.tebatrx-loading-wrap {
    display: flex;
    justify-content: center;
    padding: 28px 0;
}

.tebatrx-spinner {
    width: 26px;
    height: 26px;
    border: 2.5px solid rgba(188,174,139,.2);
    border-top-color: var(--trx-accent);
    border-radius: 50%;
    animation: tebatrx-spin .65s linear infinite;
    display: inline-block;
}

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

/* ── End message ─────────────────────────────────────────── */
.tebatrx-end-msg {
    text-align: center;
    font-family: var(--trx-font-body);
    font-size: 13px;
    color: var(--trx-muted);
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--trx-separator);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .tebatrx-container {
        --trx-date-col:    96px;
        --trx-logo-col:    100px;
        --trx-team-size:   40px;
        --trx-player-size: 40px;
        padding: 16px 16px 24px;
    }

    .tebatrx-filters {
        gap: 8px;
    }

    .tebatrx-filter-group {
        min-width: 0;
        flex: 1 1 calc(50% - 7px);
    }

    .tebatrx-sentence {
        font-size: 13.5px;
    }

    .tebatrx-row-date-text {
        font-size: 10px;
    }

    .tebatrx-see-more {
        padding: 12px 36px;
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .tebatrx-container {
        --trx-date-col:    72px;
        --trx-logo-col:    80px;
        --trx-team-size:   34px;
        --trx-player-size: 34px;
    }

    .tebatrx-filter-group {
        flex: 1 1 100%;
    }
}
