.stats-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 1200px) {
    .stats-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-content {
        grid-template-columns: 1fr;
    }
}

.stat-block {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
}

.stat-block h2 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--text-heading);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
}

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

.stat-block table th {
    background: var(--bg-surface-elevated);
    padding: 8px 4px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
    font-weight: bold;
    color: var(--text-secondary);
}

.stat-block table td {
    padding: 6px 4px;
    border-bottom: 1px solid var(--border-secondary);
}

.stat-block table tr:hover {
    background: var(--table-row-hover);
}

.hero-cell img, .ability-cell img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.tooltip-trigger {
    cursor: help;
    color: var(--accent);
    margin-left: 5px;
}

.tooltip-text {
    display: none;
    position: absolute;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 200px;
    z-index: 1000;
    border: 1px solid var(--border-primary);
}

.tooltip-trigger:hover .tooltip-text {
    display: block;
}

/* Filter header */
.stats-page-header {
    background: var(--bg-surface-elevated);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.stats-filter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.filter-group label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.filter-group select,
.filter-group input[type="number"] {
    padding: 12px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-surface);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.filter-group select:focus,
.filter-group input[type="number"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.filter-group select:hover,
.filter-group input[type="number"]:hover {
    border-color: var(--accent);
}

.stats-submit-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.stats-submit-btn:hover {
    background: var(--accent-hover);
}

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

.season-info {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Simple headers */
.stat-block-header {
    margin-bottom: 15px;
}

.stat-block-header h2 {
    margin-bottom: 0;
    font-size: 16px;
}

.stat-block h2 {
    margin-bottom: 15px;
    font-size: 16px;
}

/* Tooltip with subfilter */
.tooltip-trigger {
    position: relative;
    cursor: pointer;
    margin-left: 8px;
}

.tooltip-trigger.has-filter {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.tooltip-trigger.has-filter:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

/* Advanced tooltip with subfilter */
.tooltip-trigger .tooltip-text.with-filter {
    min-width: 200px;
    padding: 12px;
    background: var(--bg-surface-elevated);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 1px solid var(--border-primary);
}

.filter-in-tooltip {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-in-tooltip label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.filter-control {
    display: flex;
    gap: 6px;
    align-items: center;
}

.filter-control input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-surface);
    font-size: 11px;
    color: var(--text-primary);
    outline: none;
}

.filter-control button {
    width: 24px;
    height: 24px;
    padding: 0;
    background: var(--color-negative);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-control button:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

/* Fixed height cells */
.hero-cell, .ability-cell, .player-cell {
    height: 35px;
    vertical-align: middle;
    padding: 4px 8px;
}

.hero-cell img, .ability-cell img {
    vertical-align: middle;
    margin-right: 6px;
    max-height: 24px;
}

.hero-cell span, .ability-cell span {
    vertical-align: middle;
    line-height: 1.1;
    font-size: 13px;
}

.hero-cell span, .ability-cell span {
    max-width: 120px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fixed row height */
.stat-block table tr {
    height: 35px;
}

.stat-block table td {
    vertical-align: middle;
    padding: 4px 8px;
    font-size: 13px;
}

.stat-block table th {
    vertical-align: middle;
    padding: 6px 8px;
    font-size: 13px;
}

/* Responsive filters */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: auto;
        width: 100%;
    }

    .stats-submit-btn {
        align-self: stretch;
        margin-top: 10px;
    }

    .stat-block-header {
        position: relative;
    }

    .sub-filter {
        position: static;
        margin-top: 4px;
        justify-content: flex-end;
        background: rgba(255,255,255,0.05);
    }

    .sub-filter-input {
        width: 45px;
    }
}
