/* --- Root variables and body styles are unchanged --- */
:root {
    --primary-color: #0d47a1; /* NFL Blue */
    --secondary-color: #d50a0a; /* NFL Red */
    --accent-color: #ffc107;
    --background-color: #f4f6f8;
    --text-color: #333;
    --card-background: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- General utility classes are unchanged --- */
.hidden { display: none !important; }
.container { max-width: 960px; margin: 0 auto; padding: 20px; }
h1, h2 { color: var(--primary-color); }

/* --- Header & Navigation (UPDATED) --- */
header { background-color: var(--primary-color); color: white; padding: 0.5rem 0; box-shadow: var(--box-shadow); position: relative;}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
#logo { font-weight: bold; font-size: 1.5rem !important; }
#main-nav { 
    display: flex; /* This makes it visible on desktop */
    flex-grow: 1; /* Allows it to take up space */
    padding-left: 20px; /* Adds space between logo and nav links */
} 
#main-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 10px; }
#main-nav .nav-link, .nav-left .nav-link { color: white; text-decoration: none; font-weight: 500; padding: 5px 10px; border-radius: 5px; transition: background-color 0.3s; }
#main-nav .nav-link:hover, .nav-left .nav-link:hover { background-color: var(--secondary-color); }
#user-status { display: flex; align-items: center; gap: 15px; }
#user-status a, #user-status button { color: white; text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 5px; transition: background-color 0.3s; background: none; border: 1px solid transparent; cursor: pointer; font-size: 0.9rem; white-space: nowrap; }
#user-status a:hover, #user-status button:hover { background-color: var(--secondary-color); }
#user-status button { border-color: white; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 5px; }
.hamburger-line { width: 25px; height: 3px; background-color: white; border-radius: 3px; transition: transform 0.3s; }

/* --- Main content and Card styles are unchanged --- */
main { padding-top: 20px; position: relative; z-index: 5; transition: transform 0.3s ease-in-out;}
.page { display: none; }
.page.active { display: block; }
.card { background-color: var(--card-background); border-radius: var(--border-radius); box-shadow: var(--box-shadow); padding: 20px; margin-bottom: 20px; }

/* --- Auth form styles are unchanged --- */
.auth-form-container { display: flex; justify-content: space-around; gap: 40px; }
.auth-form { flex: 1; display: flex; flex-direction: column; }
.auth-form h2 { text-align: center; margin-top: 0; }
.auth-form input { padding: 12px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 5px; font-size: 1rem; }
.auth-form button { padding: 12px; background-color: var(--primary-color); color: white; border: none; border-radius: 5px; font-size: 1.1rem; cursor: pointer; transition: background-color 0.3s; }
.auth-form button:hover { background-color: var(--secondary-color); }

/* --- Home Page / Dashboard Styles are unchanged --- */
.pick-history-table { width: 100%; border-collapse: collapse; }
.pick-history-table th, .pick-history-table td { padding: 12px; text-align: center; border-bottom: 1px solid #ddd; }
.pick-history-table th { background-color: #f2f2f2; }
.pick-history-table .correct { color: green; font-weight: bold; }
.pick-history-table .incorrect { color: red; font-weight: bold; }

.pick-history-table .team-logo-display {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    justify-content: center; /* Center logos in the cell */
    gap: 5px;
}

.pick-history-table .table-logo {
    width: 24px;
    height: 24px;
}

/* --- Picks Page Styles --- */
.game-card { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto auto; gap: 10px 15px; align-items: center; margin-bottom: 20px; padding: 15px; border: 1px solid #e0e0e0; border-radius: var(--border-radius); background-color: var(--card-background); box-shadow: var(--box-shadow); position: relative; }
.team { display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 10px; border-radius: var(--border-radius); transition: all 0.2s; border: 2px solid transparent; grid-row: 1; }
.team:hover { transform: translateY(-3px); }
.team.selected { background-color: #e3f2fd; border-color: var(--primary-color); }
.team img { width: 60px; height: 60px; margin-bottom: 10px; }
.team-name { font-weight: 600; text-align: center; }
.game-separator { font-weight: bold; color: var(--secondary-color); grid-row: 1; grid-column: 2; }
.game-info { grid-column: 1 / -1; text-align: center; font-size: 0.9rem; color: #666; padding-top: 10px; border-top: 1px solid #eee; margin-top: 10px; grid-row: 2; }
.wager-controls { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 10px; flex-wrap: wrap; grid-row: 3; }
.wager-options { display: flex; align-items: center; gap: 5px; }
.wager-options span { font-weight: 500; margin-right: 5px; }
.wager-btn { background-color: #f0f0f0; border: 1px solid #ccc; padding: 8px 12px; border-radius: 20px; cursor: pointer; transition: all 0.2s; }
.wager-btn:hover { background-color: #ddd; }
.wager-btn.selected { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.double-up-btn { background-color: #e0e0e0; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer; transition: background-color 0.3s; font-weight: bold; }
.double-up-btn:hover { background-color: #d5d5d5; }
.double-up-btn.selected { background-color: var(--accent-color); color: var(--text-color); }
.save-picks-btn { display: block; width: 100%; padding: 15px; background-color: var(--primary-color); color: white; border: none; border-radius: var(--border-radius); font-size: 1.2rem; cursor: pointer; transition: background-color 0.3s; margin-top: 20px; }
.save-picks-btn:hover { background-color: var(--secondary-color); }
.game-card.locked { filter: grayscale(1); opacity: 0.6; pointer-events: none; }
.game-card.locked .team:hover { transform: none; }
.odds-info {
    font-weight: 600;
    color: var(--secondary-color);
    margin-left: 5px; /* Adds a little space after the separator */
}

/* --- Matches & Scoreboard Styles (Unchanged) --- */
#matches-list-container .match-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee; }
#matches-list-container .match-item:last-child { border-bottom: none; }
.match-item span { font-weight: 600; font-size: 1.1rem; }
.button-primary { padding: 8px 16px; background-color: var(--primary-color); color: white; border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; transition: background-color 0.3s; }
.button-primary:hover { background-color: var(--secondary-color); }
#scoreboard-picks-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.scoreboard-user-picks { border: 1px solid #e0e0e0; border-radius: var(--border-radius); padding: 15px; }
.scoreboard-user-picks h3 { margin-top: 0; border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; }
.scoreboard-user-picks ul { list-style: none; padding: 0; margin: 0; }
.scoreboard-user-picks li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.scoreboard-user-picks li span:first-child { font-weight: 500; }
.scoreboard-user-picks li .wager-indicator { font-weight: bold; color: var(--primary-color); }

/* =================================================================
   *** UPDATED: RESPONSIVE STYLES (for Mobile) ***
   ================================================================= */
@media (max-width: 768px) {
    .container { padding: 10px; }
    h1 { font-size: 1.5rem; }

    /* --- UPDATED Header & Navigation --- */
    .nav-container {
        flex-wrap: wrap; /* Allow items to wrap if needed */
    }
    .nav-left { flex-direction: column; align-items: flex-start; gap: 5px; }
    #logo { padding: 0; }
    #user-status {
        order: 3; /* Change flex order */
    }
    .hamburger {
        display: flex; /* Show hamburger on mobile */
        order: 2; /* Change flex order */
    }

    
   #main-nav {
        display: none; /* Hide nav by default on mobile */
        order: 4; /* Ensure it appears last in the flex order */
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        right: 0; /* Make it full width */
        width: 100%;
        background-color: var(--primary-color);
        box-shadow: var(--box-shadow);
        z-index: 1000; /* Ensure it's on top */
    }
    #main-nav.nav-open { display: block; } /* Show when toggled */
    #main-nav ul { flex-direction: column; width: 100%; }
    #main-nav li { width: 100%; text-align: left; }
    #main-nav .nav-link { display: block; padding: 15px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
    #main-nav .nav-link:hover { background-color: var(--secondary-color); }

    /* Other Mobile Adjustments */
    .auth-form-container { flex-direction: column; }
    .team img { width: 45px; height: 45px; }
    .team-name { font-size: 0.9rem; }
    .wager-controls { flex-direction: column; gap: 15px; }
    .pick-history-table { font-size: 0.9rem; }
    .pick-history-table th, .pick-history-table td { padding: 8px 5px; }
    .pick-history-table .team-name-text {
        display: none; /* Hide text on mobile */
    }

    .pick-history-table .team-logo-display {
        display: flex; /* Show logos on mobile */
    }
}
/* Scoreboard Chart Styles */
.chart-container {
    position: relative;
    height: 300px; /* Adjust height as needed */
    width: 100%;
}

/* Run Sheet Table Styles */
.run-sheet-container {
    width: 100%;
    overflow-x: auto; /* Allows horizontal scrolling on small screens */
}

.run-sheet-table {
    --run-sheet-logo-size: 24px;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Helps with column width */
}

.run-sheet-table th,
.run-sheet-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    position: relative; /* Needed for the emoji overlay */
    font-size: 0.8rem;
    word-wrap: break-word;
}

.run-sheet-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    /* Allows player names to rotate if needed, but not required */
    /* white-space: nowrap; */
}

.run-sheet-table .pick-cell {
    font-weight: bold;
    /* The display:flex and other flex properties are now GONE from here */
}

/* 2. The NEW wrapper div now handles all the alignment. */
.pick-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
}

.pick-logo {
    width: var(--run-sheet-logo-size);  /* Use the variable */
    height: var(--run-sheet-logo-size); /* Use the variable */
}

/* Wager Background Color Classes */
.wager-1 { background-color: #f5f5f5; } /* very light grey */
.wager-2 { background-color: #e0e0e0; } /* light grey */
.wager-3 { background-color: #9e9e9e; } /* medium grey */
.wager-4 { background-color: #616161; color: white; } /* dark grey, white text */
.wager-5 { background-color: #212121; color: white; } /* very dark grey, white text */


/* Locked Pick Style */
.locked-pick {
    background-color: #f0f0f0;
    color: #aaa;
}
.locked-pick i {
    font-style: normal;
}

@media (max-width: 768px) {
    .run-sheet-table th,
    .run-sheet-table td {
        font-size: 0.7rem;
        padding: 6px 4px;
    }
    .run-sheet-table .game-matchup-cell {
        width: 120px;
    }
    #global-selector-container {
        order: 4; /* Place it in the flow on mobile */
        width: 100%;
        margin-top: 10px;
        margin-right: 0;
    }
    #global-match-selector {
        width: 100%;
    }
}
/* Updated Run Sheet Cell for Matchups */
.run-sheet-table .game-matchup-cell {
    text-align: left;
    font-weight: 500;
    background-color: #f9f9f9;
    width: 220px; /* Increased width to fit logos and scores */
    padding: 5px;
    vertical-align: middle;
}

/* Updated Run Sheet Table Styles */
.run-sheet-table .game-matchup-cell {
    text-align: left;
    font-weight: 500;
    background-color: #f9f9f9;
    width: 150px; /* Adjusted width */
    padding: 5px 8px;
    vertical-align: middle;
}

.run-sheet-table .status-cell {
    font-size: 0.8rem;
    color: #555;
    background-color: #f9f9f9;
    width: 80px;
    vertical-align: middle;
}

/* Flex container for each team's info (logo, name, score) */
.matchup-team-container {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.team-logo {
    width: var(--run-sheet-logo-size);  /* Use the variable */
    height: var(--run-sheet-logo-size); /* Use the variable */
    margin-right: 8px;
}

.team-info-wrapper {
    display: flex;
    align-items: baseline; /* Aligns code and score nicely */
    gap: 6px;
}

.team-code {
    font-weight: bold;
    font-size: 0.9rem;
}

.team-score {
    font-size: 0.85rem;
    color: #333;
}
.button-secondary {
    padding: 8px 16px;
    background-color: #e0e0e0; /* A light grey */
    color: #757575; /* A darker grey for text */
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: not-allowed; /* Show a "not allowed" cursor on hover */
}
.page-controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    gap: 15px;
    margin-bottom: 20px;
}

.selectors-container {
    display: flex;
    gap: 10px;
}

#global-selector-container {
    margin-right: 15px;
}

#global-match-selector {
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #fff;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

#global-match-selector:focus {
    outline: 2px solid var(--accent-color);
}
#week-selector {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    background-color: white;
    font-size: 1rem;
}

.run-sheet-table tbody td {
    padding-top: 10px;
    padding-bottom: 10px;
    vertical-align: middle; /* Ensures content aligns nicely in all cells */
}

.favored-team .team-logo {
    box-shadow: 0 0 8px 1px var(--secondary-color); /* Creates a yellow glow */
    border-radius: 20%; /* Makes the glow circular */
}
.picks-reminder-banner {
    background-color: var(--secondary-color); /* NFL Red */
    color: white;
    padding: 0px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease-in-out;
}

.reminder-link-button {
    color: white;
    text-decoration: none; /* Remove the underline */
    font-weight: 600;
    font-size: 1rem;
    display: block; /* Makes the entire area of the link clickable */
    padding: 0px 0px;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
}

/* Add a hover effect for better user feedback */
.reminder-link-button:hover {
    background-color: rgba(0, 0, 0, 0.15); /* Slightly darken the red background */
}

/* We still need the main banner style */
.picks-reminder-banner {
    background-color: var(--secondary-color); /* NFL Red */
    color: white;
    padding: 0px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease-in-out;
    border-bottom-left-radius: 15px; /* Adjust the value as needed */
    border-bottom-right-radius: 15px;
}

.run-sheet-description {
    margin-top: 0; /* Remove the default top margin */
    margin-bottom: 1rem; /* Add a controlled amount of space below */
    font-size: 0.9rem;
    color: #666;
    background-color: #fdf8e1; /* Optional: A light yellow background to make it stand out */
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid var(--accent-color);
}

.run-sheet-table thead th:first-child,
.run-sheet-table tbody td:first-child {
    position: -webkit-sticky; /* For Safari compatibility */
    position: sticky;
    left: 0; /* Stick to the left edge */
    z-index: 1; /* Ensure it stays on top of other cells when scrolling */
}

/* We need to re-apply the background color to the sticky data cell
   so the scrolling content doesn't show through it. */
.run-sheet-table tbody td:first-child {
    background-color: #f9f9f9;
}
