/* ============================================
   RECORDS PAGE - shares theme variables/fonts with styles.css
   ============================================ */

.records-hero {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.9) 0%, rgba(26, 26, 26, 0.9) 50%, rgba(10, 10, 10, 0.9) 100%),
                url('images/loadingscreen2.png') center/cover no-repeat;
    background-attachment: fixed;
    padding: 80px 20px 50px;
    text-align: center;
    border-bottom: 2px solid var(--gold);
}

.records-hero h1 {
    font-size: 48px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.records-hero p {
    color: var(--text-muted);
    font-size: 16px;
}

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 40px auto 0;
}

.stat-card {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    padding: 18px 10px;
}

.stat-card .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 900;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
}

.stat-card .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Main records section */
.records-main {
    background: var(--primary-dark);
    padding: 60px 20px 100px;
}

/* Tabs */
.records-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.records-tab-btn {
    background: var(--secondary-dark);
    border: 2px solid rgba(212, 175, 55, 0.3);
    color: var(--text-muted);
    padding: 12px 28px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.records-tab-btn:hover {
    border-color: var(--gold);
    color: var(--gold-light);
}

.records-tab-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--primary-dark);
}

.tab-panel {
    display: none;
}

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

/* Panel section blocks */
.records-block {
    max-width: 1100px;
    margin: 0 auto 70px;
}

.records-block h2 {
    color: var(--gold);
    font-size: 30px;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 12px;
}

.records-block .block-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 10px 0 25px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.filter-bar input[type="text"],
.filter-bar select {
    background: var(--tertiary-dark);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--text-light);
    padding: 10px 14px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    min-width: 180px;
}

.filter-bar input[type="text"]:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--gold);
}

.filter-bar label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-bar .btn-load {
    align-self: flex-end;
    background: var(--gold);
    color: var(--primary-dark);
    border: none;
    padding: 10px 22px;
    border-radius: 4px;
    font-weight: 700;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-bar .btn-load:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}

/* Table */
.records-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    background: var(--secondary-dark);
}

table.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.records-table thead th {
    background: var(--tertiary-dark);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    font-family: 'Cinzel', serif;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 2px solid var(--gold);
    white-space: nowrap;
}

table.records-table tbody td {
    padding: 12px 16px;
    color: var(--text-light);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    white-space: nowrap;
}

table.records-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.06);
}

table.records-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.rank-cell {
    font-weight: 700;
    color: var(--gold-light);
}

.rank-cell.rank-1 { color: var(--accent-gold); }

.time-cell {
    font-variant-numeric: tabular-nums;
    color: var(--gold-light);
    font-weight: 600;
}

.player-link {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px dotted rgba(212, 175, 55, 0.5);
}

.player-link:hover {
    color: var(--gold-light);
    border-bottom-color: var(--gold-light);
}

.steamid-text {
    color: var(--text-muted);
    font-size: 12px;
}

.empty-row td,
.loading-row td,
.error-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 16px;
    white-space: normal;
}

.error-row td {
    color: #d97070;
}

/* Style badge - colour coded to match the gamemode */
.style-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    border-left: 3px solid var(--badge-color, var(--gold));
    background: var(--badge-bg, rgba(212, 175, 55, 0.15));
    color: var(--badge-color, var(--gold));
    white-space: nowrap;
}

.style-badge .style-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--badge-color, var(--gold));
    flex-shrink: 0;
}

select.style-select option {
    background: var(--tertiary-dark);
}

/* Pagination */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.pagination-bar button {
    background: var(--secondary-dark);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 18px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-bar button:hover:not(:disabled) {
    background: var(--gold);
    color: var(--primary-dark);
}

.pagination-bar button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-bar span {
    color: var(--text-muted);
    font-size: 13px;
}

/* World record map groups (records table shows a map header row) */
tr.map-group-row td {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-light);
    font-weight: 700;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

/* Map Browser overlay */
.map-browser-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 2500;
    align-items: center;
    justify-content: center;
}

.map-browser-overlay.active {
    display: flex;
}

.map-browser-panel {
    background: var(--secondary-dark);
    border: 2px solid var(--gold);
    border-radius: 8px;
    width: min(900px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
}

.map-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.map-browser-header h3 {
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 22px;
}

.map-browser-close {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.map-browser-close:hover {
    color: var(--gold-light);
}

#map-browser-search {
    background: var(--tertiary-dark);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--text-light);
    padding: 10px 14px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
}

#map-browser-search:focus {
    outline: none;
    border-color: var(--gold);
}

.map-browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    overflow-y: auto;
    padding-right: 6px;
}

.map-browser-card {
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 6px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    font-family: 'Cinzel', serif;
}

.map-browser-card:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.14);
    transform: translateY(-3px);
}

.map-browser-card .map-name {
    display: block;
    color: var(--gold-light);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
    word-break: break-word;
}

.map-browser-card .map-meta {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .records-hero h1 {
        font-size: 32px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar input[type="text"],
    .filter-bar select,
    .filter-bar .btn-load {
        width: 100%;
        min-width: 0;
    }

    .records-tabs {
        flex-direction: column;
    }

    .records-tab-btn {
        width: 100%;
    }

    .map-browser-panel {
        padding: 16px;
    }

    .map-browser-grid {
        grid-template-columns: 1fr;
    }
}
