.stats-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    align-items: start;
}

.stats-container h1 {
    font-size: 2.0rem;
    color: #003893;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #DC143C 0%, #003893 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    grid-column: 1 / -1;
    grid-gap: 0;
}

.stats-container>p {
    grid-column: 1 / -1;
    color: #666;
    margin: 0 0 1rem 0;
}

.filters-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    height: fit-content;
    position: sticky;
    top: 20px;
    grid-column: 1;
    margin: 0;
}

.filters-section h2 {
    font-size: 1.2rem;
    color: #333;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid #DC143C;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 0;
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
}

.search-box label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    margin: 0;
}

.search-box-input {
    display: flex;
    gap: 0;
    align-items: center;
    margin: 0;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px 0 0 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fafafa;
    font-family: inherit;
    margin: 0;
}

.search-input:focus {
    outline: none;
    border-color: #DC143C;
    background: white;
}

.search-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #DC143C 0%, #b01030 100%);
    color: white;
    border: 1px solid #b01030;
    border-radius: 0 6px 6px 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    margin: 0;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 20, 60, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn::before {
    content: "🔍";
    font-size: 1rem;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    margin: 0;
}

.filter-input,
.filter-select {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    background: white;
    font-family: inherit;
    margin: 0;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #DC143C;
    background: white;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 0 0;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.btn-primary {
    padding: 11px 16px;
    background: linear-gradient(135deg, #DC143C 0%, #b01030 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin: 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 20, 60, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 11px 16px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    width: 100%;
    display: block;
    margin: 0;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

/* ===== MAIN CONTENT AREA ===== */
.stats-summary {
    grid-column: 2;
    /* grid-row: 2; */
    background: #fafafa;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #666;
    border-left: 3px solid #DC143C;
    font-size: 0.95rem;
    margin: 0;
    margin-left: 2rem;
}

.stats-summary p {
    margin: 0;
}

.stats-summary strong {
    color: #333;
}

/* ===== TABLE ===== */
.table-wrapper {
    grid-column: 2;
    grid-row: 3;
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    margin: 0;
    margin-left: 2rem;
    padding: 0;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0;
}

.stats-table thead {
    background: linear-gradient(135deg, #1e40af 0%, #0c2340 100%);
    border-bottom: 2px solid #DC143C;
}

.stats-table th {
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    color: white;
    user-select: none;
    font-size: 0.9rem;
    margin: 0;
}

.stats-table th a {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.stats-table th a:hover {
    color: #FFD700;
}

.stats-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    color: #555;
    margin: 0;
}

.stats-table tbody tr {
    transition: background-color 0.2s ease;
}

.stats-table tbody tr:hover {
    background: #fafafa;
}

.player-name {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0;
}

.rank {
    background: #f0f0f0;
    color: #DC143C;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
    min-width: 35px;
    text-align: center;
    margin: 0;
}

.stats-box {
    background: transparent;
    padding: 0;
    margin: 0;
}

.stats-box .value {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin: 0;
}

.stats-table tbody tr:hover .stats-box .value {
    color: #DC143C;
}

.pagination {
    grid-column: 2;
    grid-row: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    margin-left: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.pagination-info {
    font-size: 0.95rem;
    color: #666;
    font-weight: 600;
    margin: 0;
}

.pagination-list {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.pagination-link {
    padding: 8px 12px;
    background: white;
    color: #DC143C;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 0.9rem;
    margin: 0;
}

.pagination-link:hover {
    background: #DC143C;
    color: white;
    border-color: #DC143C;
}

.pagination-current {
    padding: 8px 12px;
    background: #DC143C;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    font-size: 0.9rem;
    margin: 0;
}

.flag-icon {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.player-link {
    color: #003893;
    text-decoration: none;
    transition: color 0.2s ease;
}

.player-link:hover {
    color: #DC143C;
    text-decoration: underline;
}

.sorted-value {
    font-weight: 800 !important;
    color: #DC143C !important;
    background-color: rgba(220, 20, 60, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

@media (max-width: 1200px) {
    .stats-container {
        grid-template-columns: 280px 1fr;
        gap: 0;
        align-items: start;
    }

    .filters-section {
        padding: 1.2rem;
        grid-row: 2 / span 3;
        margin-right: 1.5rem;
    }

    .stats-summary,
    .table-wrapper,
    .pagination {
        margin-left: 1.5rem;
    }

    .stats-table {
        font-size: 0.9rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 0.8rem 0.6rem;
    }
}

@media (max-width: 1024px) {
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        align-items: auto;
    }

    .filters-section {
        grid-column: 1;
        grid-row: auto;
        position: static;
        margin: 0;
        margin-right: 0;
    }

    .stats-summary {
        grid-column: 1;
        grid-row: auto;
        margin: 0;
        margin-left: 0;
    }

    .table-wrapper {
        grid-column: 1;
        grid-row: auto;
        margin: 0;
        margin-left: 0;
    }

    .pagination {
        grid-column: 1;
        grid-row: auto;
        margin: 1rem 0 0 0;
    }

    .filter-buttons {
        flex-direction: row;
    }

    .btn-primary,
    .btn-secondary {
        width: auto;
        flex: 1;
    }

    .search-box-input {
        flex-direction: column;
    }

    .search-input,
    .search-btn {
        border-radius: 6px;
        width: 100%;
    }

    .search-btn::before {
        content: "🔍 ";
    }
}

@media (max-width: 768px) {
    .stats-container {
        padding: 0 0.75rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .filters-section {
        padding: 1rem;
    }

    .filter-controls {
        gap: 0.75rem;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .search-box-input {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-input,
    .search-btn {
        border-radius: 6px;
        width: 100%;
    }

    .stats-table {
        font-size: 0.85rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 0.7rem 0.5rem;
    }

    .rank {
        padding: 3px 10px;
        font-size: 0.8rem;
    }

    .player-name {
        font-size: 0.9rem;
    }

    .pagination {
        padding: 1.5rem;
        margin-top: 1rem;
    }

    .pagination-list {
        gap: 0.4rem;
    }

    .pagination-link,
    .pagination-current {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .stats-container {
        padding: 0 0.5rem;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filters-section {
        padding: 0.75rem;
    }

    .filters-section h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .filter-group label {
        font-size: 0.85rem;
    }

    .filter-input,
    .filter-select {
        padding: 9px 10px;
        font-size: 0.9rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .search-input,
    .search-btn {
        font-size: 0.85rem;
    }

    .stats-table {
        font-size: 0.8rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 0.6rem 0.4rem;
    }
}