/* =============================================
   RTR Dashboard — Frontend Styles
   ============================================= */

.rtr-dashboard {
    max-width: 860px;
    margin: 0 auto;
    font-family: inherit;
}

/* Congrats Banner */
.rtr-congrats-banner {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 16px;
    text-align: center;
}

/* Header */
.rtr-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.rtr-dash-title {
    margin: 0 0 4px;
    font-size: 24px;
    color: #1a1a1a;
}

.rtr-dash-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.rtr-btn-primary {
    background: #2e7d32;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s;
}

.rtr-btn-primary:hover { background: #1b5e20; }

/* Section Titles */
.rtr-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
    margin: 32px 0 16px;
}

/* Overall Progress Bar */
.rtr-progress-section {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 8px;
}

.rtr-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 15px;
}

.rtr-progress-pct {
    color: #2e7d32;
    font-weight: 700;
}

.rtr-progress-bar-wrap {
    background: #ddd;
    border-radius: 20px;
    height: 14px;
    overflow: hidden;
}

.rtr-progress-bar {
    background: linear-gradient(90deg, #2e7d32, #66bb6a);
    height: 100%;
    border-radius: 20px;
    transition: width 0.6s ease;
}

.rtr-progress-note {
    margin: 10px 0 0;
    font-size: 14px;
    color: #444;
}

/* Trail Passport */
.rtr-passport {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
    gap: 14px;
    margin-bottom: 8px;
}

.rtr-trail-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.rtr-trail-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.rtr-trail-qualified {
    border-color: #a5d6a7;
    background: #f1f8f1;
}

.rtr-trail-started {
    border-color: #ffe082;
    background: #fffde7;
}

.rtr-trail-empty {
    border-color: #e0e0e0;
    background: #fafafa;
}

.rtr-trail-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rtr-trail-icon { font-size: 16px; flex-shrink: 0; }

.rtr-trail-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    color: #1a1a1a;
}

.rtr-map-link {
    font-size: 12px;
    color: #1976d2;
    text-decoration: none;
    white-space: nowrap;
}

.rtr-trail-miles {
    margin-bottom: 6px;
    font-size: 13px;
}

.rtr-miles-logged {
    font-weight: 700;
    color: #2e7d32;
    font-size: 15px;
}

.rtr-miles-max { color: #888; }

.rtr-trail-bar-wrap {
    background: #e0e0e0;
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.rtr-trail-bar {
    background: #43a047;
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
}

.rtr-trail-qualified .rtr-trail-bar { background: #2e7d32; }
.rtr-trail-started   .rtr-trail-bar { background: #f9a825; }

.rtr-trail-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.rtr-qualified-label { color: #2e7d32; font-weight: 600; }
.rtr-needed-label    { color: #888; }
.rtr-last-ride       { color: #aaa; }

/* Recent Rides Table */
.rtr-table-wrap { overflow-x: auto; }

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

.rtr-rides-table th,
.rtr-rides-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.rtr-rides-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.rtr-rides-table tr:hover td { background: #fafafa; }

/* Leader Wall */
.rtr-leaders {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.rtr-leader-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.rtr-leader-row:last-child { border-bottom: none; }
.rtr-leader-me { background: #f1f8f1; }

.rtr-leader-rank {
    font-weight: 700;
    color: #888;
    width: 24px;
    flex-shrink: 0;
    text-align: center;
}

.rtr-leader-row:nth-child(1) .rtr-leader-rank { color: #f9a825; font-size: 18px; }
.rtr-leader-row:nth-child(2) .rtr-leader-rank { color: #90a4ae; font-size: 16px; }
.rtr-leader-row:nth-child(3) .rtr-leader-rank { color: #a1887f; font-size: 15px; }

.rtr-leader-name {
    flex: 1;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rtr-leader-town { color: #888; font-size: 13px; flex: 1; }

.rtr-leader-date { color: #aaa; font-size: 12px; white-space: nowrap; }

.rtr-ultra-badge {
    background: #7b1fa2;
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.rtr-me-badge {
    background: #2e7d32;
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

/* Notice */
.rtr-notice {
    background: #f5f5f5;
    border-left: 4px solid #bbb;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
}

/* Responsive */
@media ( max-width: 600px ) {
    .rtr-passport {
        grid-template-columns: 1fr;
    }

    .rtr-dash-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rtr-leader-town,
    .rtr-leader-date {
        display: none;
    }
}

/* Activity tabs */
.rtr-activity-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rtr-activity-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 2px solid #ddd;
    border-radius: 24px;
    background: #f5f5f5;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.rtr-activity-tab:hover {
    border-color: #2e7d32;
    color: #2e7d32;
    background: #f1f8f1;
}

.rtr-activity-tab.active {
    border-color: #2e7d32;
    background: #2e7d32;
    color: #fff;
}

.rtr-tab-patch { font-size: 14px; }

/* Leader wall activity icon */
.rtr-leader-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* =============================================
   Public Leader Board — [rtr_leaders]
   ============================================= */

.rtr-leaders-public {
    max-width: 900px;
    margin: 0 auto;
    font-family: inherit;
}

.rtr-leaders-public-header {
    text-align: center;
    margin-bottom: 28px;
}

.rtr-leaders-public-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.rtr-leaders-public-sub {
    color: #666;
    font-size: 15px;
    margin: 0;
}

/* Empty state */
.rtr-leaders-public-empty {
    text-align: center;
    padding: 48px 20px;
    color: #888;
}

.rtr-leaders-empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }

/* Column layout */
.rtr-leaders-public-columns {
    display: grid;
    grid-template-columns: repeat( var(--col-count, 3), 1fr );
    gap: 20px;
}

.rtr-leaders-public-col {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.rtr-leaders-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.rtr-leaders-col-icon  { font-size: 20px; }
.rtr-leaders-col-label { font-weight: 700; font-size: 15px; flex: 1; color: #1a1a1a; }
.rtr-leaders-col-count { font-size: 12px; color: #888; white-space: nowrap; }

/* List */
.rtr-leaders-public-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rtr-leaders-public-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.rtr-leaders-public-row:last-child { border-bottom: none; }
.rtr-leader-ultra { background: #fdf4ff; }

.rtr-lp-rank {
    width: 28px;
    flex-shrink: 0;
    text-align: center;
    font-size: 18px;
    line-height: 1;
}

.rtr-lp-num {
    font-size: 13px;
    font-weight: 700;
    color: #bbb;
}

.rtr-lp-name {
    flex: 1;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rtr-lp-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.rtr-lp-town { font-size: 12px; color: #888; }
.rtr-lp-date { font-size: 11px; color: #bbb; white-space: nowrap; }

/* Responsive */
@media ( max-width: 680px ) {
    .rtr-leaders-public-columns {
        grid-template-columns: 1fr !important;
    }
}

/* =============================================
   Combined Leaderboard — [rtr_leaderboard_all]
   ============================================= */

.rtr-leaderboard-all {
    max-width: 1100px;
    margin: 0 auto;
    font-family: inherit;
}

.rtr-leaderboard-all-header {
    text-align: center;
    margin-bottom: 32px;
}

.rtr-leaderboard-all-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 280px, 1fr ) );
    gap: 24px;
    align-items: start;
}

/* Challenge card */
.rtr-lb-challenge-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.rtr-lb-card-header {
    background: #2e7d32;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rtr-lb-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.rtr-lb-earner-count {
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    padding: 3px 9px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Empty state */
.rtr-lb-empty {
    text-align: center;
    padding: 32px 16px;
    color: #aaa;
    font-size: 14px;
}

.rtr-lb-empty span { font-size: 32px; display: block; margin-bottom: 8px; }

/* Activity section inside card */
.rtr-lb-activity-section {
    border-bottom: 1px solid #f0f0f0;
}

.rtr-lb-activity-section:last-child { border-bottom: none; }

.rtr-lb-activity-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f9f9f9;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
}

/* List rows */
.rtr-lb-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rtr-lb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid #fafafa;
    font-size: 13px;
}

.rtr-lb-row:last-child { border-bottom: none; }
.rtr-lb-row.rtr-leader-ultra { background: #fdf4ff; }

@media ( max-width: 700px ) {
    .rtr-leaderboard-all-grid { grid-template-columns: 1fr; }
}

/* Delete ride button */
.rtr-delete-ride-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #bbb;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    transition: all 0.15s;
}

.rtr-delete-ride-btn:hover {
    background: #fff0f0;
    border-color: #e53935;
    color: #e53935;
}

.rtr-rides-table th:last-child,
.rtr-rides-table td:last-child {
    width: 32px;
    text-align: center;
}
