body {
    font-family: 'DM Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f5f8fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-small {
    max-width: 150px;
    margin: 15px auto;
    display: block;
}

.nfl-logo {
    max-width: 120px;
}

/* Tab Styles */
.tab-container {
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    padding: 12px 24px;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #656565;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.tab-button.active {
    background: #fff;
    color: #013369;
    border-bottom-color: #013369;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-content {
    display: none;
}

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

/* Selection Container */
.selection-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.comparison-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
    display: none;
}

.comparison-container.active {
    display: block;
}

.selection-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
    justify-content: center;
}

label {
    font-weight: bold;
    min-width: 70px;
    text-align: right;
}

select, input[type="date"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    width: 480px;
    box-sizing: border-box;
}

#game-select-container {
    min-height: 50px;
}

/* Divisional Game Indicator */
.divisional-indicator {
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    font-weight: 600;
    border-radius: 5px;
    display: none;
}

.divisional-indicator.divisional {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.divisional-indicator.non-divisional {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
}

/* Teams Header */
.teams-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #f8f8f8;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.team-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    padding: 15px;
}

.team-logo-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.team-logo {
    max-width: 70px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.team-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #013369;
    margin-bottom: 5px;
}

.team-record {
    color: #656565;
    font-size: 1.1em;
    margin-bottom: 10px;
    font-weight: 600;
}

.qb-info {
    font-size: 0.9em;
    color: #555;
    background-color: #e9ecef;
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.vs-divider {
    font-size: 1.5em;
    font-weight: bold;
    color: #013369;
    text-align: center;
}

/* Section Title */
.section-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 5px;
    border-left: 4px solid #013369;
    text-align: left;
}

/* Clean Comparison Table */
.clean-comparison-table {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    margin-bottom: 20px;
}

.clean-table-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1.5fr;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.clean-table-header-cell {
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid #e0e0e0;
}

.clean-table-header-cell:first-child {
    text-align: left;
    padding-left: 12px;
}

.clean-table-header-cell:last-child {
    border-right: none;
    text-align: right;
    padding-right: 12px;
}

.clean-table-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1.5fr;
    border-bottom: 1px solid #e0e0e0;
    min-height: 44px;
    align-items: center;
}

.clean-table-row:last-child {
    border-bottom: none;
}

.clean-table-cell {
    padding: 8px;
    text-align: center;
    border-right: 1px solid #e0e0e0;
    background: #fff;
    font-size: 0.9em;
    font-weight: 500;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clean-table-cell:last-child {
    border-right: none;
}

.clean-table-cell.stat-label {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-align: left;
    justify-content: flex-start;
    padding-left: 12px;
}

.clean-table-cell.stat-label.right-align {
    text-align: right;
    justify-content: flex-end;
    padding-right: 12px;
    padding-left: 8px;
}

.clean-table-cell.better {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #0f5132 !important;
}

.clean-table-cell.worse {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #58151c !important;
}

.clean-table-cell.rank {
    font-size: 0.8em;
    color: #656565;
    background-color: #f8f9fa;
}

.clean-table-cell.rank.elite {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #0f5132 !important;
}

.clean-table-cell.rank.average {
    background-color: #fff3cd !important;
    border-color: #ffeaa7 !important;
    color: #856404 !important;
}

.clean-table-cell.rank.below-average {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #58151c !important;
}

/* Four Column Table for Standings */
.clean-table-header-4col {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.clean-table-header-4col .clean-table-header-cell:first-child {
    text-align: left;
    padding-left: 12px;
}

.clean-table-header-4col .clean-table-header-cell:last-child {
    text-align: right;
    padding-right: 12px;
    border-right: none;
}

.clean-table-row-4col {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    border-bottom: 1px solid #e0e0e0;
    min-height: 44px;
    align-items: center;
}

.clean-table-row-4col .clean-table-cell:first-child {
    text-align: left;
    justify-content: flex-start;
    padding-left: 12px;
}

.clean-table-row-4col .clean-table-cell:last-child {
    text-align: right;
    justify-content: flex-end;
    padding-right: 12px;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #013369;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* QB Passing Specific Styles */
.qb-comparison-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #013369;
}

.qb-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.qb-stats-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.qb-stats-header {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.0em;
    text-align: center;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.qb-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.qb-stat-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.qb-stat-value {
    font-weight: bold;
    color: #013369;
    font-size: 1.0em;
}

/* Trends Section */
.trends-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #ff9800;
}

.trends-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: left;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #ff9800;
}

.trends-comparison-table {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    margin-bottom: 20px;
}

.trends-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.trends-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    border-bottom: 1px solid #e0e0e0;
    min-height: 44px;
    align-items: center;
}

.trends-table-cell {
    padding: 8px;
    text-align: center;
    border-right: 1px solid #e0e0e0;
    background: #fff;
    font-size: 0.9em;
    font-weight: 500;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trends-table-cell:last-child {
    border-right: none;
}

.trends-table-cell.trend-label {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-align: left;
    justify-content: flex-start;
    padding-left: 12px;
}

.trends-table-cell.trend-label.right-align {
    text-align: right;
    justify-content: flex-end;
    padding-right: 12px;
    padding-left: 8px;
}

.trends-table-cell.trend-good {
    background-color: #d4edda !important;
    color: #0f5132 !important;
}

.trends-table-cell.trend-bad {
    background-color: #f8d7da !important;
    color: #58151c !important;
}

/* Game Logs Section */
.game-logs-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}

.game-logs-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: left;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #4caf50;
}

.game-logs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.game-logs-team-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.game-logs-team-header {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.0em;
    text-align: center;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.game-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.game-logs-table th {
    background: #013369;
    color: #fff;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #013369;
    font-size: 0.8em;
}

.game-logs-table td {
    padding: 6px 4px;
    text-align: center;
    border: 1px solid #ddd;
    background: #fff;
}

.game-logs-table .win {
    color: #28a745;
    font-weight: bold;
}

.game-logs-table .loss {
    color: #dc3545;
    font-weight: bold;
}

.game-logs-table .home {
    background-color: #e8f5e8;
}

.game-logs-table .away {
    background-color: #fff3cd;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .clean-table-header,
    .clean-table-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .clean-table-header-4col,
    .clean-table-row-4col {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .trends-table-header,
    .trends-table-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .game-logs-grid,
    .qb-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .selection-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    select, input[type="date"] {
        width: 100%;
    }
    
    .tab-button {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .container {
        padding: 10px;
    }
    
    .section-title {
        font-size: 1.1em;
        padding: 8px;
    }
    
    .team-info {
        padding: 10px;
    }
    
    .team-name {
        font-size: 1.3em;
    }
    
    .team-logo {
        max-width: 60px;
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .tab-button {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .team-name {
        font-size: 1.1em;
    }
    
    .team-logo {
        max-width: 50px;
        max-height: 50px;
    }
    
    .loading-content {
        padding: 20px;
    }
    
    .loading-text {
        font-size: 14px;
    }
}