

/* Optional: Import Google Fonts if you uncommented it in HTML */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Roboto:wght@400;700&display=swap');


body {
    /* Use Roboto if imported, otherwise Arial */
    font-family: 'Roboto', Arial, sans-serif; 
    background-color: #407060; /* Darker Green background */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    color: #333; /* Default text color */
}

/* --- Logos --- */
.page-logo-left {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 150px; /* As per last request, adjust as needed */
    height: auto;
    z-index: 10;
}

.page-logo-right {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px; /* As per last request, adjust as needed */
    height: auto;
    z-index: 10;
}


.scoreboard-container {
    background-color: #ffffff;
    border: 5px solid #FFDF00; /* Yellow border */
    border-radius: 12px; /* Slightly more rounded corners */
    box-shadow: 0 10px 20px rgba(0,0,0,0.3); /* More prominent shadow */
    width: 100%;
    max-width: 850px; /* Slightly wider max-width for better display */
    overflow: hidden; 
    margin-top: 20px;
}

/* --- Leaderboard Banner Image --- */
.leaderboard-banner {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 2px solid #ddd; /* Subtle line below banner */
}


.scoreboard-title {
    background-color: #2c5234; /* Dark green */
    color: #ffffff;
    padding: 18px 25px; /* Slightly more padding */
    margin: 0;
    font-size: 2em; /* Slightly larger title */
    text-align: center;
    font-weight: 700; /* Bolder */
    letter-spacing: 3px; /* More prominent letter spacing */
    text-transform: uppercase;
}

.scoreboard-controls {
    text-align: center;
    padding: 15px 0; /* More padding */
    background-color: #f0f0f0; /* Slightly darker background for controls */
    border-bottom: 1px solid #ddd; /* More visible separator */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px; /* More space */
}

#refreshScoresButton {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 12px 25px; /* Larger button */
    border: none;
    border-radius: 8px; /* More rounded button */
    cursor: pointer;
    font-size: 1.05em; /* Slightly larger text */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#refreshScoresButton:hover {
    background-color: #45a049;
    transform: translateY(-2px); /* Subtle lift effect */
}

#refreshScoresButton:active {
    background-color: #3e8e41;
    transform: translateY(0);
}

#lastUpdated {
    font-size: 0.95em; /* Slightly larger */
    color: #555; /* Darker grey */
    margin: 0;
}

/* --- Navigation Buttons --- */
.view-selector {
    display: flex;
    justify-content: center;
    background-color: #2c5234; /* Dark green, same as title background */
    padding: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
    border-bottom: 2px solid #FFDF00; /* Yellow border below selector */
}

.nav-button {
    background-color: transparent; /* No background by default */
    color: #ffffff;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-grow: 1; /* Make buttons take equal space */
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2); /* Separator between buttons */
}

.nav-button:last-child {
    border-right: none; /* No separator on the last button */
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle hover effect */
}

.nav-button.active {
    background-color: #FFDF00; /* Yellow background for active button */
    color: #2c5234; /* Dark green text for active button */
    pointer-events: none; /* Disable clicks on active button */
}

/* --- Content Views (Leaderboard & Schedule) --- */
.content-view {
    padding: 20px; /* Padding inside each content view */
    background-color: #ffffff;
}

.content-view.hidden {
    display: none;
}

/* --- Main Scoreboard Table --- */
#leaderboard {
    overflow-x: auto; /* THIS IS THE KEY FOR HORIZONTAL SCROLLING ON MOBILE */
    -webkit-overflow-scrolling: touch; /* Improves scrolling on iOS */
    border-radius: 0 0 8px 8px; /* Match scoreboard-container's border-radius */
    padding-bottom: 10px; /* Add some padding at the bottom for scrollbar */
}

.leaderboard-table {
    width: 100%; /* Important for horizontal scrolling */
    min-width: 500px; /* Ensure table is wide enough to trigger scroll on small screens */
    border-collapse: collapse;
    font-size: 1.05em; /* Slightly larger font */
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 14px 18px; /* More padding for better readability */
    text-align: center;
    border-bottom: 1px solid #eee; /* Light line between rows */
}

.leaderboard-table th {
    background-color: #e8e8e8; /* Lighter grey for header background */
    font-weight: 700; /* Bolder */
    color: #444; /* Darker text */
    text-transform: uppercase;
    font-size: 0.95em;
    padding: 16px 18px; /* More padding for headers */
    border-bottom: 2px solid #ccc; /* More distinct line below headers */
}

/* Specific column styling for alignment/width */
.leaderboard-table th.team-header {
    text-align: left;
    width: 30%;
    min-width: 150px; /* Ensure team names have enough space */
    font-weight: bold; /* Make team names bold */
    color: #222; /* Darker team name color */
}
.leaderboard-table td.team-name {
    text-align: left;
    width: 30%;
    min-width: 150px; /* Ensure team names have enough space */
    font-weight: bold; /* Make team names bold */
    color: #222; /* Darker team name color */
}

.leaderboard-table th.round-header,
.leaderboard-table td.score {
    width: 15%;
    min-width: 70px; /* Minimum width for score columns */
}

.leaderboard-table th.total-header,
.leaderboard-table td.total-score {
    width: 20%;
    font-weight: 700; /* Very bold for total */
    color: #007700; /* A distinct green for totals */
    min-width: 90px; /* Minimum width for total column */
}

/* Remove bottom border from last row */
.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* Zebra striping for readability */
.leaderboard-table tbody tr:nth-child(odd) {
    background-color: #fcfcfc; /* Lighter stripe */
    border: 2px solid #00000021;
}
.leaderboard-table tbody tr:nth-child(even) {
    background-color: #f5f5f5; /* Slightly darker stripe */
        border: 2px solid #00000021;

}


/* Hover effect */
.leaderboard-table tbody tr:hover {
    background-color: #e0f2f7; /* Soft blue on hover */
    cursor: pointer; /* Indicate clickable/hoverable */
}

/* --- Schedule View Specific Styles (New Structure: Daily Blocks) --- */
.schedule-intro {
    text-align: center;
    padding: 15px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.schedule-intro h2 {
    margin-top: 0;
    color: #2c5234;
    font-size: 1.6em;
    letter-spacing: 1px;
}

.schedule-intro p {
    color: #555;
    font-size: 0.95em;
}

#schedule-table-container {
    display: flex; /* Use flexbox to arrange daily blocks */
    flex-wrap: wrap; /* Allow blocks to wrap to the next line */
    justify-content: center; /* Center blocks horizontally */
    gap: 25px; /* Space between daily blocks */
    padding: 20px; /* Padding around the blocks */
    background-color: #ffffff; /* Match container background */
}

.schedule-day-block {
    background-color: #fcfcfc; /* Light background for each day block */
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px;
    width: 100%; /* Full width on small screens */
    max-width: 350px; /* Max width for larger screens (e.g., 2 per row) */
    box-sizing: border-box; /* Include padding in width */
}

.schedule-day-title {
    background-color: #4CAF50; /* Green header for day block */
    color: white;
    padding: 10px 15px;
    margin: -15px -15px 15px -15px; /* Negative margin to extend to block edges */
    border-radius: 8px 8px 0 0; /* Rounded top corners */
    font-size: 1.3em;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
}

/* NEW/UPDATED: Styles for the tee time header within each block */
.tee-time-header {
    font-size: 1.4em; /* Made bigger */
    font-weight: 700; /* Bolder */
    color: #007700; /* Darker green to stand out */
    text-align: center; /* Center justify the time */
    margin-top: 20px; /* More space above */
    margin-bottom: 10px; /* More space below */
    padding-bottom: 5px; /* Small padding at bottom */
    border-bottom: 1px solid #e0e0e0; /* Subtle line below time */
}

.tee-time-list {
    list-style: none; /* Remove bullet points */
    padding: 0;
    margin: 0;
}

.tee-time-list li {
    display: flex; /* Flexbox for time and players */
    justify-content: space-between; /* Space out time and players */
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee; /* Dashed line separator */
}

.tee-time-list li:last-child {
    border-bottom: none; /* No border on last item */
}

.tee-time {
    font-weight: bold;
    color: #2c5234; /* Dark green for tee times */
    flex-shrink: 0; /* Prevent shrinking */
    margin-right: 10px; /* Space between time and players */
}

.players {
    text-align: right;
    color: #555;
    flex-grow: 1; /* Allow players to take up remaining space */
}

/* NEW/UPDATED: Styles for the list of players under each tee time */
.players-list {
    list-style: none; /* Remove bullet points */
    padding: 0;
    margin: 0;
    margin-bottom: 15px; /* Space after each group of players */
}

.players-list li {
    padding: 4px 0; /* Slightly more padding */
    text-align: center; /* Left justify players */
    color: #333; /* Darker color for readability */
    font-size: 0.95em; /* Slightly larger font */
    line-height: 1.4; /* Better line spacing */
    border-bottom: 1px dotted #f0f0f0; /* Very subtle dotted line between players */
    font-weight: bold;
}

.players-list li:last-child {
    border-bottom: none; /* No border on the last player in a list */
}

/* --- NEW: Sponsor Carousel Styles --- */
.sponsor-carousel {
    position: relative; /* For absolute positioning of images inside */
    width: 100%; /* Take full width of scoreboard container */
    height: 400px; /* Increased height for the carousel, adjust as needed */
    overflow: hidden; /* Hide images outside the current view */
    display: flex; /* Use flexbox to center images */
    justify-content: center;
    align-items: center;
}

.sponsor-image {
    position: absolute; /* Stack images on top of each other */
    max-width: 95%; /* Ensure image fits within carousel width (increased slightly) */
    max-height: 95%; /* Ensure image fits within carousel height (increased slightly) */
    object-fit: contain; /* Scale image to fit, maintaining aspect ratio */
    opacity: 0; /* Hidden by default */
    transition: opacity 1s ease-in-out; /* Fade transition */
}

.sponsor-image.active {
    opacity: 1; /* Visible when active */
}

/* --- NEW: Footer Styles --- */
.page-footer {
    width: 100%;
    max-width: 850px; /* Match scoreboard container max-width */
    text-align: center;
    padding: 30px 20px; /* Generous padding */
    margin-top: 40px; /* Space above the footer */
    background-color: #dbdbdb; /* Dark green background for footer */
    color: #ffffff;
    border-radius: 12px; /* Match scoreboard container border-radius */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Subtle shadow */
    box-sizing: border-box;
}

.sponsor-text {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px; /* Space between text and image */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2c5234; /* Yellow color for "Sponsored By:" */
}

.sponsor-image {
    max-width: 80%; /* Ensure image scales down on smaller screens */
    height: auto;
    display: block; /* Remove extra space below image */
    margin: 0 auto; /* Center the image */

}

/* --- NEW: Rules View Specific Styles (Clubhouse Look) --- */
.rules-intro {
    text-align: center;
    padding: 15px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.rules-intro h2 {
    margin-top: 0;
    color: #2c5234;
    font-size: 1.6em;
    letter-spacing: 1px;
}

.rules-intro p {
    color: #555;
    font-size: 0.95em;
}

#rules-content-container {
    padding: 20px;
    background-color: #ffffff;
    /* Optional: Add a subtle background image for a clubhouse feel */
    /* background-image: url('path/to/subtle-texture.png'); */
    /* background-repeat: repeat; */
}

.round-rules-block {
    background-color: #fcfcfc; /* Light background for rules block */
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px; /* Space between multiple rule blocks if added later */
}

.round-rules-title {
    font-family: 'Playfair Display', serif; /* Fancy font for the title */
    font-size: 2.2em; /* Larger, more prominent */
    color: #2c5234; /* Dark green */
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); /* Subtle shadow */
}

.rules-body {
    font-size: 1.05em;
    line-height: 1.6;
    color: #444;
}

.rules-body p {
    margin-bottom: 1em;
}

.rules-body ul {
    list-style: disc inside; /* Bullet points */
    margin-left: 20px;
    margin-bottom: 1em;
}

.rules-body li {
    margin-bottom: 0.5em;
}



/* Responsive adjustments */
@media (max-width: 600px) {
    .page-logo-left { /* Renamed from .page-logo */
        width: 70px; /* Adjust size for small screens */
        top: 10px;
        left: 10px;
    }

    .page-logo-right { /* NEW for small screens */
        width: 50px; /* Adjust size for small screens */
        top: 10px;
        right: 10px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }
    .scoreboard-title {
        font-size: 1.4em;
        padding: 10px 15px;
    }

        /* Footer mobile adjustments */
    .page-footer {
        padding: 20px 10px; /* Less padding on mobile */
        margin-top: 20px; /* Less margin on mobile */
    }
    .sponsor-text {
        font-size: 1em;
        margin-bottom: 10px;
    }
    .sponsor-image {
        max-width: 90%; /* Allow image to be slightly larger on small screens */
    }

    /* Sponsor carousel on mobile */
    .sponsor-carousel {
        height: 200px; /* Adjust height for mobile */
    }
    .sponsor-image {
        max-width: 95%; /* More width on mobile if needed */
        max-height: 95%;
    }

            /* Rules specific mobile adjustments */
    .round-rules-title {
        font-size: 1.8em; /* Smaller on mobile */
    }
    .rules-body {
        font-size: 1.1em; /* Increased for better readability */
        line-height: 1.7; /* Increased for better spacing between lines */
    }
    .rules-body ul {
        margin-left: 15px; /* Slightly reduce margin for lists on mobile */
    }
    .rules-body li {
        margin-bottom: 0.3em; /* Slightly reduce space between list items */
    }
}