/* Tab Navigation */
.tab-btn {
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #374151;
}

.tab-btn.active {
    color: #111827;
    border-bottom-color: var(--team-primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Game Selection Buttons */
.game-btn {
    padding: 0.5rem 1rem;
    background-color: #ffffff;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #d1d5db;
}

.game-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.game-btn.selected {
    background-color: var(--team-primary);
    border-color: var(--team-primary);
    color: white;
}

/* Login Button */
.login-btn {
    background-color: var(--team-primary);
    color: white;
}

.login-btn:hover {
    background-color: var(--team-secondary);
}

/* View Mode Toggle */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-switch.active {
    background-color: var(--team-primary);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

/* Login Error */
#login-error {
    color: var(--team-primary);
}

/* Stats Table */
.stats-table {
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-table th {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.stats-table th.player-col {
    text-align: left;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.stats-table th.umbrella:not(.player-col) {
    min-width: 40px;
}

.stats-table th.sub-header {
    width: 45px;
    min-width: 45px;
    max-width: 45px;
}

.stats-table td {
    padding: 0.75rem 0.5rem;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
    text-align: center;
    width: 45px;
    min-width: 45px;
    max-width: 45px;
}

.stats-table th.umbrella {
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stats-table th.sub-header {
    background-color: #f9fafb;
    color: #6b7280;
    font-weight: 500;
    width: 45px;
    min-width: 45px;
    max-width: 45px;
}

.stats-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.stats-table th.sortable:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.stats-table th.sorted {
    color: #111827;
    font-weight: 600;
}

.stats-table td {
    padding: 0.75rem 0.5rem;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
    text-align: center;
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-table td.player-col {
    text-align: left;
    font-weight: 500;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    max-width: 140px;
}

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

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

/* Rate columns (percentage/rating) */
.stats-table td.rate-col {
    color: #6b7280;
    font-style: italic;
}

/* Group separators - vertical bars between umbrella groups */
.stats-table th.group-end,
.stats-table td.group-end {
    border-right: 2px solid #d1d5db;
}

.stats-table th.group-end {
    border-right: 2px solid #9ca3af;
}

/* Expandable rows */
.stats-table td.expandable {
    cursor: pointer;
}

.stats-table td.expandable:hover {
    color: var(--team-primary);
}

/* Chart Containers */
#attack-chart,
#attack-efficiency-chart,
#reception-chart {
    width: 100%;
    min-height: 500px;
}

/* Set Selection Buttons */
.set-btn {
    padding: 0.375rem 0.75rem;
    background-color: #ffffff;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
}

.set-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.set-btn.selected {
    background-color: var(--team-secondary);
    border-color: var(--team-secondary);
    color: white;
}

/* Expand Arrow */
.expand-arrow {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    transition: transform 0.2s;
}

/* Player Row */
.player-row td.expandable {
    cursor: pointer;
}

.player-row td.expandable:hover {
    color: var(--team-primary);
}

/* Set Row */
.set-row {
    background-color: #f9fafb;
    font-size: 0.875rem;
}

.set-row td {
    padding: 0.5rem;
}

.set-row td.set-data {
    color: #6b7280;
}

.set-row td.player-col {
    padding-left: 2.5rem;
    color: #6b7280;
    font-weight: 400;
}

/* Chart Card Expand */
.chart-card {
    position: relative;
}

.expand-chart-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.expand-chart-btn:hover {
    background-color: #f3f4f6;
}

.expand-icon {
    transition: transform 0.3s ease;
}

/* Per-Set Chart Container */
.chart-sets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.per-set-chart {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
}

.per-set-chart-container {
    width: 100%;
    min-height: 400px;
}

/* Team Logo */
.team-logo {
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* Team Total rows */
tr.team-total-row {
    border-top: 3px solid #374151;
    font-weight: 700;
    background-color: #f3f4f6;
}

tr.team-total-row td {
    color: #111827;
}

tr.team-total-row td.player-col {
    font-weight: 700;
}

.stats-table tr.team-total-row:hover {
    background-color: #e5e7eb;
}
