/* ==========================================================================
   Rotax Results – Frontend Styles
   Matched to rotaxmax.sk design system:
     Primary red: #E43138
     Font:        Fama-Basic (headings: PP-Monument-Extended)
     Page BG:     #fff (white)
     Footer BG:   #000 (black)
     Container:   1200px max-width
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
    --rotax-primary: #E43138;
    --rotax-primary-dark: #c1272e;
    --rotax-bg-dark: #1c1c1c;
    --rotax-bg-card: #232323;
    --rotax-bg-table: #1a1a1a;
    --rotax-bg-row-hover: #2a2a2a;
    --rotax-bg-row-alt: #1f1f1f;
    --rotax-text: #e0e0e0;
    --rotax-text-muted: #999;
    --rotax-border: #333;
    --rotax-gold: #ffd700;
    --rotax-silver: #c0c0c0;
    --rotax-bronze: #cd7f32;
    --rotax-gold-bg: rgba(255, 215, 0, 0.10);
    --rotax-silver-bg: rgba(192, 192, 192, 0.07);
    --rotax-bronze-bg: rgba(205, 127, 50, 0.07);
    --rotax-transition: 0.2s ease;
    --rotax-font: 'Fama-Basic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rotax-font-heading: 'PP-Monument-Extended', 'Fama-Basic', sans-serif;
}

/* ---------- Outer container ---------- */
.rotax-outer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 40px;
}

/* ---------- Wrapper ---------- */
.rotax-results-wrapper {
    font-family: var(--rotax-font);
    color: #3C4045;
    margin: 0 0 30px;
    padding: 0;
}

/* ---------- Title ---------- */
.rotax-title {
    font-family: var(--rotax-font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #E43138;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rotax-subtitle {
    font-family: var(--rotax-font);
    font-size: 15px;
    font-weight: 500;
    color: #3C4045;
    margin: 0 0 20px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ---------- Search ---------- */
.rotax-search-wrap {
    background: #1c1c1c;
    padding: 14px 18px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rotax-search-wrap label {
    color: #999;
    font-size: 13px;
    font-family: var(--rotax-font);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rotax-search-input {
    background: #111;
    border: 1px solid #333;
    color: #e0e0e0;
    font-family: var(--rotax-font);
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 4px;
    width: 240px;
    max-width: 100%;
    outline: none;
    transition: border-color var(--rotax-transition);
}

.rotax-search-input::placeholder {
    color: #666;
}

.rotax-search-input:focus {
    border-color: var(--rotax-primary);
}

.rotax-search-count {
    color: #666;
    font-size: 11px;
    font-family: var(--rotax-font);
    margin-left: auto;
}

.rotax-search-clear {
    background: none;
    border: 1px solid #444;
    color: #999;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--rotax-font);
    transition: all var(--rotax-transition);
}

.rotax-search-clear:hover {
    border-color: var(--rotax-primary);
    color: #fff;
}

.rotax-row-hidden {
    display: none !important;
}

/* ---------- Notice banner ---------- */
.rotax-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1c1c1c;
    border-left: 4px solid var(--rotax-primary);
    padding: 12px 18px;
    margin-bottom: 0;
    font-size: 13px;
    color: #ccc;
}

/* When search is present, notice loses top border-radius */
.rotax-search-wrap + .rotax-notice {
    border-radius: 0;
}

/* When no search, notice is first element */
.rotax-results-wrapper > .rotax-notice:first-child {
    border-radius: 6px 6px 0 0;
}

.rotax-notice strong {
    color: var(--rotax-primary);
}

.rotax-notice-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ---------- Tabs ---------- */
.rotax-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 0;
    padding: 0;
    background: #111;
    border-bottom: 2px solid var(--rotax-primary);
}

.rotax-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #999;
    font-family: var(--rotax-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--rotax-transition);
    white-space: nowrap;
    letter-spacing: 0.3px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.rotax-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.rotax-tab--active {
    color: #fff;
    background: var(--rotax-primary);
    border-bottom-color: var(--rotax-primary);
}

.rotax-tab--active:hover {
    background: var(--rotax-primary-dark);
    color: #fff;
}

/* ---------- Tab Panel ---------- */
.rotax-tab-panel {
    display: none;
    animation: rotaxFadeIn 0.25s ease;
}

.rotax-tab-panel--active {
    display: block;
}

@keyframes rotaxFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Table Wrapper ---------- */
.rotax-table-wrap {
    overflow: auto;
    max-height: 70vh;
    -webkit-overflow-scrolling: touch;
    background: var(--rotax-bg-table);
}

/* Custom Scrollbar for Table */
.rotax-table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 10px;
}
.rotax-table-wrap::-webkit-scrollbar-track {
    background: #111; 
}
.rotax-table-wrap::-webkit-scrollbar-thumb {
    background: #444; 
    border-radius: 4px;
}
.rotax-table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--rotax-primary); 
}

/* ---------- Top Scrollbar ---------- */
.rotax-top-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
    background: #111;
}
.rotax-top-scroll-inner {
    height: 1px; /* Just needs width, no height */
}
.rotax-top-scroll::-webkit-scrollbar {
    height: 10px;
}
.rotax-top-scroll::-webkit-scrollbar-track {
    background: #111; 
}
.rotax-top-scroll::-webkit-scrollbar-thumb {
    background: #444; 
    border-radius: 4px;
}
.rotax-top-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--rotax-primary); 
}

/* ---------- Table ---------- */
.rotax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
    font-family: var(--rotax-font);
}

.rotax-table thead th {
    background: #111;
    color: #888;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 10px;
    text-align: left;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 2;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color var(--rotax-transition);
}

.rotax-table thead th:hover {
    color: var(--rotax-primary);
}

.rotax-sort-icon::after {
    content: '⇅';
    margin-left: 4px;
    opacity: 0.3;
    font-size: 9px;
}

th.rotax-sort-asc .rotax-sort-icon::after {
    content: '▲';
    opacity: 0.9;
    color: var(--rotax-primary);
}

th.rotax-sort-desc .rotax-sort-icon::after {
    content: '▼';
    opacity: 0.9;
    color: var(--rotax-primary);
}

.rotax-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--rotax-text);
    transition: background var(--rotax-transition);
    font-size: 13px;
}

.rotax-table tbody tr:nth-child(even) td {
    background: var(--rotax-bg-row-alt);
}

.rotax-table tbody tr:hover td {
    background: var(--rotax-bg-row-hover);
}

/* Position column – sticky */
.rotax-col-pos {
    text-align: center;
    width: 50px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
}

/* Name column – sticky after position */
.rotax-col-name {
    font-weight: 600;
    min-width: 150px;
    color: #fff;
    position: sticky;
    left: 50px;
    z-index: 1;
    background: inherit;
    /* relative for ::after shadow */
}

/* Sticky column backgrounds for header */
.rotax-table thead th.rotax-col-pos,
.rotax-table thead th.rotax-col-name {
    z-index: 3;
    background: #111;
}

/* Sticky column backgrounds for body rows */
.rotax-table tbody td.rotax-col-pos,
.rotax-table tbody td.rotax-col-name {
    background: var(--rotax-bg-table);
}

.rotax-table tbody tr:nth-child(even) td.rotax-col-pos,
.rotax-table tbody tr:nth-child(even) td.rotax-col-name {
    background: var(--rotax-bg-row-alt);
}

.rotax-table tbody tr:hover td.rotax-col-pos,
.rotax-table tbody tr:hover td.rotax-col-name {
    background: var(--rotax-bg-row-hover);
}

/* Podium sticky backgrounds */
.rotax-row-gold td.rotax-col-pos,
.rotax-row-gold td.rotax-col-name {
    background: #2a2510 !important;
}

.rotax-row-silver td.rotax-col-pos,
.rotax-row-silver td.rotax-col-name {
    background: #222225 !important;
}

.rotax-row-bronze td.rotax-col-pos,
.rotax-row-bronze td.rotax-col-name {
    background: #252018 !important;
}

/* Sticky shadow separator */
.rotax-col-name::after {
    content: '';
    position: absolute;
    top: 0;
    right: -6px;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to right, rgba(0,0,0,0.15), transparent);
    pointer-events: none;
}

/* Numeric columns */
.rotax-table tbody td:not(.rotax-col-pos):not(.rotax-col-name) {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.rotax-table thead th:not(.rotax-col-pos):not(.rotax-col-name) {
    text-align: center;
}

/* Last column (total) bold */
.rotax-table tbody td:last-child {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
}

/* ---------- Podium Rows ---------- */
.rotax-row-gold td {
    background: var(--rotax-gold-bg) !important;
}

.rotax-row-gold .rotax-col-name {
    color: var(--rotax-gold);
}

.rotax-row-silver td {
    background: var(--rotax-silver-bg) !important;
}

.rotax-row-silver .rotax-col-name {
    color: var(--rotax-silver);
}

.rotax-row-bronze td {
    background: var(--rotax-bronze-bg) !important;
}

.rotax-row-bronze .rotax-col-name {
    color: var(--rotax-bronze);
}

/* Medal emoji */
.rotax-medal {
    font-size: 14px;
    margin-right: 2px;
}

/* DQ badge */
.rotax-dq {
    display: inline-block;
    background: rgba(228, 49, 56, 0.2);
    color: var(--rotax-primary);
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
}

/* ---------- Table Info ---------- */
.rotax-table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 11px;
    color: #999;
    background: #111;
    border-radius: 0 0 6px 6px;
}

.rotax-updated {
    font-style: italic;
}

/* ---------- SpeedHive Section ---------- */
.rotax-speedhive-section {
    background: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 20px;
}

.rotax-speedhive-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 30px;
}

.rotax-speedhive-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.rotax-speedhive-content h3 {
    font-family: var(--rotax-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
    text-transform: uppercase;
}

.rotax-speedhive-content p {
    color: #999;
    font-size: 13px;
    margin: 0 0 14px 0;
    font-family: var(--rotax-font);
}

.rotax-speedhive-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rotax-primary) !important;
    color: #fff !important;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--rotax-font);
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--rotax-transition);
    border: none !important;
}

.rotax-speedhive-btn:hover,
.rotax-speedhive-btn:focus,
.rotax-speedhive-btn:visited {
    background: var(--rotax-primary-dark) !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* ---------- No Results ---------- */
.rotax-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
    font-family: var(--rotax-font);
    background: #f5f5f5;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 768px) {
    .rotax-title {
        font-size: 18px;
    }

    .rotax-subtitle {
        font-size: 13px;
    }

    .rotax-tab {
        padding: 10px 14px;
        font-size: 11px;
    }

    .rotax-table {
        font-size: 11px;
    }

    .rotax-table thead th {
        padding: 8px 6px;
        font-size: 9px;
    }

    .rotax-table tbody td {
        padding: 6px;
    }

    .rotax-col-name {
        min-width: 110px;
    }

    .rotax-search-wrap {
        flex-wrap: wrap;
        gap: 8px;
    }

    .rotax-search-input {
        width: 100%;
    }

    .rotax-speedhive-inner {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .rotax-table-info {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .rotax-table thead th,
    .rotax-table tbody td {
        padding: 5px 4px;
        font-size: 10px;
    }

    .rotax-col-pos {
        width: 36px;
    }

    .rotax-medal {
        font-size: 12px;
    }

    .rotax-tab {
        padding: 8px 10px;
        font-size: 10px;
    }
}

/* ---------- Championship Navigation (Big buttons) ---------- */
.rotax-champ-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 24px 0;
}

.rotax-champ-tab {
    flex: 1 1 calc(33.333% - 12px);
    min-width: 200px;
    padding: 16px 20px;
    background: #1c1c1c;
    border: 2px solid #333;
    border-radius: 8px;
    color: #bbb;
    font-family: var(--rotax-font);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.rotax-champ-tab:hover {
    background: #262626;
    color: #fff;
    border-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.rotax-champ-tab--active {
    background: linear-gradient(135deg, #E43138 0%, #b81c23 100%) !important;
    border-color: #E43138 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(228, 49, 56, 0.4) !important;
    transform: translateY(-2px);
}

.rotax-champ-panel {
    display: none !important;
}

.rotax-champ-panel.rotax-champ-panel--active,
.rotax-champ-panel--active {
    display: block !important;
    animation: rotaxFadeIn 0.3s ease;
}

@keyframes rotaxFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media screen and (max-width: 768px) {
    .rotax-champ-tab {
        flex: 1 1 100%;
        padding: 14px 16px;
        font-size: 14px;
    }
}

