/* Matchup-specific Header Styles */
.matchup-header {
    padding: 1rem;
    min-height: 160px;
    position: relative;
}

.matchup-content {
    padding-right: 3rem;
}

/* Team Logo and Name Styles */
.matchup-card .team-logo {
    width: 128px;
    height: 128px;
    object-fit: contain;
    border-radius: 4px;
    background-color: white;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.matchup-card .team-name {
    margin: 0;
    display: inline-block;
    vertical-align: middle;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1e293b;
}

/* Desktop: Team 2 should show as Name + Logo (right-aligned) */
#livescores-container .team2-container {
    flex-direction: row-reverse;
}

#livescores-container .team2-container .team2-logo {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Score Container Styles */
.score-container {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    background-color: var(--background-primary);
    vertical-align: middle;
}

.vs-text {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 0.25rem;
}

.score-badge {
    font-size: 1.25rem;
    padding: 0.375rem 0.75rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

/* Player Stats and Roster Styles */
.prem-team-badge {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.reserve-icon {
    color: #ffc107;
    font-weight: bold;
}

.active-icon {
    color: #28a745;
}

/* ========================================
   SCORE UPDATE ANIMATIONS
   Consolidated animation definitions for score changes.
   - Table cells (td): background color flash
   - Score badges: scale bounce + color change
   ======================================== */

/* Animation keyframes */
@keyframes scoreFlashGreen {
    0%, 70% { background-color: rgba(40, 167, 69, 0.3); }
    100% { background-color: transparent; }
}

@keyframes scoreFlashRed {
    0%, 70% { background-color: rgba(220, 53, 69, 0.3); }
    100% { background-color: transparent; }
}

@keyframes badgeBounceGreen {
    0% { background-color: #28a745; transform: scale(1); }
    50% { background-color: #20c997; transform: scale(1.1); }
    100% { background-color: #007bff; transform: scale(1); }
}

@keyframes badgeBounceRed {
    0% { background-color: #dc3545; transform: scale(1); }
    50% { background-color: #fd7e14; transform: scale(1.1); }
    100% { background-color: #007bff; transform: scale(1); }
}

/* Table cell animations (player scores) */
td.score-increase {
    animation: scoreFlashGreen 2s ease-in-out forwards;
}

td.score-decrease {
    animation: scoreFlashRed 2s ease-in-out forwards;
}

/* Score badge animations (team totals) */
.score-badge.score-increase {
    animation: badgeBounceGreen 1s ease-in-out;
}

.score-badge.score-decrease {
    animation: badgeBounceRed 1s ease-in-out;
}

/* Legacy support for data attribute animation */
td[data-current-score][data-score-changed="true"] {
    background-color: rgba(40, 167, 69, 0.3);
    transition: background-color 1s;
}

/* Current week styling */
.current-week {
    border: 5px solid #f82a2a;
}

#livescores-container .current-week .card-header {
    background-color: var(--grey-500);
}

/* Horizontal Layout Specific Styles */
.gameweek-header {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

/* Center content */
.gameweek-center {
    flex: 1;
    text-align: center;
    padding: 0 0.5rem;
}

.gameweek-title {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gameweek-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}

/* Badges in row */
.badges-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 20px;
}

/* Navigation buttons */
.gameweek-nav-left, .gameweek-nav-right {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn-placeholder {
    width: 40px;
    height: 40px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-btn:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
}

.nav-btn.active {
    background-color: #3b82f6;
    color: white;
}

/* Mobile Portrait Layout - Stack vertically with smaller logos */
@media (max-width: 768px) and (orientation: portrait) {
    .matchup-header {
        padding: 0.75rem;
        min-height: auto;
    }

    .matchup-content {
        padding-right: 1rem;
    }

    /* Smaller logos for mobile portrait - consistent alignment */
    .team-logo {
        width: 48px !important;
        height: 48px !important;
        margin: 0 !important;
        margin-right: 0.5rem !important;
        flex-shrink: 0 !important;
        display: block !important;
    }

    .team-name, .team-name h3 {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        margin: 0 !important;
        line-height: 1.2;
        color: #1e293b !important;
    }

    .score-badge {
        font-size: 0.9rem;
        padding: 0.25rem 0.5rem;
    }

    .vs-text {
        font-size: 1rem;
        margin: 0 0.15rem;
    }

    .prem-team-badge {
        width: 16px;
        height: 16px;
    }

    /* Two-row layout: teams on left, scores on right */
    .card-header .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .card-header .col-12.col-md-5,
    .card-header .col-12.col-md-2 {
        width: 100%;
        text-align: left;
    }

    /* Both team rows - identical structure with consistent height for logo alignment */
    .card-header .col-12.col-md-5:first-child,
    .card-header .col-12.col-md-5:last-child {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        position: relative !important;
        min-height: 56px !important; /* Consistent row height for logo alignment */
        height: 56px !important; /* Fixed height to ensure perfect logo alignment */
    }

    .card-header .col-12.col-md-5:first-child div[style*="display: flex"],
    .card-header .col-12.col-md-5:last-child .team2-container {
        justify-content: flex-start !important;
        align-items: center !important;
        flex: 1 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 48px !important; /* Ensure consistent row height for logo alignment */
    }

    /* Team 2 specific overrides for mobile portrait */
    .card-header .col-12.col-md-5:last-child .team2-container {
        flex-direction: row !important; /* Override desktop row-reverse for mobile portrait */
    }

    .card-header .col-12.col-md-5:last-child .team2-logo {
        margin-right: 0.5rem !important;
        margin-left: 0 !important; /* Override desktop margin for mobile portrait */
    }

    /* Score container positioning */
    .score-container {
        margin: 0;
        order: 2;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* Hide the middle score column in mobile */
    .card-header .col-12.col-md-2 {
        display: none;
    }

    /* Create individual score badges for each team - absolute positioning for perfect alignment */
    .card-header .col-12.col-md-5:first-child::after,
    .card-header .col-12.col-md-5:last-child::after {
        background: #0d6efd;
        color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
        font-size: 0.9rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 2rem;
        text-align: center;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .card-header .col-12.col-md-5:first-child::after {
        content: attr(data-team1-score);
    }

    .card-header .col-12.col-md-5:last-child::after {
        content: attr(data-team2-score);
    }
    
    /* Header navigation adjustments */
    .gameweek-label {
        font-size: 1.3rem;
    }
    
    .status-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
    
    .nav-btn, .nav-btn-placeholder {
        width: 36px;
        height: 36px;
    }
    
    /* Reduce gaps between matchups on mobile portrait */
    .card {
        margin-bottom: 0.5rem !important;
    }
    
    .gameweek-header {
        margin-bottom: 1rem !important;
    }
}

/* Mobile Landscape Layout - Use original horizontal layout */
@media (max-width: 768px) and (orientation: landscape) {
    .matchup-header {
        padding: 0.5rem;
        min-height: auto;
    }

    /* Medium logos for landscape */
    .team-logo {
        width: 64px !important;
        height: 64px !important;
        margin: 0.25rem 0.5rem;
    }

    .team-name, .team-name h3 {
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        margin: 0 !important;
        color: #1e293b !important;
    }

    .score-badge {
        font-size: 1rem;
        padding: 0.3rem 0.6rem;
    }

    .vs-text {
        font-size: 1.2rem;
        margin: 0 0.25rem;
    }

    /* Restore original horizontal layout for landscape */
    .card-header .d-flex {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
    }

    .card-header .col-12.col-md-5 {
        flex: 1;
        max-width: 40%;
        display: block !important;
    }

    .card-header .col-12.col-md-2 {
        flex: 0 0 20%;
        text-align: center;
        display: block !important;
    }

    /* Reset team 1 positioning for landscape */
    .card-header .col-12.col-md-5:first-child {
        display: block;
        justify-content: unset;
    }

    .card-header .col-12.col-md-5:first-child div[style*="display: flex"] {
        justify-content: flex-start !important;
    }

    /* Reset team 2 positioning for landscape - restore desktop behavior */
    .card-header .col-12.col-md-5:last-child {
        display: block;
        justify-content: unset;
    }

    .card-header .col-12.col-md-5:last-child .team2-container {
        justify-content: flex-end !important;
        flex-direction: row-reverse !important; /* Restore desktop behavior for landscape */
    }

    .card-header .col-12.col-md-5:last-child .team2-logo {
        margin-right: 0 !important;
        margin-left: 0.5rem !important; /* Restore desktop margin for landscape */
    }

    /* Hide individual score badges in landscape */
    .card-header .col-12.col-md-5:first-child::after,
    .card-header .col-12.col-md-5:last-child::after {
        display: none;
    }

    /* Show central score container in landscape */
    .score-container {
        position: static;
        transform: none;
        background: var(--background-primary);
        border: none;
        box-shadow: none;
        margin: 0.5rem 0;
    }

    /* Compact header for landscape */
    .gameweek-header {
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .gameweek-label {
        font-size: 1.2rem;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .nav-btn, .nav-btn-placeholder {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
}

/* Tablet Portrait - Intermediate sizing */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .team-logo {
        width: 96px !important;
        height: 96px !important;
    }

    .team-name, .team-name h3 {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        color: #1e293b !important;
    }

    .score-badge {
        font-size: 1.1rem;
        padding: 0.35rem 0.65rem;
    }
}

/* Very small screens - additional constraints */
@media (max-width: 576px) {
    .team-logo {
        width: 40px !important;
        height: 40px !important;
    }
    
    .team-name, .team-name h3 {
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: #1e293b !important;
    }
    
    .score-badge {
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }
    
    .vs-text {
        font-size: 0.9rem;
        margin: 0 0.1rem;
    }
    
    .gameweek-label {
        font-size: 1.1rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .nav-btn, .nav-btn-placeholder {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .gameweek-header {
        padding: 0.5rem;
    }

    /* Ensure full roster visibility on very small screens - ONLY for expanded cards */
    .card.expanded .card-body {
        max-height: none !important;
        height: auto !important;
    }

    /* Seamless cards should maintain zero padding */
    .team-card.expanded .card-body,
    .performance-card.expanded .card-body {
        padding: 0 !important;
    }
    
    /* Reduce gaps between matchups on very small screens */
    .card {
        margin-bottom: 1rem !important;
    }
    
    .fixtures-container {
        gap: 0.5rem;
    }
}

/* Landscape mode optimizations - ensure full width usage */
@media (orientation: landscape) and (max-width: 1024px) {
    #main-content.container-fluid {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .gameweek-header {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
    }
    
    .fixtures-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Ensure cards fill available width */
    .card {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Override base template container constraints for full width */
#main-content:has(#livescores-container) {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove livescores-specific navbar overrides - let base template handle it */

/* Fallback for browsers that don't support :has() */
body:has([hx-get*="livescores"]) #main-content,
#main-content.livescores-page {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove livescores navbar fallback - let base template handle it */

/* Ensure full width on all screen sizes */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: none !important;
    }
}

/* ========================================
   ROSTER EXPANSION IMPROVEMENTS
   ======================================== */

/* Clickable Header Styles */
.clickable-header {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    user-select: none;
}

#livescores-container .clickable-header:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clickable-header:active {
    transform: translateY(0);
}


/* Smooth Accordion Animation for Card Body */
/* Default state - rosters start hidden */
.card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    padding: 0 1.25rem;
    opacity: 0;
}

/* When expanded class is added AND roster-hidden class is NOT present */
.card.expanded .card-body:not(.roster-hidden) {
    max-height: none !important; /* Remove height limit for full visibility */
    opacity: 1 !important;
    height: auto !important;
}

/* Maintain seamless look for team/performance cards when expanded */
.team-card.expanded .card-body:not(.roster-hidden),
.performance-card.expanded .card-body:not(.roster-hidden) {
    padding: 0 !important;
}

/* Support for roster-hidden class (used by hyperscript) - Higher specificity */
.card .card-body.roster-hidden {
    max-height: 0 !important;
    padding: 0 1.25rem !important;
    opacity: 0 !important;
}

/* Smooth reveal animation for roster content */
.card-body .row {
    transform: translateY(-10px);
    transition: transform 0.3s ease 0.1s;
}

.expanded .card-body .row {
    transform: translateY(0);
}

/* Card header - compact layout */
.card-header {
    position: relative;
    padding-bottom: 12px;
    min-height: auto;
}

/* Mobile responsive adjustments for expansion */
@media (max-width: 768px) {
    .card-header {
        padding-bottom: 10px;
    }
    
    /* Ensure full roster visibility on mobile - ONLY for expanded cards */
    .card.expanded .card-body {
        max-height: none !important; /* Remove height restrictions */
        height: auto !important;
    }

    /* Maintain seamless look on mobile */
    .team-card.expanded .card-body,
    .performance-card.expanded .card-body {
        padding: 0 !important;
    }
    
    .clickable-header:hover {
        transform: none; /* Disable transform on mobile for better touch experience */
    }
    
    /* Ensure roster tables are fully scrollable on mobile - ONLY for expanded cards */
    .card.expanded .card-body .table-responsive {
        max-height: none !important;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    /* Seamless cards should not have bottom padding */
    .team-card.expanded .card-body,
    .performance-card.expanded .card-body {
        padding-bottom: 0 !important;
    }
    
    /* Ensure card containers don't constrain height on mobile */
    .card {
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Make sure viewport allows full scrolling */
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }
}

/* ========================================
   CONSISTENT SPACING IMPROVEMENTS
   ======================================== */

/* Reduce spacing around title card - applies to both matchups and teams views */
#livescores-container .gameweek-header.mb-4 {
    margin-bottom: 0.5rem !important;
    margin-top: 0.25rem !important;
}

/* Target the navbar with mb-4 to reduce gap to title card */
body.livescores-page nav.navbar.navbar-expand-lg.navbar-dark.mb-4 {
    margin-bottom: 0.25rem !important;
}

/* ========================================
   TAB HEADER STYLES (Option C)
   Clean tab design with status bar below
   ======================================== */

.livescores-header {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* View Toggle Tabs */
.view-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.view-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.view-tab:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    text-decoration: none;
}

.view-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: white;
}

.view-tab i {
    font-size: 0.875rem;
}

/* Info Bar */
.info-bar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
}

/* Navigation Sections */
.nav-section {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    flex-shrink: 0;
}

/* Info Content (center) */
.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

/* Info Lines */
.info-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-primary {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.info-secondary {
    font-size: 0.85rem;
    color: #64748b;
}

/* Week Info */
.week-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.week-title-separator,
.week-type-separator,
.status-separator {
    color: #cbd5e1;
}

.week-title {
    color: #475569;
    font-weight: 500;
}

.week-type {
    color: #64748b;
    font-style: italic;
}

/* Status Items */
.status-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-item i {
    font-size: 0.75rem;
}

/* Status Dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Status Variations */
.status-live .status-dot {
    background: #22c55e;
    animation: pulse 2s infinite;
}

.status-preview .status-dot {
    background: #3b82f6;
}

.status-completed .status-dot {
    background: #6b7280;
}

.status-success {
    color: #16a34a;
}

.status-warning {
    color: #d97706;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   TAB HEADER MOBILE STYLES (Version 2)
   Two-line stacked info on mobile
   ======================================== */

@media (max-width: 768px) {
    .view-tabs {
        background: #f8fafc;
    }

    .view-tab {
        padding: 0.6rem 0.75rem;
        font-size: 0.875rem;
    }

    .view-tab .tab-text {
        display: inline; /* Show text on mobile */
    }

    .info-bar {
        padding: 0.5rem 0.75rem;
    }

    .nav-section {
        width: 36px;
    }

    .info-content {
        gap: 0.15rem;
    }

    .info-primary {
        font-size: 0.95rem;
    }

    .info-secondary {
        font-size: 0.75rem;
    }

    .week-info {
        gap: 0.35rem;
    }

    .status-item {
        gap: 0.25rem;
    }

    .status-item i {
        font-size: 0.7rem;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .view-tab {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .view-tab i {
        font-size: 0.75rem;
        margin-right: 0.25rem !important;
    }

    .info-bar {
        padding: 0.4rem 0.5rem;
    }

    .nav-section {
        width: 30px;
    }

    .info-primary {
        font-size: 0.85rem;
    }

    .info-secondary {
        font-size: 0.7rem;
        gap: 0.25rem;
    }

    .week-title-separator,
    .week-type-separator {
        display: none; /* Hide separators, rely on spacing */
    }

    .week-title {
        font-size: 0.8rem;
    }

    .status-separator {
        font-size: 0.6rem;
    }
}

/* ========================================
   LEGACY VIEW TOGGLE STYLES (deprecated)
   Keeping for backwards compatibility
   ======================================== */

.view-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.view-toggle-container .btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    overflow: hidden;
}

.view-toggle-container .btn {
    border: 1px solid #007bff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-toggle-container .btn:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

.view-toggle-container .btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.view-toggle-container .btn.active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* ========================================
   TEAMS GRID VIEW STYLES
   ======================================== */

.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    padding: 0;
}

.team-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.team-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.team-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    padding: 0.5rem 1rem;
    min-height: auto;
}

.team-card .card-header:hover {
    background-color: #e9ecef;
}

.team-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* Team logo styling for teams grid */
.team-card .team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background-color: white;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
    margin-right: 0.5rem;
}

/* Team name styling for teams grid */
.team-card .team-name {
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Score badge for teams grid */
.team-card .score-badge {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* ========================================
   SHARED ROSTER STYLES
   ======================================== */

/* Seamless roster integration with card */
.team-card .card-body,
.performance-card .card-body {
    padding: 0 !important;
    background: white;
}

.team-card .card-body .table-responsive,
.performance-card .card-body .table-responsive {
    margin: 0;
    border-radius: 0;
}

.team-card .card-body .table,
.performance-card .card-body .table {
    margin-bottom: 0;
}

/* Remove header bottom border when expanded for seamless look */
.team-card.expanded .card-header,
.performance-card.expanded .card-header {
    border-bottom: none;
}

/* Table header styling to match card */
.team-card .table thead th,
.performance-card .table thead th {
    background-color: var(--grey-100, #f8f9fa);
    border-bottom: 1px solid var(--grey-300, #dee2e6);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--grey-700, #495057);
    padding: 0.5rem;
}

/* Ensure last row has no bottom border to blend with card */
.team-card .table tbody tr:last-child td,
.performance-card .table tbody tr:last-child td {
    border-bottom: none;
}

/* Reserve order circle - used in both matchups and teams views */
.reserve-order-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Card indicators - compact style for yellow/red cards */
.card-indicator {
    display: inline-block;
    width: 8px;
    height: 12px;
    border-radius: 1px;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card-yellow {
    background: #ffc107;
}

.card-red {
    background: #dc3545;
}

/* ========================================
   TEAMS GRID MOBILE STYLES
   ======================================== */

@media (max-width: 768px) {
    /* View toggle adjustments */
    .view-toggle-container .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .view-toggle-container .btn i {
        margin-right: 0.25rem !important;
    }

    /* Teams grid - single column on mobile */
    .teams-container {
        grid-template-columns: 1fr !important;
        gap: 0.25rem !important;
    }

    .team-card .card-header {
        padding: 0.4rem 0.75rem !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .team-card .team-info {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .team-card .team-logo {
        width: 40px !important;
        height: 40px !important;
        flex-shrink: 0 !important;
        margin-right: 0.5rem !important;
        margin-bottom: 0 !important;
        display: inline-block !important;
        float: none !important;
    }

    .team-card .team-name {
        font-size: 1.1rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
        display: inline-block !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .team-card .team-score {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    .team-card .score-badge {
        font-size: 0.9rem !important;
        min-width: 45px !important;
    }

    /* Shared roster responsive styles */
    .reserve-order-circle {
        width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
        margin-left: 6px !important;
    }

    .card-indicator {
        width: 6px;
        height: 10px;
        margin-left: 3px;
    }
}

@media (max-width: 576px) {
    .team-card.card {
        margin-bottom: 0.1rem !important;
    }
}

@media (max-width: 480px) {
    .team-card.card {
        margin-bottom: 0.1rem !important;
    }

    .team-card .team-logo {
        width: 40px !important;
        height: 40px !important;
        margin-right: 0.4rem !important;
    }

    .team-card .team-name {
        font-size: 1rem !important;
    }

    .team-card .card-header {
        padding: 0.3rem 0.5rem !important;
    }

    .team-card .score-badge {
        font-size: 0.85rem !important;
        min-width: 40px !important;
    }
}

@media (min-width: 1200px) {
    .team-card .team-name {
        font-size: 1.125rem !important;
    }

    .team-card .score-badge {
        font-size: 1rem !important;
    }
}