body {
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    padding-top: 60px;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

.navbar {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Navbar Brand Styling */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.navbar-brand:hover {
    transform: translateY(-1px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: #ffffff !important;
}

.navbar-logo {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    max-height: 32px !important;
    max-width: 32px !important;
    min-height: 32px;
    min-width: 32px;
    object-fit: contain;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    max-height: 32px !important;
    max-width: 32px !important;
}

.brand-text {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

/* Navigation Links Styling */
.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.75rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.85) !important;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255,255,255,0.15);
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: #28a745;
    border-radius: 2px;
}

/* Navbar Toggler Styling */
.navbar-toggler {
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    border-color: rgba(255,255,255,0.6);
    background-color: rgba(255,255,255,0.1);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

/* Mobile Navbar Enhancements */
@media (max-width: 991.98px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-logo {
        height: 28px;
        width: 28px;
        max-height: 28px !important;
        max-width: 28px !important;
        min-height: 28px;
        min-width: 28px;
        object-fit: contain;
    }
    
    .navbar-collapse {
        background-color: rgba(0,0,0,0.95);
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .navbar-nav .nav-link {
        font-size: 1.05rem;
        padding: 0.75rem 1.25rem !important;
        margin: 0.25rem 0;
        border-radius: 8px;
    }
    
    .navbar-nav .nav-link.active::after {
        display: none;
    }
    
    .navbar-nav .nav-link.active {
        background-color: rgba(255,255,255,0.2);
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .brand-text {
        font-size: 1.1rem;
    }
    
    .navbar-logo {
        height: 24px;
        width: 24px;
        max-height: 24px !important;
        max-width: 24px !important;
        min-height: 24px;
        min-width: 24px;
        object-fit: contain;
    }
}

.container {
    max-width: 1200px;
}

.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    position: relative;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
}

#standings-table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: separate;
    border-spacing: 0;
}

#standings-table th,
#standings-table td {
    padding: 0.5rem;
    vertical-align: middle;
    border: 1px solid #dee2e6;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    font-size: 0.95rem;
}

#standings-table th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #f8f9fa;
    font-weight: bold;
    cursor: pointer;
    text-align: center; /* Center headers */
}

/* Highlight pinned entries with a different background color */
#standings-table tr.pinned-entry {
    background-color: #fff3cd; /* Light yellow background */
}

/* Highlight favorited entries */
#standings-table tr.favorited-row {
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 50%, #fff8e1 100%);
    border-left: 3px solid #ffc107;
}

#standings-table tr.favorited-row:hover {
    background: linear-gradient(135deg, #fff3cd 0%, #fffbf0 50%, #fff3cd 100%);
}

/* Bold the values in the rank column */
#standings-table td.rank-col {
    font-weight: bold; /* Makes rank values bold */
}

/* Update styles for the first two columns */
#standings-table th:nth-child(-n+2),
#standings-table td:nth-child(-n+2) {
    position: sticky;
    background-color: #f8f9fa;
    z-index: 10;
}

#standings-table th:nth-child(1),
#standings-table td:nth-child(1) {
    left: 0;
    z-index: 15;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

#standings-table th:nth-child(2),
#standings-table td:nth-child(2) {
    left: 30px; /* Adjusted from 40px to 30px to align with rank-col's width */
    z-index: 14;
}

/* Remove the border-right from the second column */
#standings-table th:nth-child(2),
#standings-table td:nth-child(2) {
    border-right: none;
}

/* Add a subtle box-shadow to the third column for separation */
#standings-table th:nth-child(3),
#standings-table td:nth-child(3) {
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
}

/* Ensure headers are above cells */
#standings-table th:nth-child(-n+3) {
    z-index: 25;
}

/* Add shadows for visual separation */
#standings-table th:nth-child(3),
#standings-table td:nth-child(3) {
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

#standings-table thead::after {
    /* Removed this entire block to fix the unwanted line */
    /*
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background-color: #dee2e6;
    z-index: 26;
    */
}

#standings-table td:nth-child(2) {
    font-size: 0.9rem;
    text-align: left;
    padding-left: 5px;
    white-space: normal;
    word-wrap: break-word;
    max-width: 180px;
    line-height: 1.2;
}

.sort-icon::after {
    content: '\25B2';
    margin-left: 5px;
}

.sort-icon.desc::after {
    content: '\25BC';
}

/* Clean Layout: Controls and Search */
.search-filter-container {
    margin-bottom: 1.5rem;
}

/* Desktop Layout: Single row, well spaced */
@media (min-width: 768px) {
    .search-filter-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
    }
    
    .control-group {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .search-row {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .search-box {
        width: 250px;
    }
    
    .season-selector-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        white-space: nowrap;
    }
    
    .season-selector-wrapper select {
        min-width: 85px;
    }
}

/* Mobile Layout: Stacked, organized */
@media (max-width: 767px) {
    .search-filter-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-group {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .search-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }
    
    .search-box {
        flex: 1;
        min-width: 120px;
    }
    
    .season-selector-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .season-selector-wrapper select {
        min-width: 85px;
    }
}

#what-if-container {
    background-color: #f0f0ff;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

#what-if-container h2 {
    color: #4b0082;
    font-size: 1.2rem; /* Further reduced from 1.3rem */
    margin-bottom: 0.5rem;
}

#what-if-container h3,
#what-if-container h4 {
    color: #8a2be2;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

#what-if-disclaimer {
    font-style: italic;
    color: #666;
}

.what-if-background {
    background-color: #e6e6fa !important;
}

.compact-selectors select {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem; /* Reduced padding for compactness */
    margin-bottom: 0.5rem;
    min-width: 120px; /* Ensured minimum width */
}

.compact-selectors label {
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
    display: inline-block;
    width: 100%;
}

#what-if-container .row {
    margin-left: -5px;
    margin-right: -5px;
}

#what-if-container .col-md-4 {
    padding-left: 5px;
    padding-right: 5px;
}

/* Center the pin column values */
#standings-table th.pin-col,
#standings-table td.pin-col {
    text-align: center; /* Ensure pin column content is centered */
    position: sticky;
    right: 0;
    z-index: 16;
    background-color: #f8f9fa;
}

#standings-table .favorite-button {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
}

#standings-table .favorite-button.favorited {
    color: #f39c12; /* golden star when favorited */
    transform: scale(1.05);
}

/* Make team names bold */
#standings-table td.name-col {
    font-weight: bold; /* Makes team names bold */
}

/* Make all team column values bold */
#standings-table td[data-sort="short"],
#standings-table td[data-sort^="team"],
#standings-table td:nth-child(3) { /* Added selector for the short column */
    font-weight: bold; /* Makes team column values bold */
}

@media (max-width: 768px) {
    .container {
        padding: 0 5px;
    }

    #standings-table th,
    #standings-table td {
        padding: 0.2rem;
        font-size: 0.85rem;
        max-width: 80px;
    }

    #standings-table td:nth-child(2) {
        font-size: 0.75rem;
        max-width: none;
        width: auto;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.1;
    }

    #standings-table .rank-col {
        width: 30px;
        max-width: 30px;
        padding: 0.1rem;
    }

    #standings-table .name-col {
        width: auto;
        max-width: none;
    }

    #standings-table .score-col {
        width: 50px;
        max-width: 50px;
    }

    #standings-table th:nth-child(2),
    #standings-table td:nth-child(2) {
        left: 30px; /* Align name-col directly after rank-col */
    }

    #standings-table td:not(.rank-col):not(.name-col):not(.pin-col):not(.score-col) {
        min-width: 50px;
        width: 50px;
        font-size: 0.9em;
        padding: 0.05rem;
    }

    #what-if-container .row {
        display: flex;
        flex-wrap: wrap;
    }

    #what-if-container .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    #standings-table th[data-sort="tfp_score"] {
        font-size: 0.75rem;
        line-height: 1.2;
        padding: 0.2rem;
    }

    #standings-table th:nth-child(1),
    #standings-table td:nth-child(1) {
        width: 30px;
        max-width: 30px;
        font-size: 0.7rem;
        padding: 0.1rem;
    }

    /* Bold the entry scores */
    #standings-table td.tfp-score {
        font-weight: bold;
    }

    /* Remove the break between rank-col and name-col on mobile/narrow viewports */
    #standings-table th.rank-col,
    #standings-table td.rank-col {
        left: 0; /* Ensure rank column stays at the start */
    }

    #standings-table th.name-col,
    #standings-table td.name-col {
        left: 30px; /* Align name column directly after rank column */
    }

    /* Ensure no extra left margin/padding is causing the break */
    #standings-table th,
    #standings-table td {
        box-sizing: border-box; /* Ensure padding does not add to width */
    }

    .compact-selectors select {
        min-width: 100px; /* Adjust as necessary to fit text */
        font-size: 0.8rem; /* Further reduce font size on smaller screens */
    }

    #what-if-container h2 {
        font-size: 0.75rem; /* Further reduced from 0.8rem */
        margin-bottom: 0.5rem; /* Adjusted for compactness */
    }

    #what-if-container p {
        font-size: 0.75rem; /* Further reduced from 0.8rem */
        margin-bottom: 0.5rem; /* Adjusted for compactness */
    }
    
    .compact-selectors {
        margin-bottom: 0.5rem; /* Reduced margin for stacking */
    }

    /* Stack the selectors vertically on mobile */
    #what-if-container .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem; /* Added spacing between stacked columns */
    }

    /* Ensure dropdowns have adequate minimum width */
    .compact-selectors select {
        min-width: 100%; /* Full width on mobile */
    }

    /* Adjust button sizes on mobile */
    #what-if-container .btn {
        width: 100%;
        margin-bottom: 0.5rem; /* Space between buttons */
    }
}


#standings-table th[data-sort="tfp_score"] {
    white-space: normal;
    word-wrap: break-word;
    max-width: 100px;
    line-height: 1.2;
    padding: 0.5rem 0.25rem; /* Adjust vertical and horizontal padding as needed */
}

/* Optional: Reduce padding and margin for What If? buttons and containers */
#what-if-container .btn {
    padding: 0.4rem 0.8rem; /* Slightly smaller button padding */
    font-size: 0.85rem; /* Smaller button text */
}

#what-if-container .row {
    margin-left: -10px; /* Reduced negative margin for tighter stacking */
    margin-right: -10px;
}

#what-if-container .col-md-4 {
    padding-left: 10px; /* Reduced padding for tighter layout */
    padding-right: 10px;
}

/* {{ edit_1 }}
   Implement CSS Grid for What If? section with two columns on all screen sizes */
#what-if-container .what-if-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for AFC and NFC */
    gap: 0.5rem; /* Reduced gap for compactness */
}

/* {{ edit_2 }}
   Style each column within the grid */
#what-if-container .what-if-column {
    display: flex;
    flex-direction: column;
    gap: 0.3rem; /* Reduced space between selector groups */
}

/* {{ edit_3 }}
   Style the Super Bowl Winner section */
#what-if-container .what-if-superbowl {
    margin-top: 0.5rem; /* Reduced top margin for compactness */
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* {{ edit_4 }}
   Style selector-group to align labels and selects properly */
.selector-group {
    display: flex;
    align-items: center;
    gap: 0.2rem; /* Adjusted gap between label and select */
    flex-wrap: nowrap;
}

/* {{ edit_5 }}
   Limit the width of select elements and make text smaller */
.what-if-select {
    width: 50px; /* Reduced width to fit 2-3 character codes */
    padding: 0.15rem 0.25rem; /* Further reduced padding */
    box-sizing: border-box; /* Include padding and border in width */
    font-size: 0.75rem; /* Smaller font size */
}

/* {{ edit_6 }}
   Ensure grid remains two columns on mobile and prevent overflow */
@media (max-width: 768px) {
    #what-if-container .what-if-grid {
        grid-template-columns: 1fr 1fr; /* Maintain two columns */
        gap: 0.4rem; /* Slightly reduced gap */
    }
    
    /* Adjust select elements to prevent overflow */
    .what-if-select {
        width: 50px !important; /* Enforce compact width */
    }
    
    /* Reduce font sizes further for mobile */
    #what-if-container h2 {
        font-size: 1rem; /* Smaller h2 font */
        margin-bottom: 0.3rem;
    }

    #what-if-container p {
        font-size: 0.7rem; /* Smaller paragraph font */
        margin-bottom: 0.3rem;
    }

    /* Adjust Super Bowl Winner section */
    #what-if-container .what-if-superbowl h5 {
        font-size: 0.9rem; /* Smaller font */
    }

    /* Ensure selector-groups do not wrap */
    .selector-group {
        flex: 1 1 auto;
    }
}

/* {{ edit_7 }}
   Prevent overflow within what-if-container */
#what-if-container {
    overflow: auto; /* Allow scrolling if necessary */
}

/* Apply box-sizing globally if not already */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Optional: Customize the appearance of the select dropdown arrow */
.what-if-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: url('data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns="http://www.w3.org/2000/svg" width="10" height="7"%3E%3Cpath fill="%23333" d="M0 0l5 7 5-7z"/%3E%3C/svg%3E') no-repeat right 10px center;
    background-size: 10px 7px;
    padding-right: 15px; /* Space for the custom arrow */
}

/* Score range styling with more levels */
.score-elite {
    background-color: #006400 !important; /* Dark Green */
    color: white !important;
}

.score-excellent {
    background-color: #28a745 !important; /* Green */
    color: white !important;
}

.score-very-good {
    background-color: #20c997 !important; /* Teal */
    color: white !important;
}

.score-great {
    background-color: #17a2b8 !important; /* Blue */
    color: white !important;
}

.score-good {
    background-color: #0dcaf0 !important; /* Light Blue */
    color: black !important;
}

.score-above-average {
    background-color: #ffc107 !important; /* Yellow */
    color: black !important;
}

.score-average {
    background-color: #fd7e14 !important; /* Orange */
    color: white !important;
}

.score-below-average {
    background-color: #e35d6a !important; /* Light Red */
    color: white !important;
}

.score-poor {
    background-color: #dc3545 !important; /* Red */
    color: white !important;
}

/* Make score column text larger */
#standings-table td.tfp-score {
    font-size: 1.1rem !important;
    font-weight: bold !important;
}

/* Ensure score colors remain visible in What If mode */
.what-if-mode .tfp-score.score-elite,
.what-if-mode .tfp-score.score-excellent,
.what-if-mode .tfp-score.score-very-good,
.what-if-mode .tfp-score.score-great,
.what-if-mode .tfp-score.score-good,
.what-if-mode .tfp-score.score-above-average,
.what-if-mode .tfp-score.score-average,
.what-if-mode .tfp-score.score-below-average,
.what-if-mode .tfp-score.score-poor {
    opacity: 0.9;
}

/* Add these styles at the end of your CSS file */

.analysis-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.close-modal {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.see-all-btn {
    width: 100%;
    text-align: center;
}

/* Table styles for the modal */
.modal-body .table {
    width: 100%;
    margin-bottom: 0;
}

.modal-body .table th {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 1;
}

/* Add these styles at the end of your CSS file */
#optimalSolutionsTable {
    font-size: 0.9rem;
    width: 100%;
}

#optimalSolutionsTable thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Align columns appropriately */
#optimalSolutionsTable td,
#optimalSolutionsTable th {
    padding: 0.5rem;
    vertical-align: middle;
}

/* Center the Short Team column */
#optimalSolutionsTable td:first-child,
#optimalSolutionsTable th:first-child {
    text-align: center;
}

/* Right-align numeric columns */
#optimalSolutionsTable td:nth-child(2),
#optimalSolutionsTable td:nth-child(3),
#optimalSolutionsTable th:nth-child(2),
#optimalSolutionsTable th:nth-child(3) {
    text-align: center;
}

/* Format the Long Teams column */
#optimalSolutionsTable td:last-child,
#optimalSolutionsTable th:last-child {
    text-align: left;
}

/* Style for team abbreviations */
.team-abbr {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
    margin: 0 2px;
    min-width: 45px;
    text-align: center;
}

/* Remove the gradient and shadow effects */
.team-abbr:hover {
    opacity: 0.9;
    cursor: default;
}

/* Responsive styling */
@media (max-width: 768px) {
    #optimalSolutionsTable {
        font-size: 0.8rem;
    }
    
    #optimalSolutionsTable td,
    #optimalSolutionsTable th {
        padding: 0.3rem;
    }
    
    /* Allow Long Teams column to wrap on mobile */
    #optimalSolutionsTable td:last-child {
        white-space: normal;
        word-wrap: break-word;
    }
    
    .team-abbr {
        padding: 0.1rem 0.3rem;
        margin: 1px;
    }
}

/* Mobile card view for standings */
.standings-card-list {
    display: none;
}

@media (max-width: 576px) {
    .table-container { display: none; }
    .standings-card-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
    .standings-card {
        border: 1px solid #dee2e6;
        border-radius: 12px;
        padding: 16px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
        transition: all 0.2s ease;
    }
    
    .standings-card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.12);
        transform: translateY(-1px);
    }
    
    .standings-card-header { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        margin-bottom: 12px; 
    }
    
    .standings-card-left {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
    }
    
    .standings-card-title-row {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .standings-card-name { 
        font-weight: 700; 
        font-size: 1.1rem; 
        color: #333;
        line-height: 1.2;
        margin: 0;
        flex: 1;
    }
    
    .standings-card-rank { 
        font-weight: 800; 
        color: #333; 
        font-size: 0.9rem;
        background-color: #f8f9fa;
        padding: 4px 8px;
        border-radius: 6px;
        display: inline-block;
        width: fit-content;
        min-width: 42px;
        text-align: center;
    }
    
    .standings-card-meta {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: 4px;
    }
    
    .standings-card-short-team {
        opacity: 0.8; /* Slightly muted to distinguish from long teams */
    }
    
    .standings-card-favorited {
        background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%) !important;
        border-color: #ffc107 !important;
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2) !important;
    }
    
    .standings-card-favorited:hover {
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3) !important;
    }
    
    .standings-card-score { 
        font-weight: 800; 
        font-size: 1.2rem;
        margin-left: auto;
        display: flex;
        align-items: center;
        min-height: 40px;
        padding: 6px 10px;
        border-radius: 6px;
        /* Default styling - score color classes from desktop will override */
        background-color: #f8f9fa;
        color: #333;
    }
    
    /* Ensure mobile cards inherit desktop score color classes */
    .standings-card-score.score-elite,
    .standings-card-score.score-excellent,
    .standings-card-score.score-very-good,
    .standings-card-score.score-great,
    .standings-card-score.score-good,
    .standings-card-score.score-above-average,
    .standings-card-score.score-average,
    .standings-card-score.score-below-average,
    .standings-card-score.score-poor {
        font-size: 1.2rem !important;
        font-weight: 800 !important;
    }
    
    .standings-card-teams { 
        display: flex; 
        flex-wrap: wrap; 
        gap: 6px; 
        margin-top: 12px; 
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }
    
    .standings-card-team { 
        font-weight: 600; 
        padding: 4px 8px; 
        border-radius: 6px; 
        font-size: 0.85rem;
        border: 2px solid currentColor;
        opacity: 0.9;
    }
    
    .standings-card-pin { 
        background: transparent; 
        border: none; 
        font-size: 20px; 
        line-height: 1;
        color: #ccc;
        transition: all 0.2s ease;
        padding: 4px;
        display: flex;
        align-items: center;
        height: 40px; /* Match the score height */
    }
    
    .standings-card-pin:hover {
        color: #f39c12;
        transform: scale(1.1);
    }
    
    .standings-card-pin.pinned { 
        color: #f39c12;
        transform: scale(1.1); 
    }
}

/* Team pills for optimal solutions */
.optimal-team-pill {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
    text-align: center;
    min-width: 32px;
}

/* Sortable table styles */
.sortable {
    cursor: pointer;
    position: relative;
}

.sortable:after {
    content: '↕';
    position: absolute;
    right: 2px;
    opacity: 0.4;
}

.sortable.sort-asc:after {
    content: '↑';
    opacity: 1;
}

.sortable.sort-desc:after {
    content: '↓';
    opacity: 1;
}

/* Budget group spacing */
.budget-group-spacer {
    height: 20px;
    background-color: #f8f9fa;
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
}

/* Hover effect for sortable columns */
.sortable:hover {
    background-color: #e9ecef;
}

/* Make the table header sticky */
#optimalSolutionsTable thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: white;
}

/* Form switch compact styles */
.form-switch.compact {
    width: auto;
    min-height: 1.5rem;
    margin: 0;
    padding-left: 2.8em;
}

.form-switch.compact .form-check-input {
    width: 2.5em;
    height: 1.25em;
    margin-left: -2.8em;
    flex-shrink: 0;
}

.form-switch.compact .form-check-label {
    white-space: nowrap;
    padding-left: 0.5em;
    font-size: 0.9rem;
}

/* Selector group styles */
.selector-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.selector-group .lock-icon {
    margin-left: 0.5rem;
    font-size: 1rem;
    color: #666;
}

.selector-group select:disabled + .lock-icon {
    display: inline-block;
}

.selector-group select:not(:disabled) + .lock-icon {
    display: none;
}

/* What If mode styling for headers */
th.what-if-background {
    background-color: #e6e6fa !important;
    font-style: italic;
}

/* What If grid layout */
.what-if-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.what-if-column {
    padding: 1rem;
    background-color: rgba(240, 240, 255, 0.5);
    border-radius: 4px;
}

.what-if-superbowl {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(240, 240, 255, 0.5);
    border-radius: 4px;
}

/* Standings update text */
.standings-update-text {
    font-style: italic;
    text-align: right;
    margin-bottom: 1rem;
}

/* Playoff bracket styles */
.playoff-bracket {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.playoff-bracket h5 {
    color: #4b0082;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.playoff-bracket h6 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.playoff-round {
    margin-bottom: 1rem;
}

.playoff-game {
    margin-bottom: 10px;
}

.matchup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.team-button {
    min-width: 45px;
    max-width: 45px;
    height: 30px;
    padding: 2px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.team-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.team-button.winner {
    border-width: 2px;
    transform: scale(1.05);
}

.vs {
    font-size: 0.75rem;
    color: #666;
    margin: 0 2px;
}

/* Mobile adjustments for playoff bracket */
@media (max-width: 768px) {
    .playoff-bracket {
        padding: 0.75rem;
    }

    .playoff-bracket h5 {
        font-size: 1rem;
    }

    .playoff-bracket h6 {
        font-size: 0.85rem;
    }

    .team-button {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    .vs {
        font-size: 0.7rem;
    }
}

/* Seed selector styles */
.seed-selector {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    border-radius: 4px;
}

.seed-selector h6 {
    color: #4b0082;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.seed-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.seed-row label {
    flex: 0 0 70px;
    font-size: 0.85rem;
    color: #666;
}

.seed-row select {
    flex: 1;
    font-size: 0.85rem;
}

/* Mobile adjustments for seed selector */
@media (max-width: 768px) {
    .seed-selector {
        padding: 0.75rem;
    }

    .seed-row label {
        flex: 0 0 60px;
        font-size: 0.8rem;
    }

    .seed-row select {
        font-size: 0.8rem;
    }
}

/* Division winners section */
.division-winners {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 1rem;
    border-radius: 4px;
}

.division-winners h6 {
    color: #4b0082;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.selector-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.selector-group label {
    flex: 0 0 70px;
    font-size: 0.85rem;
    color: #666;
}

.selector-group select {
    flex: 1;
    font-size: 0.85rem;
}

.selector-group .lock-icon {
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.selector-group select:disabled + .lock-icon {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .division-winners {
        padding: 0.75rem;
    }

    .selector-group label {
        flex: 0 0 60px;
        font-size: 0.8rem;
    }

    .selector-group select {
        font-size: 0.8rem;
    }

    .selector-group .lock-icon {
        font-size: 0.8rem;
    }
}

.playoff-round.championship,
.playoff-round.super-bowl {
    margin-top: 20px;
}

.playoff-game .team-button.winner {
    font-weight: bold;
    border: 2px solid #28a745;
}

/* Make the What If section more compact */
#what-if-container {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.what-if-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.what-if-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.division-winners {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.seed-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 5px;
}

.playoff-bracket {
    font-size: 0.9rem;
}

/* Compact form controls */
.form-select-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.selector-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.selector-group label {
    margin: 0;
    white-space: nowrap;
    font-size: 0.875rem;
}

/* Responsive layout */
@media (min-width: 992px) {
    .content-grid {
        display: grid;
        grid-template-columns: minmax(300px, 400px) 1fr;
        gap: 20px;
        align-items: start;
        padding-top: 20px;
    }
    
    #what-if-container {
        position: sticky;
        top: 80px; /* Account for navbar */
        max-height: calc(100vh - 100px); /* Adjusted to account for navbar and padding */
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0,0,0,0.2) transparent;
        background-color: #f8f9fa;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 20px;
    }

    #what-if-container::-webkit-scrollbar {
        width: 8px;
    }

    #what-if-container::-webkit-scrollbar-track {
        background: transparent;
    }

    #what-if-container::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.2);
        border-radius: 4px;
    }

    .table-container {
        margin-top: 0;
    }
}

@media (max-width: 991px) {
    .content-grid {
        padding: 15px;
    }

    #what-if-container {
        margin-bottom: 20px;
        background-color: #f8f9fa;
        border-radius: 8px;
        padding: 15px;
    }

    .table-container {
        margin-top: 20px;
    }
}

/* What If sections */
.what-if-section {
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 15px;
}

.what-if-section:last-child {
    margin-bottom: 0;
}

.what-if-section h5 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1rem;
}

/* Action buttons container */
.btn-group-spaced {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.btn-group-spaced .btn {
    flex: 1;
    min-width: fit-content;
    white-space: nowrap;
}

/* Rest of your existing styles... */

/* Three column grid layout */
.three-column-grid {
    display: grid;
    grid-template-columns: 80px 1fr 1fr;
    gap: 8px;
}

.label-column {
    font-size: 0.85rem;
    color: #666;
}

.label-column .row-label {
    padding: 8px 4px;
}

.value-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.value-column select {
    font-size: 0.85rem;
    padding: 6px 8px;
}

/* What If sections */
.what-if-section {
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 15px;
}

.what-if-section:last-child {
    margin-bottom: 0;
}

.what-if-section h5 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1rem;
}

/* Division Winners and Playoff Seeds specific styles */
.what-if-section .label-column {
    display: grid;
    grid-template-rows: repeat(auto-fill, minmax(34px, auto));
}

.what-if-section .value-column {
    display: grid;
    grid-template-rows: repeat(auto-fill, minmax(34px, auto));
}

.what-if-section select {
    width: 100%;
    height: 34px;
}

/* Playoff grid */
.playoff-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    overflow: hidden;
}

.playoff-column {
    width: 100%;
    min-width: 0;
}

.playoff-column h6 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.playoff-round {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.playoff-game {
    width: 100%;
}

.matchup {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.vs {
    font-size: 0.8rem;
    color: #666;
    flex: 0 0 auto;
    padding: 0 2px;
}

/* Team button styles */
.team-button {
    padding: 4px 6px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    flex: 1;
    min-width: 0;
    max-width: 80px;
    margin: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .playoff-grid {
        gap: 8px;
    }

    .team-button {
        padding: 3px 5px;
        max-width: 70px;
        font-size: 0.8rem;
    }

    .vs {
        padding: 0 1px;
        font-size: 0.75rem;
    }
}

/* Home team prefix */
.team-button.home-team::before {
    content: '@';
    margin-right: 2px;
    opacity: 0.7;
}

/* Team button states */
.team-button:not(.winner):not([disabled]) {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
}

.team-button.winner {
    border-width: 3px;
}

.team-button:not(.winner):not([disabled]):hover {
    border-color: #6c757d !important;
}

.team-button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Content grid layout */
.content-grid {
    display: block;
}

.content-grid.what-if-active {
    display: grid;
    gap: 20px;
}

/* Keep the grid alignment simple */
.three-column-grid > * {
    min-height: 34px;
}

/* Division Winners and Playoff Seeds sections */
.what-if-section {
    margin-bottom: 20px;
}

.what-if-section h5 {
    margin-bottom: 15px;
}

.what-if-section .three-column-grid {
    margin-bottom: 4px;
}

.what-if-section .three-column-grid:last-child {
    margin-bottom: 0;
}

/* Timeline Chart Styles */
.participant-search-wrapper {
    position: relative;
}

#participantSearch {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#participantSearch:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.participant-search-wrapper::before {
    content: '\1F50D'; /* Magnifying glass emoji */
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    font-size: 14px;
}

/* Timeline Chart Container */
#timelineChart {
    cursor: crosshair;
}

/* Timeline Spinner */
#timelineSpinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Timeline Chart Responsive */
/* Timeline Control Buttons */
#showAllParticipants, #hideAllParticipants, #showTop10 {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .participant-search-wrapper {
        margin-bottom: 10px;
    }
    
    #participantSearch {
        min-width: 150px;
    }
    
    /* Stack timeline controls on mobile */
    .card-header .d-flex.align-items-center.gap-3 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    /* Make timeline chart shorter on mobile */
    #timelineChart {
        height: 400px !important;
    }
    
    /* Stack control buttons on mobile */
    #showAllParticipants, #hideAllParticipants, #showTop10 {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 576px) {
    /* Even smaller screens */
    #timelineChart {
        height: 350px !important;
    }
    
    .participant-search-wrapper {
        width: 100%;
    }
    
    #participantSearch {
        width: 100%;
        min-width: unset;
    }
}

/* Timeline Chart Responsiveness */
@media (max-width: 991.98px) {
    #timelineChart {
        max-height: 300px !important;
        min-height: 250px !important;
    }
    
    .timeline-legend-container {
        width: 100% !important;
        max-width: none !important;
        margin-top: 1rem !important;
        margin-left: 0 !important;
    }
}

/* Ensure chart container is responsive */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

@media (max-width: 991.98px) {
    .chart-container {
        height: 300px;
    }
}

/* Timeline chart specific styling */
#timelineChart {
    max-width: 100%;
    height: auto !important;
}

/* Ensure x-axis labels are readable */
.chartjs-tick-label {
    font-size: 11px !important;
    font-weight: 500 !important;
}

@media (max-width: 575.98px) {
    .chartjs-tick-label {
        font-size: 10px !important;
    }
}

/* Timeline chart container improvements */
.timeline-chart-container {
    position: relative;
    overflow: hidden;
}

/* Ensure proper spacing for chart elements */
.chartjs-chart {
    margin: 0 auto;
}

/* Improve chart responsiveness */
@media (max-width: 767.98px) {
    .timeline-chart-container {
        padding: 0 10px;
    }
}

/* Timeline chart grid improvements */
.timeline-chart-container canvas {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background-color: #ffffff;
}

/* Ensure grid lines are visible */
.chartjs-grid-line {
    stroke-width: 1px !important;
}

/* Timeline chart specific improvements */
.timeline-chart-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

@media (max-width: 767.98px) {
    .timeline-chart-container {
        padding: 15px;
        margin: 0 10px;
    }
}

/* Chart title styling */
.timeline-chart-container h3 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

/* Logo sizing fix - prevent flash of large logo */
.navbar-brand img[src*="tfp_favicon.png"] {
    height: 32px !important;
    width: 32px !important;
    max-height: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    min-width: 32px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* Additional logo constraints to prevent sizing issues */
.navbar-brand img.navbar-logo {
    height: 32px !important;
    width: 32px !important;
    max-height: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    min-width: 32px !important;
    object-fit: contain !important;
    flex-shrink: 0;
}

/* Ensure logo container maintains proper dimensions */
.navbar-brand {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0;
}