/* ============================================
   Leaderboard Styles
   Dark theme similar to Bitfinex leaderboard
   ============================================ */

.leaderboard-body {
    background-color: #1a1a1a;
    color: #ffffff;
    min-height: 100vh;
}

/* Keep navbar light to match rest of site */
.leaderboard-body .navbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-medium);
}

.leaderboard-body .navbar .nav-menu a {
    color: var(--gray-text);
}

.leaderboard-body .navbar .nav-menu a:hover,
.leaderboard-body .navbar .nav-menu a.active {
    color: var(--navy-blue);
}

/* Header Section */
.leaderboard-header {
    background-color: #1a1a1a;
    padding: 4rem 0 3rem;
    text-align: center;
}

.leaderboard-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.leaderboard-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.leaderboard-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin: 1.5rem auto 2rem;
    line-height: 1.6;
}

.leaderboard-cta {
    margin-top: 2rem;
}

.leaderboard-cta .cta-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1rem;
    font-weight: 500;
}

.leaderboard-cta .btn-cta-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--green-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.leaderboard-cta .btn-cta-primary:hover {
    background-color: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Filters Section */
.leaderboard-filters {
    background-color: #1f1f1f;
    border-bottom: 1px solid #2d2d2d;
    padding: 1.5rem 0;
    display: block;
}

.filters-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* Hide status filter */
#status-filter,
.filter-group:has(#status-filter) {
    display: none;
}

/* Hide county filter */
#county-filter,
.filter-group:has(#county-filter) {
    display: none;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-clear-filters {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    border: 1px solid #3d3d3d;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-clear-filters:hover {
    background-color: #2d2d2d;
    border-color: #4d4d4d;
    color: #ffffff;
}

/* Leaderboard Table */
.leaderboard-wrapper {
    padding: 2rem 0;
    min-height: 400px;
}

/* Remove container padding for table to start at edge */
.leaderboard-wrapper .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.leaderboard-table-container {
    overflow-x: auto;
    background-color: #1f1f1f;
    border-radius: var(--radius-md);
    border: 1px solid #2d2d2d;
    margin: 0;
    padding: 0;
    width: 100%;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.95rem;
    margin: 0;
    padding: 0;
    table-layout: auto;
}

.leaderboard-table thead {
    background-color: #252525;
    border-bottom: 2px solid #2d2d2d;
}

.leaderboard-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

/* First column (Rank) - minimal left padding to start at edge */
.leaderboard-table th:first-child {
    padding-left: 0.75rem !important;
    padding-right: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    width: 50px;
    min-width: 50px;
}

.leaderboard-table th.col-status {
    display: none;
}

/* Ensure all headers have consistent sizing */
.leaderboard-table th.col-savings {
    font-size: 0.85rem;
}

.leaderboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.leaderboard-table th.sortable:hover {
    background-color: #2d2d2d;
}

.leaderboard-table th.sortable.active {
    color: #ffffff;
}

.leaderboard-table th.sortable.active .sort-icon {
    fill: #ffffff;
}

.leaderboard-table th.sortable .sort-icon {
    display: inline-block;
    margin-left: 0.5rem;
    fill: rgba(255, 255, 255, 0.4);
    vertical-align: middle;
    transition: fill 0.2s ease;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid #2d2d2d;
    transition: background-color 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background-color: #252525;
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

.leaderboard-table td {
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
    background-color: transparent;
}

/* First column (Rank) cells - minimal left padding */
.leaderboard-table td:first-child {
    padding-left: 0.75rem !important;
    padding-right: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    width: 50px;
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
}

/* Progress Bar - positioned on first cell, extends across row */
.leaderboard-table tbody tr:not(.cta-row) td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    /* Use pixel width set by JavaScript for cross-row progress bar */
    width: var(--progress-width-px, 0px);
    background: linear-gradient(90deg, rgba(40, 217, 112, 0.3) 0%, rgba(40, 217, 112, 0.15) 100%);
    border-right: 2px solid rgba(40, 217, 112, 0.5);
    z-index: 0;
    pointer-events: none;
    transition: width 0.3s ease;
}

/* Ensure cell content appears above the progress bar */
.leaderboard-table tbody tr:not(.cta-row) td {
    position: relative;
    z-index: 1;
}

.leaderboard-table .col-address {
    min-width: 180px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: table-cell;
    visibility: visible;
}

.leaderboard-table .col-neighborhood {
    min-width: 150px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: table-cell;
    visibility: visible;
}

.leaderboard-table .col-savings {
    min-width: 150px;
    font-weight: 700;
    color: #28d970;
    font-size: 1.1rem;
    text-shadow: 0 0 2px rgba(40, 217, 112, 0.3);
}

.leaderboard-table .col-savings-percent {
    min-width: 100px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.leaderboard-table .col-status {
    min-width: 120px;
    display: none;
}

.leaderboard-table .col-county {
    min-width: 120px;
    color: rgba(255, 255, 255, 0.7);
}

.leaderboard-table .col-tax-year {
    min-width: 120px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}


/* CTA Row */
.cta-row {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 107, 53, 0.05) 100%);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-left: 4px solid var(--orange-primary);
}

.cta-row:hover {
    border-color: rgba(255, 107, 53, 0.4);
}

.cta-row-link:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 107, 53, 0.1) 100%);
}

.cta-row:hover .cta-row-text strong,
.cta-row:hover .cta-row-text span,
.cta-row-link:hover .cta-row-text strong,
.cta-row-link:hover .cta-row-text span {
    color: #ffffff;
}

.cta-row .col-cta {
    padding: 0 !important;
}

.cta-row-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.cta-row-link:hover {
    text-decoration: none;
    color: inherit;
}

.cta-row-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cta-row-text {
    flex: 1;
    min-width: 250px;
}

.cta-row-text strong {
    display: block;
    color: var(--orange-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.cta-row-text span {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.btn-cta-inline {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--orange-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none; /* Prevent double-click on nested link */
}

.btn-cta-inline:hover {
    background-color: #FF8555; /* Lighter orange for better visibility */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.inquiry {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-badge.filed {
    background-color: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.status-badge.completed {
    background-color: rgba(40, 167, 69, 0.2);
    color: var(--green-primary);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

/* Loading State */
.loading-row {
    border: none;
}

.loading-cell {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--green-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Description below table */
.leaderboard-description-below {
    text-align: center;
    padding: 2rem 1rem 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* CTA Section */
.leaderboard-cta-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4f7c 100%);
    padding: 4rem 0;
    margin-top: 3rem;
}

.leaderboard-cta-section .cta-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.leaderboard-cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.leaderboard-cta-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta-large {
    display: inline-block;
    padding: 1.25rem 3rem;
    background-color: var(--green-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-cta-large:hover {
    background-color: #34ce57; /* Lighter green for better visibility */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-outline-large {
    display: inline-block;
    padding: 1.25rem 3rem;
    background-color: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-outline-large:hover {
    background-color: rgba(255, 255, 255, 0.25); /* More visible on dark blue background */
    border-color: #ffffff;
    color: #ffffff;
}

/* Footer */
.leaderboard-footer {
    background-color: #1a1a1a;
    border-top: 1px solid #2d2d2d;
    margin-top: 0;
}

.leaderboard-footer .footer-section h3,
.leaderboard-footer .footer-section h4 {
    color: rgba(255, 255, 255, 0.9);
}

.leaderboard-footer .footer-text,
.leaderboard-footer .footer-links a {
    color: rgba(255, 255, 255, 0.8);
}

.leaderboard-footer .footer-links a:hover {
    color: #ffffff;
}

.leaderboard-footer .tagline {
    color: rgba(255, 255, 255, 0.7);
}

.leaderboard-footer .footer-bottom {
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard-footer .disclaimer-text {
    color: rgba(255, 255, 255, 0.5);
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--green-primary);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top-btn:hover {
    background-color: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-top-btn svg {
    transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .leaderboard-title {
        font-size: 1.75rem;
    }

    .leaderboard-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .leaderboard-header {
        padding: 2rem 0 1.5rem;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    /* Simplify table for mobile - hide less important columns */
    .leaderboard-table {
        font-size: 0.9rem;
        table-layout: auto;
        width: 100%;
    }

    .leaderboard-table-container {
        overflow-x: auto;
        border-radius: var(--radius-sm);
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem 0.6rem;
    }

    /* Hide columns on mobile: neighborhood, savings %, county, tax year */
    .leaderboard-table .col-neighborhood,
    .leaderboard-table .col-savings-percent,
    .leaderboard-table .col-county,
    .leaderboard-table .col-tax-year {
        display: none !important;
    }

    /* Mobile header styling */
    .leaderboard-table th {
        font-size: 0.7rem;
        letter-spacing: 0.3px;
        white-space: nowrap;
    }

    /* Hide sort icons on mobile to save space */
    .leaderboard-table th .sort-icon {
        display: none;
    }

    /* Rank column - compact */
    .leaderboard-table th.col-rank,
    .leaderboard-table td.col-rank {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding-left: 0.5rem !important;
        padding-right: 0.4rem !important;
        text-align: center;
    }

    .leaderboard-table td.col-rank {
        font-size: 0.85rem;
    }

    /* Address column - takes remaining space */
    .leaderboard-table th.col-address,
    .leaderboard-table td.col-address {
        min-width: 120px;
        width: auto;
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
    }

    .leaderboard-table td.col-address {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    /* Savings column - fixed width, right aligned */
    .leaderboard-table th.col-savings,
    .leaderboard-table td.col-savings {
        min-width: 90px !important;
        width: 90px !important;
        max-width: 100px !important;
        text-align: right !important;
        padding-right: 0.75rem !important;
        padding-left: 0.5rem !important;
    }

    .leaderboard-table td.col-savings {
        font-size: 0.9rem;
    }

    /* CTA Row mobile styling */
    .cta-row-link {
        padding: 1rem 0.75rem !important;
    }

    .cta-row-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .cta-row-text {
        text-align: center;
        min-width: auto;
    }

    .cta-row-text strong {
        font-size: 0.95rem;
    }

    .cta-row-text span {
        font-size: 0.85rem;
    }

    .btn-cta-inline {
        width: 100%;
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Progress bar - limit width on mobile */
    .leaderboard-table tbody tr:not(.cta-row) td:first-child::before {
        max-width: 100vw;
    }

    /* CTA Section mobile */
    .leaderboard-cta-section {
        padding: 2.5rem 1rem;
        margin-top: 2rem;
    }

    .leaderboard-cta-section h2 {
        font-size: 1.5rem;
    }

    .leaderboard-cta-section p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-cta-large,
    .btn-outline-large {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .hide-mobile {
        display: none;
    }

    /* Description below table */
    .leaderboard-description-below {
        padding: 1.5rem 1rem 0;
        font-size: 0.85rem;
    }
}

