﻿/* Team Statistics Page Styles */

.team-statistics-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

/* Statistics Overview Cards */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #013466;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.stat-subtext {
    font-size: 0.875rem;
    color: #666;
}

/* Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

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

.chart-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    margin-bottom: 1rem;
    max-width: 200px;
    max-height: 200px;
    margin-left: auto;
    margin-right: auto;
}

.chart-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    height: auto !important;
}

/* Smaller donut chart */
#results-pie-chart {
    max-width: 200px !important;
    max-height: 200px !important;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #333;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* No Statistics Message */
.no-statistics {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
}

.no-data-message {
    font-size: 1.125rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.help-text {
    font-size: 0.875rem;
    color: #999;
}

/* API-Football team statistics table (Home/Away/All) */
.team-api-stats-card {
    margin-bottom: 2rem;
}

/* Table wrapper - handles scrolling */
.api-stats-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}/* Combined wrapper+shell class - keep border and allow horizontal scroll */
.api-stats-table-wrap.api-stats-table-shell {
    border: 1px solid #e6e9ef;
    border-radius: 12px;
    background: #ffffff;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Shell alone (if nested structure) */
.api-stats-table-shell:not(.api-stats-table-wrap) {
    border: 1px solid #e6e9ef;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.team-statistics-section .api-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 400px; /* Ensure minimum width for readability */
}

.team-statistics-section .api-stats-table th,
.team-statistics-section .api-stats-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e6e9ef;
}

.team-statistics-section .api-stats-table thead th {
    font-weight: 700;
    color: #1a1a1a;
    background: #f5f6f8;
    text-align: center;
}

.team-statistics-section .api-stats-table thead th:first-child {
    text-align: left;
}

.team-statistics-section .api-stats-table tbody td {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.team-statistics-section .api-stats-table tbody td:first-child {
    text-align: left;
    color: #2b2f36;
    font-weight: 500;
}

.team-statistics-section .api-stats-table tbody tr:nth-child(even):not(.api-stats-group) {
    background: #fbfcfe;
}

.team-statistics-section .api-stats-group td {
    background: #f7f8fa;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
    color: #5a6472;
    padding-top: 0.9rem;
    padding-bottom: 0.55rem;
    border-bottom-color: #edf0f6;
}

.team-statistics-section .api-stats-table thead th.api-stats-colhead {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: #334155;
}

/* subtle vertical separators like the reference UI */
.team-statistics-section .api-stats-table th:nth-child(3),
.team-statistics-section .api-stats-table td:nth-child(3),
.team-statistics-section .api-stats-table th:nth-child(4),
.team-statistics-section .api-stats-table td:nth-child(4) {
    border-left: 1px solid #eef1f6;
}.team-statistics-section .api-stats-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Mobile responsive styles - keep border, allow scroll */
@media (max-width: 600px) {
    .team-api-stats-card {
        margin-bottom: 1.5rem;
    }
    
    /* Keep the border but reduce padding */
    .team-api-stats-card.chart-card {
        padding: 0;
    }
    
    .team-statistics-section .api-stats-table {
        font-size: 0.85rem;
        min-width: 360px; /* Allow scroll if needed */
    }
    
    .team-statistics-section .api-stats-table th,
    .team-statistics-section .api-stats-table td {
        padding: 0.5rem 0.45rem;
    }
    
    /* First column (labels) */
    .team-statistics-section .api-stats-table tbody td:first-child,
    .team-statistics-section .api-stats-table thead th:first-child {
        font-size: 0.8rem;
    }
    
    /* Data columns */
    .team-statistics-section .api-stats-table thead th:not(:first-child),
    .team-statistics-section .api-stats-table tbody td:not(:first-child) {
        min-width: 50px;
    }
    
    .team-statistics-section .api-stats-group td {
        font-size: 0.7rem;
        padding-top: 0.6rem;
        padding-bottom: 0.35rem;
    }
    
    .team-statistics-section .api-stats-table thead th.api-stats-colhead {
        font-size: 0.7rem;
    }
    
    /* Statistics cards - 2 per row on mobile */
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .stat-subtext {
        font-size: 0.75rem;
    }
    
    /* Other chart cards */
    .chart-card:not(.team-api-stats-card) {
        padding: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .team-statistics-section .api-stats-table {
        font-size: 0.8rem;
        min-width: 340px;
    }
    
    .team-statistics-section .api-stats-table th,
    .team-statistics-section .api-stats-table td {
        padding: 0.45rem 0.35rem;
    }
    
    .team-statistics-section .api-stats-table tbody td:first-child,
    .team-statistics-section .api-stats-table thead th:first-child {
        font-size: 0.75rem;
    }
    
    .team-statistics-section .api-stats-table thead th:not(:first-child),
    .team-statistics-section .api-stats-table tbody td:not(:first-child) {
        min-width: 42px;
        font-size: 0.8rem;
    }
    
    /* Statistics cards */
    .stats-overview {
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}
