/* Base Layout */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    flex: 1;
}

.dashboard-content {
    flex: 1;
    padding: 20px;
    overflow-x: hidden;
}

/* Page Components */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.page-description {
    font-size: 1rem;
    color: #6c757d;
}

/* Filter Containers */
.filter-container {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.filter-components {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-item {
    flex: 1;
    min-width: 200px;
}
/* Logo styling */
.navbar-brand img {
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Development badge styling */
.dev-badge {
    font-size: 0.6rem;
    background-color: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    font-weight: bold;
}

/* Favicon appears in browser tab */
/* No additional CSS needed for favicon */
/* Chart Responsiveness */
.chart-container {
    width: 100%;
    min-height: 300px;
}

/* Dropdown menu styling improvements */
.dropdown-menu {
    border-radius: var(--radius-sm, 4px);
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
    border: 1px solid var(--border-color, #dee2e6);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 14px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(25, 118, 210, 0.08);
    color: var(--primary-color, #1976D2);
}

/* Active dropdown item */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-color, #1976D2);
    color: white;
}

/* Update just the mobile navigation part of your responsive.css */
@media (max-width: 991px) {

    /* Mobile Navigation */
    .navbar-collapse {
        position: fixed;
        /* Changed from absolute to fixed */
        top: 56px;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        /* Auto height based on content */
        background-color: var(--primary-color, #1976D2);
        z-index: 1050;
        padding: 0.5rem 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        /* Changed the transform approach */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        display: block !important;
    }

    .navbar-collapse.show {
        opacity: 1;
        visibility: visible;
    }

    /* Adjust nav items for mobile */
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        margin-bottom: 1rem;
        /* Add some space at the bottom */
    }

    .nav-item,
    .dropdown {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Improve dropdown handling */
    .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.1);
        border: none;
        box-shadow: none;
        margin-top: 0;
        margin-bottom: 0.5rem;
        display: none;
        /* Hide by default */
    }

    .dropdown-menu.show {
        display: block;
    }

    .dropdown-item {
        color: white !important;
        padding: 0.5rem 1rem;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.1);
    }

    /* Improve readability for nav links */
    .nav-link {
        color: white !important;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Add animation to the toggler button */
    .navbar-toggler {
        transition: transform 0.2s ease;
    }

    .navbar-toggler[aria-expanded="true"] {
        transform: rotate(90deg);
    }
}

/* MLB Roster Table Mobile Responsiveness */
@media (max-width: 768px) {
    /* Hide the standard roster table header on mobile */
    .batter-lineup-header {
        display: none !important;
    }
    
    /* Convert roster rows to card-like layout on mobile */
    .batter-lineup-row {
        display: block !important;
        padding: 12px !important;
        margin-bottom: 10px;
        border: 1px solid var(--border-color, #dee2e6);
        border-radius: 8px;
        background-color: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    /* Reset column widths for mobile */
    .batter-lineup-row .col-1,
    .batter-lineup-row .col-2 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 4px 0 !important;
    }
    
    /* Style each stat row on mobile */
    .batter-lineup-row > div {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 6px 0 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .batter-lineup-row > div:last-child {
        border-bottom: none;
    }
    
    /* Add labels before each value on mobile */
    .batter-lineup-row > div:nth-child(1)::before { content: "Order: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(2)::before { content: "Player: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(3)::before { content: "At Bats: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(4)::before { content: "Average: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(5)::before { content: "Exit Velocity: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(6)::before { content: "Barrel %: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(7)::before { content: "Barrels: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(8)::before { content: "wOBA: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(9)::before { content: "Stolen Bases: "; font-weight: 600; color: #6c757d; }
    .batter-lineup-row > div:nth-child(10)::before { content: "Home Runs: "; font-weight: 600; color: #6c757d; }
    
    /* Special handling for player name and order - make them more prominent */
    .batter-lineup-row > div:nth-child(1) {
        font-size: 1.1rem;
        font-weight: bold;
        color: var(--primary-color, #1976D2);
        border-bottom: 2px solid var(--primary-color, #1976D2);
        margin-bottom: 8px;
        padding-bottom: 8px !important;
    }
    
    .batter-lineup-row > div:nth-child(2) {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    /* Center align the expand button */
    .batter-lineup-row > div:last-child {
        justify-content: center !important;
        padding-top: 10px !important;
    }
    
    /* Ensure text doesn't overflow on small screens */
    .batter-lineup-row span {
        text-align: right !important;
        word-break: break-word;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 576px) {
    .batter-lineup-row {
        font-size: 0.9rem;
        padding: 10px !important;
    }
    
    /* Adjust label font size for very small screens */
    .batter-lineup-row > div::before {
        font-size: 0.85rem;
    }
}

/* Handle projected lineup vs starting lineup title on mobile */
@media (max-width: 768px) {
    /* Make the title more prominent on mobile */
    h6.mb-0 {
        font-size: 1.1rem !important;
        margin-bottom: 10px !important;
    }
    
    /* Stack the stance filter below title on mobile */
    .mt-3.mb-2 .row {
        flex-direction: column !important;
    }
    
    .mt-3.mb-2 .col-auto:first-child {
        margin-bottom: 10px;
    }
    
    /* Center the stance filter buttons */
    .btn-group.btn-group-sm {
        justify-content: center;
        width: 100%;
    }
}

/* MLB First Pitch Table Mobile Responsiveness */
@media (max-width: 768px) {
    /* Target the opportunities display table specifically */
    #mlb_daily_fp_opportunities_display_table {
        font-size: 0.75rem !important;
    }
    
    /* Hide certain columns on mobile to save space */
    #mlb_daily_fp_opportunities_display_table .dash-header[data-dash-column="rejection_reason"],
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="rejection_reason"] {
        display: none !important;
    }
    
    /* Make the table cells more compact on mobile */
    #mlb_daily_fp_opportunities_display_table .dash-cell {
        padding: 3px !important;
        font-size: 0.7rem !important;
        min-width: auto !important;
        max-width: none !important;
    }
    
    /* Specific column width adjustments for mobile */
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="selection_checkbox"] {
        max-width: 60px !important;
        font-size: 0.65rem !important;
    }
    
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="game_display"] {
        max-width: 90px !important;
        white-space: normal !important;
        line-height: 1.2;
    }
    
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="batter_name"],
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="pitcher_name"] {
        max-width: 85px !important;
        white-space: normal !important;
        overflow-wrap: break-word;
    }
    
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="total_ev"],
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="max_edge_display"],
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="total_confidence"] {
        max-width: 45px !important;
    }
    
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="bet_status_display"] {
        max-width: 50px !important;
        font-size: 0.65rem !important;
    }
    
    /* Make the confidence color key responsive */
    .confidence-badge {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
        margin: 1px !important;
    }
    
    /* Adjust table header for mobile */
    #mlb_daily_fp_opportunities_display_table .dash-header {
        font-size: 0.65rem !important;
        padding: 3px !important;
        white-space: normal !important;
        line-height: 1.2;
    }
    
    /* Make pagination controls more touch-friendly */
    #mlb_daily_fp_opportunities_display_table .previous-next-container {
        margin: 10px 0;
    }
    
    #mlb_daily_fp_opportunities_display_table .page-number {
        padding: 8px !important;
        font-size: 0.85rem !important;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 576px) {
    /* Further reduce font sizes for very small screens */
    #mlb_daily_fp_opportunities_display_table {
        font-size: 0.7rem !important;
    }
    
    /* Hide more columns on very small screens */
    #mlb_daily_fp_opportunities_display_table .dash-header[data-dash-column="samples"],
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="samples"] {
        display: none !important;
    }
    
    /* Make critical columns even more compact */
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="game_display"] {
        max-width: 70px !important;
        font-size: 0.65rem !important;
    }
    
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="batter_name"],
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="pitcher_name"] {
        max-width: 70px !important;
        font-size: 0.65rem !important;
    }
    
    /* Simplify the checkbox text on very small screens */
    #mlb_daily_fp_opportunities_display_table td[data-dash-column="selection_checkbox"] {
        font-size: 0.6rem !important;
    }
    
    /* Hide the confidence scale legend on very small screens to save space */
    @media (max-width: 480px) {
        .confidence-badge:nth-child(n+4) {
            display: none !important;
        }
        .confidence-badge {
            font-size: 0.55rem !important;
        }
    }
}

/* Alternative Card-Based Layout for Mobile (if preferred) */
@media (max-width: 768px) {
    /* Add a class to enable card view if desired */
    .mlb-firstpitch-card-view #mlb_daily_fp_opportunities_display_table {
        display: none !important;
    }
    
    /* Card layout styles would go here if implemented */
    /* This is commented out by default - can be enabled if card view is preferred
    .mlb-firstpitch-card-container {
        display: block;
    }
    
    .mlb-firstpitch-card {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 10px;
        background-color: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    */
}

/* MLB Roster Card Mobile Responsiveness - Weather and Danger Batters */
@media (max-width: 768px) {
    /* Stack weather and danger batter sections vertically on mobile */
    .roster-weather-danger-row {
        flex-direction: column !important;
    }
    
    .roster-weather-danger-row > .col-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Weather section styling for mobile */
    .venue-conditions-mobile {
        width: 100% !important;
        margin-left: 0 !important;
        margin-bottom: 1rem;
    }
    
    /* Hide duplicate weather sections on mobile */
    .venue-conditions-mobile:nth-of-type(2) {
        display: none !important;
    }
    
    /* Danger batters section styling for mobile */
    .danger-batters-mobile {
        width: 100% !important;
        margin-top: 0 !important;
    }
    
    /* Optimize badge layout for mobile */
    .venue-conditions-mobile .badge,
    .danger-batters-mobile .badge {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.4rem !important;
    }
    
    /* Make park factors more compact on mobile */
    .venue-conditions-mobile h6 {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .venue-conditions-mobile h5 {
        font-size: 1rem !important;
    }
    
    /* Ensure proper spacing between sections */
    .venue-conditions-mobile + .danger-batters-mobile {
        margin-top: 1rem !important;
    }
    
    /* Optimize danger batters list for mobile */
    .danger-batters-mobile .list-group-item {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
    }
    
    .danger-batters-mobile .list-group-item strong {
        font-size: 0.9rem !important;
    }
    
    /* Stack badges vertically in danger batters for very narrow screens */
    @media (max-width: 480px) {
        .danger-batters-mobile .list-group-item {
            flex-direction: column !important;
            align-items: flex-start !important;
        }
        
        .danger-batters-mobile .list-group-item > div {
            margin-top: 0.25rem;
            width: 100%;
        }
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 576px) {
    /* Further optimize for very small screens */
    .venue-conditions-mobile .badge,
    .danger-batters-mobile .badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.35rem !important;
        margin-right: 0.25rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* Make text even smaller on very small devices */
    .venue-conditions-mobile small,
    .danger-batters-mobile small {
        font-size: 0.7rem !important;
    }
    
    /* Reduce padding on cards for small screens */
    .venue-conditions-mobile.p-2,
    .danger-batters-mobile.p-3 {
        padding: 0.75rem !important;
    }
}