:root {
    --stats-card-bg: #0D0D0F;
}

body.light-theme {
    --stats-card-bg: #eae2d2;
}

.stats-section {
    padding-top: 20px !important;
}

.stats-header-new {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-bottom: 20px !important;
    width: 100%;
    margin-top: 10px !important;
    border-bottom: 1px solid var(--border-highlight) !important;
}

.stats-header-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px !important;
}

.filters-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Custom Select Dropdowns */
.custom-select-container {
    position: relative;
    z-index: 10;
    width: 190px;
}

.custom-select-container.open {
    z-index: 110 !important;
}

.custom-select-trigger {
    width: 100%;
    background: var(--stats-card-bg) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: 'Onest', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
    height: 44px;
    white-space: nowrap;
    gap: 8px;
}

.custom-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.light-theme .custom-select-trigger:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

.chevron-icon {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.custom-select-container.open .chevron-icon {
    transform: rotate(180deg);
}

.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: var(--stats-card-bg) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    z-index: 100;
    box-sizing: border-box;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
    flex-direction: column;
    gap: 4px;
}

.light-theme .custom-select-options {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.custom-select-container.open .custom-select-options {
    display: flex;
}

.custom-select-option {
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.light-theme .custom-select-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.custom-select-option.selected {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 600;
}

.search-row-new {
    position: relative;
    z-index: 1;
    width: 320px;
    margin-bottom: 0;
}

.search-row-new form {
    margin: 0;
}

.search-input-new {
    width: 100%;
    height: 44px;
    background: var(--stats-card-bg) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 16px 0 42px !important;
    color: var(--text-main);
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

.search-input-new:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.light-theme .search-input-new:focus {
    border-color: rgba(0, 0, 0, 0.25);
}

.search-input-new::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.search-icon-new {
    position: absolute;
    left: 16px !important;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 5;
}

@media (max-width: 768px) {
    .stats-header-new {
        margin-bottom: 24px;
    }

    .stats-header-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }

    .custom-select-container {
        width: 100% !important;
    }

    .search-row-new {
        width: 100% !important;
        margin-bottom: 0;
    }

    .search-input-new {
        border-radius: 10px;
    }
}

/* Stats Content Inner Alignment */
.stats-section .container {
    max-width: 1400px !important;
}

.stats-inner-container {
    max-width: 1400px !important;
    margin: 0 auto;
    width: 100%;
}

/* Tab Border Alignments */
.tab-item.active {
    --tab-border: var(--border-highlight) !important;
    margin-bottom: -1px !important;
    border-bottom: 1px solid var(--card-bg) !important;
}

body.light-theme .tab-item.active {
    --tab-border: var(--border-highlight) !important;
    border-bottom-color: var(--card-bg) !important;
}

/* Grid & Cards Auto-Fill Fixes */
.players-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 16px !important;
}

.player-card {
    width: 100% !important;
    box-sizing: border-box !important;
    background: var(--stats-card-bg) !important;
    border: 1px solid var(--border-highlight) !important;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s, background-color 0.2s !important;
    animation: fadeInUp 0.4s ease-out both;
}

.player-card:hover {
    background: var(--hover-bg) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-4px) !important;
}

body.light-theme .player-card:hover {
    border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Staggered card entry animations */
.player-card:nth-child(1) {
    animation-delay: 0.04s;
}

.player-card:nth-child(2) {
    animation-delay: 0.08s;
}

.player-card:nth-child(3) {
    animation-delay: 0.12s;
}

.player-card:nth-child(4) {
    animation-delay: 0.16s;
}

.player-card:nth-child(5) {
    animation-delay: 0.2s;
}

.player-card:nth-child(6) {
    animation-delay: 0.24s;
}

.player-card:nth-child(7) {
    animation-delay: 0.28s;
}

.player-card:nth-child(8) {
    animation-delay: 0.32s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Badge Indicators */
.card-stats-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    box-sizing: border-box;
}

.stat-icon {
    flex-shrink: 0;
}

.like-badge {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
}

.dislike-badge {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
}

.time-badge {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.08);
}