SportsByNumbers/CourtIQ
0
1# src/core/helpers.py2import streamlit as st3 4def get_team_name(team_id):5 """Retrieves a team's name from session state given its ID."""6 team = next((t for t in st.session_state.teams if t['id'] == team_id), None)7 return team['name'] if team else 'N/A'8 9def get_team_logo(team_id):10 """Retrieves a team's logo URL from session state given its ID, or a placeholder."""11 team = next((t for t in st.session_state.teams if t['id'] == team_id), None)12 return team['logo'] if team else f"https://placehold.co/40x40/cccccc/000000?text=T"13 14def get_player_name(player_id):15 """Retrieves a player's name from session state given their ID."""16 player = next((p for p in st.session_state.players if p['id'] == player_id), None)17 return player['name'] if player else 'N/A'18 19def get_player_photo(player_id):20 """Retrieves a player's photo URL from session state given their ID, or a placeholder."""21 player = next((p for p in st.session_state.players if p['id'] == player_id), None)22 return player['profile_photo'] if player else f"https://placehold.co/40x40/cccccc/000000?text=P"23 24# --- Global Data for Selectboxes ---25# These are global constants used across various sections, especially in forms.26australian_states = ['ACT', 'NSW', 'NT', 'QLD', 'SA', 'TAS', 'VIC', 'WA']27all_basketball_leagues = {28 "National": ["NBL", "WNBL", "NBL (Wheelchair)"],29 "NBL1": ["NBL1 North", "NBL1 East", "NBL1 South", "NBL1 West", "NBL1 Central"],30 "ACT": [31 "Basketball ACT Premier League 1 (Men/Women)",32 "Basketball ACT Premier League 2 (Men/Women)",33 "ACT Junior Premier League (U12-U19 Div 1/2/3)",34 "Waratah League (ACT Based Teams - Various Divs)",35 "ACT Club Competition (Various Grades)",36 "ACT Social Leagues"37 ],38 "NSW": [39 "Waratah League (General)",40 "NSW Junior Premier League (General)",41 "Spalding Waratah League (Championship Men/Women)",42 "Spalding Waratah League (Division 1 Men/Women)",43 "Spalding Waratah League (Division 1 Youth Men/Women)",44 "Spalding Waratah League (Division 2 Youth Men/Women)",45 "NSW Junior Premier League (JPL - U12-U18 Metro/Country - Various Divs)",46 "NSW Country Basketball League (CBL - Various Conferences)",47 "NSW Metro Junior League (MJL - Various Divs)",48 "NSW Waratah Metro Junior League", "NSW Waratah Country Junior League",49 "NSW Waratah State Championships", "NSW Primary School Sports Association (PSSA)",50 "NSW Combined High Schools (CHS)", "NSW Combined Catholic Colleges (CCC)",51 "NSW Combined Independent Schools (CIS)", "NSW Local Domestic Competitions (Various Associations)"52 ],53 "NT": [54 "Darwin Basketball Association (DBA) League One (Men/Women)",55 "Darwin Basketball Association (DBA) Challenge Season (Men/Women)",56 "NT Junior Championships (U12-U18)",57 "Alice Springs Basketball Association League (Men/Women)",58 "NT Club Championships"59 ],60 "QLD": [61 "QSL (Queensland State League - Division 1 Men/Women)",62 "QSL (Queensland State League - Division 2 Men/Women)",63 "QSL Youth (Queensland State League - Youth Men/Women)",64 "BQJBC (Basketball QLD Junior Basketball Competition - U12-U21 - Various Divs)",65 "Southern Cross Challenge (U14/U15)", "Australian Indigenous Basketball Championships",66 "Queensland School Sport Championships", "Champion Basketball School of Queensland (CBSQ)",67 "QLD Club Championships (Various Age Groups)"68 ],69 "SA": [70 "NBL1 Central (SA Men/Women)",71 "SA Premier League (Formerly NBL1 Central Reserves)",72 "SA District Basketball League (Various Divs Men/Women)",73 "SA Junior District League (U10-U18 - Various Divs)",74 "SA Country Championships (Senior/Junior)",75 "SA School Sport Championships"76 ],77 "TAS": [78 "Tasmanian State League (TSL - Senior Men/Women)",79 "Basketball Tasmania Junior State League (U10-U18 - Various Divs)",80 "North West Basketball Union (NWBU - Senior/Junior)",81 "Tasmanian High School Championships", "Tasmanian Primary School Championships"82 ],83 "VIC": [84 "Big V (Championship Men/Women)",85 "Big V (Division One Men/Women)",86 "Big V (Division Two Men/Women)",87 "Big V (Youth League One Men/Women)",88 "Big V (Youth League Two Men/Women)",89 "VJBL (Victorian Junior Basketball League - U12-U21 - VC, VJL1-4, Regional)",90 "CBL (Country Basketball League - Various Conferences)",91 "Melbourne United Victorian Junior Basketball League (MUVJBL)",92 "Victorian School Championships", "Victorian College Championships",93 "Victorian Country Championships (Junior/Senior)"94 ],95 "WA": [96 "NBL1 West (WA Men/Women - Formerly SBL)",97 "WABL (Western Australian Basketball League - Championship Men/Women)",98 "WABL (Western Australian Basketball League - U12-U20 - Various Divs)",99 "WA Country Championships (Senior/Junior)",100 "WA School Sport Championships", "WA Associated & Public Schools (APS Sport)",101 "WA Catholic Associated Schools (CAS Sport)"102 ],103 "Other/National Events": [104 "Australian Schools Championships",105 "Australian U20 & Ivor Burge Championships",106 "Australian U18 Championships",107 "Australian U16 Championships",108 "Australian U14 Club Championships",109 "National Indigenous Basketball Tournament",110 "Masters Basketball Australia National Championships"111 ]112}113representative_teams_by_state = [114 {115 'state': 'ACT',116 'teams': [117 'Canberra Gunners', 'Canberra Nationals',118 'Canberra Gunners Academy',119 'U20 Men State Team (ACT)', 'U20 Women State Team (ACT)',120 'U18 Men State Team (ACT)', 'U18 Women State Team (ACT)',121 'U16 Men State Team (ACT)', 'U16 Women State Team (ACT)',122 'U14 Boys State Team (ACT)', 'U14 Girls State Team (ACT)',123 'Tuggeranong Vikings', 'Belconnen Ramblers',124 'Norths Basketball Club', 'Wests Magpies (Basketball ACT)',125 'Ginninderra Rats', 'Weston Creek Woden Dodgers',126 'Canberra City Stallions',127 ]128 },129 {130 'state': 'NSW',131 'teams': [132 'Sydney Comets', 'BA Centre of Excellence',133 'Albury Wodonga Bandits', 'Illawarra Hawks',134 'Newcastle Falcons', 'Hills Hornets',135 'Manly Warringah Sea Eagles', 'Sutherland Sharks',136 'Norths Bears', 'Central Coast Crusaders',137 'Maitland Mustangs',138 'Penrith Panthers', 'Bankstown Bruins',139 'Hornsby Ku-Ring-Gai Spiders', 'Inner West Bulls',140 'St George Saints Red', 'Blacktown Storm',141 'Camden Valley Wildfire', 'Hawkesbury Jets',142 'Ryde Bulls', 'Springwood Scorchers',143 'Coffs Harbour Suns', 'Tamworth Thunderbolts',144 'Bathurst Goldminers', 'Orange Eagles',145 'Wagga Wagga Heat', 'Shoalhaven Tigers',146 'Gosford City Rebels', 'Port Macquarie Dolphins',147 'Queanbeyan Roadrunners', 'Griffith Demons',148 'Dubbo Rams', 'Lismore Storm', 'Byron Bay Bees',149 'U20 Men State Team (NSW Metro)', 'U20 Women State Team (NSW Metro)',150 'U18 Men State Team (NSW Metro)', 'U18 Women State Team (NSW Metro)',151 'U16 Men State Team (NSW Metro)', 'U16 Women State Team (NSW Metro)',152 'U14 Boys State Team (NSW Metro)', 'U14 Girls State Team (NSW Metro)',153 'U20 Men State Team (NSW Country)', 'U20 Women State Team (NSW Country)',154 'U18 Men State Team (NSW Country)', 'U18 Women State Team (NSW Country)',155 'U16 Men State Team (NSW Country)', 'U16 Women State Team (NSW Country)',156 'U14 Boys State Team (NSW Country)', 'U14 Girls State Team (NSW Country)',157 'City of Sydney Bears', 'Macarthur Heat',158 'Parramatta Wildcats', 'Glebe Magic',159 'Bankstown Bruins Juniors', 'Hills Hornets Juniors', 'Hornsby Spiders Juniors',160 'Manly Warringah Sea Eagles Juniors', 'Norths Bears Juniors', 'Penrith Panthers Juniors',161 'Sutherland Sharks Juniors', 'St George Saints Juniors', 'Inner West Bulls Juniors',162 'Illawarra Hawks Juniors', 'Newcastle Falcons Juniors',163 'Albury Cougars Juniors', 'Maitland Mustangs Juniors',164 'Central Coast Waves Juniors', 'Gosford City Rebels Juniors',165 'Coffs Harbour Suns Juniors', 'Tamworth Thunderbolts Juniors',166 'Bathurst Goldminers Juniors', 'Orange Eagles Juniors',167 'Wagga Wagga Heat Juniors',168 ]169 },170 {171 'state': 'NT',172 'teams': [173 'Darwin Salties',174 'U20 Men State Team (NT)', 'U20 Women State Team (NT)',175 'U18 Men State Team (NT)', 'U18 Women State Team (NT)',176 'U16 Men State Team (NT)', 'U16 Women State Team (NT)',177 'U14 Boys State Team (NT)', 'U14 Girls State Team (NT)',178 'Ansett Basketball Club', 'Tracy Village Jets',179 'Uni Rebels', 'Palmerston Power', 'Eagles (Darwin)',180 'Razzle Storm', 'Lightning (Darwin)',181 'Memo Magic (Alice Springs)', 'Federal Demons (Alice Springs)',182 'Katherine Camels',183 ]184 },185 {186 'state': 'QLD',187 'teams': [188 'Brisbane Capitals', 'Gold Coast Rollers',189 'Cairns Marlins / Dolphins',190 'Townsville Heat / Flames',191 'Logan Thunder', 'Ipswich Force',192 'Mackay Meteors / Meteorettes',193 'Rockhampton Rockets / Cyclones',194 'USC Rip City', 'Southern Districts Spartans',195 'Northside Wizards', 'RedCity Roar',196 'South West Metro Pirates', 'North Gold Coast Seahawks',197 'U20 Men State Team (QLD North)', 'U20 Women State Team (QLD North)',198 'U18 Men State Team (QLD North)', 'U18 Women State Team (QLD North)',199 'U16 Men State Team (QLD North)', 'U16 Women State Team (QLD North)',200 'U14 Boys State Team (QLD North)', 'U14 Girls State Team (QLD North)',201 'U20 Men State Team (QLD South)', 'U20 Women State Team (QLD South)',202 'U18 Men State Team (QLD South)', 'U18 Women State Team (QLD South)',203 'U16 Men State Team (QLD South)', 'U16 Women State Team (QLD South)',204 'U14 Boys State Team (QLD South)', 'U14 Girls State Team (QLD South)',205 'Brisbane Phoenix', 'Brisbane Spartans Juniors', 'Ipswich Energy Juniors',206 'Logan Storm Juniors', 'Moreton Bay Fire', 'Gold Coast Waves Juniors',207 'Toowoomba Mountaineers', 'Bundaberg Bulls/Bears',208 'Gladstone Port City Power', 'Sunshine Coast Phoenix',209 'Hervey Bay Hurricanes', 'Gympie Comets',210 'Maroochydore Clippers', 'Warwick Wildcats', 'Caboolture Suns',211 ]212 },213 {214 'state': 'SA',215 'teams': [216 'Forestville Eagles', 'North Adelaide Rockets',217 'Southern Tigers', 'Sturt Sabres',218 'Norwood Flames', 'West Adelaide Bearcats',219 'Central Districts Lions', 'South Adelaide Panthers',220 'Woodville Warriors', 'Eastern Mavericks',221 'Mount Gambier Pioneers',222 'U20 Men State Team (SA Metro)', 'U20 Women State Team (SA Metro)',223 'U18 Men State Team (SA Metro)', 'U18 Women State Team (SA Metro)',224 'U16 Men State Team (SA Metro)', 'U16 Women State Team (SA Metro)',225 'U14 Boys State Team (SA Metro)', 'U14 Girls State Team (SA Metro)',226 'U20 Men State Team (SA Country)', 'U20 Women State Team (SA Country)',227 'U18 Men State Team (SA Country)', 'U18 Women State Team (SA Country)',228 'U16 Men State Team (SA Country)', 'U16 Women State Team (SA Country)',229 'U14 Boys State Team (SA Country)', 'U14 Girls State Team (SA Country)',230 'Port Adelaide Warriors', 'Noarlunga City Tigers', 'Unley Jets',231 'Marion Magnetics', 'Tea Tree Gully City Hawks', 'Southern Vales',232 'Riverland Raiders', 'Whyalla Steelers',233 'Port Lincoln Neptunes', 'Barossa Settlers',234 'Yorke Valley Basketball Association', 'Millicent Magic',235 ]236 },237 {238 'state': 'TAS',239 'teams': [240 'Hobart Chargers', 'Launceston Tornadoes',241 'North West Thunder / Wildcats',242 'U20 Men State Team (TAS)', 'U20 Women State Team (TAS)',243 'U18 Men State Team (TAS)', 'U18 Women State Team (TAS)',244 'U16 Men State Team (TAS)', 'U16 Women State Team (TAS)',245 'U14 Boys State Team (TAS)', 'U14 Girls State Team (TAS)',246 'Southern Wolves', 'Hobart Phoenix', 'Clarence United',247 'Kingborough-Huon Knights',248 'Launceston Lightning', 'City of Launceston Lions',249 'Devonport Warriors', 'Burnie Tigers',250 'Ulverstone Redhoppers', 'Penguin Blues',251 'Somerset Heat', 'Wynyard Wildcats', 'Smithton Saints',252 ]253 },254 {255 'state': 'VIC',256 'teams': [257 'Melbourne Tigers', 'Nunawading Spectres',258 'Knox Raiders', 'Dandenong Rangers',259 'Frankston Blues', 'Ballarat Miners / Rush',260 'Bendigo Braves', 'Geelong Supercats',261 'Kilsyth Cobras', 'Diamond Valley Eagles',262 'Sandringham Sabres', 'Waverley Falcons',263 'Eltham Wildcats', 'Casey Cavaliers',264 'Ringwood Hawks', 'Hume City Broncos',265 'Mount Gambier Pioneers (VIC Participation)',266 'U20 Men State Team (VIC Metro)', 'U20 Women State Team (VIC Metro)',267 'U18 Men State Team (VIC Metro)', 'U18 Women State Team (VIC Metro)',268 'U16 Men State Team (VIC Metro)', 'U16 Women State Team (VIC Metro)',269 'U14 Boys State Team (VIC Metro)', 'U14 Girls State Team (VIC Metro)',270 'U20 Men State Team (VIC Country)', 'U20 Women State Team (VIC Country)',271 'U18 Men State Team (VIC Country)', 'U18 Women State Team (VIC Country)',272 'U16 Men State Team (VIC Country)', 'U16 Women State Team (VIC Country)',273 'U14 Boys State Team (VIC Country)', 'U14 Girls State Team (VIC Country)',274 'Keilor Thunder', 'McKinnon Cougars',275 'Hawthorn Magic', 'Camberwell Dragons',276 'Bulleen Boomers', 'Altona Gators', 'Blackburn Vikings',277 'Melbourne Central Basketball Association', 'Werribee Devils',278 'Sunbury Jets', 'Whittlesea Pacers', 'Pakenham Warriors',279 'Chelsea Gulls', 'Coburg Giants', 'Wyndham Devils',280 'Shepparton Gators', 'Warrnambool Seahawks/Mermaids',281 'Traralgon T-Birds', 'Mildura Heat',282 'Horsham Hornets', 'Wodonga Wolves', 'Echuca Pirates',283 'Swan Hill Flyers', 'Bellarine Storm', 'Colac Kookas',284 'Maffra Eagles', 'Myrtleford Saints', 'Wallan Panthers',285 ]286 },287 {288 'state': 'WA',289 'teams': [290 'Perth Redbacks', 'Joondalup Wolves',291 'Warwick Senators', 'Willetton Tigers',292 'Rockingham Flames', 'Geraldton Buccaneers',293 'Lakeside Lightning', 'Perry Lakes Hawks',294 'East Perth Eagles', 'Mandurah Magic',295 'Goldfields Giants', 'Cockburn Cougars',296 'Kalamunda Eastern Suns', 'South West Slammers',297 'U20 Men State Team (WA Metro)', 'U20 Women State Team (WA Metro)',298 'U18 Men State Team (WA Metro)', 'U18 Women State Team (WA Metro)',299 'U16 Men State Team (WA Metro)', 'U16 Women State Team (WA Metro)',300 'U14 Boys State Team (WA Metro)', 'U14 Girls State Team (WA Metro)',301 'U20 Men State Team (WA Country)', 'U20 Women State Team (WA Country)',302 'U18 Men State Team (WA Country)', 'U18 Women State Team (WA Country)',303 'U16 Men State Team (WA Country)', 'U16 Women State Team (WA Country)',304 'U14 Boys State Team (WA Country)', 'U14 Girls State Team (WA Country)',305 'Stirling Senators (WABL)', 'East Perth Districts (WABL)',306 'Perth Lynx (WNBL)',307 'Bunbury Bears (Country)', 'Albany Raiders (Country)', 'Kalgoorlie Boulder (Country)',308 'Esperance (Country)', 'Karratha (Country)', 'Broome Barracudas (Country)',309 ]310 },311]312 313 314# --- Main App Logic ---315def main():316 # Apply global custom CSS (e.g., for padding, text color if desired)317 st.markdown("""318 <style>319 /* General styling for the entire app */320 body {321 font-family: 'Inter', sans-serif;322 color: #333333; /* Default text color */323 }324 /* Scrollbar styling */325 ::-webkit-scrollbar {326 width: 8px;327 }328 ::-webkit-scrollbar-track {329 background: #f1f1f1;330 border-radius: 10px;331 }332 ::-webkit-scrollbar-thumb {333 background: #888;334 border-radius: 10px;335 }336 ::-webkit-scrollbar-thumb:hover {337 background: #555;338 }339 340 /* Target the main sidebar container */341 div[data-testid="stSidebar"] {342 background-color: #1A2E4D; /* Primary blue from logo */343 padding-top: 2rem;344 padding-left: 1.5rem;345 padding-right: 1.5rem;346 }347 /* Adjust text color for main sidebar header */348 div[data-testid="stSidebar"] h1 {349 color: #F27C00 !important; /* Ensure CourtIQ title is orange */350 font-size: 2.25rem; /* text-3xl */351 font-weight: 800; /* font-extrabold */352 text-align: center;353 margin-bottom: 2rem;354 background: -webkit-linear-gradient(left, #F27C00, #FFD700); /* Gradient for CourtIQ */355 -webkit-background-clip: text;356 -webkit-text-fill-color: transparent;357 }358 /* Adjust text color for "Navigation" header */359 div[data-testid="stSidebar"] h2 {360 color: white; /* Make Navigation header white */361 font-size: 1.5rem; /* text-xl */362 font-weight: 700; /* font-bold */363 margin-bottom: 1rem;364 border-bottom: 1px solid rgba(255,255,255,0.2);365 padding-bottom: 0.5rem;366 }367 /* Adjust text color for User ID and copyright */368 div[data-testid="stSidebar"] p {369 color: #ccc; /* Lighter grey for footer text */370 font-size: 0.875rem; /* text-sm */371 }372 /* Adjust button text color within sidebar */373 div[data-testid="stSidebar"] .stButton>button {374 color: white; /* Ensure button text is readable on blue background */375 background-color: transparent; /* Remove default button background */376 border: none; /* Remove default button border */377 text-align: left; /* Align text to left */378 padding: 0.75rem 1rem; /* p-3 */379 font-size: 1.125rem; /* text-lg */380 font-weight: 600; /* font-semibold */381 border-radius: 0.5rem; /* rounded-lg */382 width: 100%; /* Ensure full width */383 margin-bottom: 0.25rem; /* mb-1 */384 transition: all 0.2s ease-in-out;385 display: flex;386 align-items: center;387 }388 div[data-testid="stSidebar"] .stButton>button:hover {389 background-color: #2D4A73; /* Lighten blue on hover */390 color: white;391 transform: scale(1.02); /* Slight scale on hover */392 }393 /* Style for selected sidebar button */394 div[data-testid="stSidebar"] .stButton>button[type="primary"] {395 background-color: #F27C00; /* Accent orange for selected button */396 color: white;397 box-shadow: 0 4px 8px rgba(0,0,0,0.2);398 transform: scale(1.05);399 }400 div[data-testid="stSidebar"] .stButton>button[type="primary"]:hover {401 background-color: #D66D00; /* Darker orange on hover for selected */402 transform: scale(1.05); /* Maintain scale on hover */403 }404 /* Adjust expander (for Reporting) header color */405 div[data-testid="stSidebar"] .st-emotion-cache-vk3288.e1f1d6z0 { /* This class targets the expander header */406 color: white; /* Make expander header white */407 font-weight: 600;408 font-size: 1.125rem;409 padding: 0.75rem 1rem;410 border-radius: 0.5rem;411 margin-bottom: 0.25rem;412 }413 div[data-testid="stSidebar"] .st-emotion-cache-vk3288.e1f1d6z0:hover {414 background-color: #2D4A73;415 }416 /* Adjust text color for sub-items within expander */417 div[data-testid="stSidebar"] .st-emotion-cache-10qj095.e1f1d6z0 .stButton>button {418 color: #e0e0e0; /* Lighter white for sub-items */419 font-size: 1rem;420 padding-left: 2rem; /* Further indent for sub-items */421 }422 div[data-testid="stSidebar"] .stButton>button:hover {423 background-color: #3f5f8f; /* Slightly different hover for sub-items */424 }425 426 /* Styling for the main content area */427 .main .block-container {428 padding-top: 2rem; /* More top padding */429 padding-bottom: 2rem;430 padding-left: 2rem;431 padding-right: 2rem;432 background-color: #F0F2F6; /* Streamlit's default light grey background */433 min-height: 100vh; /* Ensure it fills the height */434 }435 436 /* Styling for the main section header (the red bar) */437 h1.st-emotion-cache-10grl5a.e1f1d6z0 { /* Class for H1 headers. Verify this in browser's inspect tool. */438 background-color: #F27C00; /* Accent orange */439 color: white;440 padding: 15px 20px;441 border-radius: 10px;442 text-align: center;443 margin-bottom: 25px; /* More space below header */444 font-size: 2.5rem; /* text-4xl */445 font-weight: 800; /* font-extrabold */446 box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Stronger shadow */447 }448 449 /* Styling for st.subheader */450 h2.st-emotion-cache-1q8pulj.e1f1d6z0 { /* Class for H2 headers */451 font-size: 2rem; /* text-3xl */452 font-weight: 700; /* font-bold */453 color: #1A2E4D; /* Primary blue */454 margin-top: 1.5rem;455 margin-bottom: 1rem;456 border-bottom: 2px solid #F27C00; /* Orange underline */457 padding-bottom: 0.5rem;458 }459 460 /* Styling for st.write and st.markdown text */461 .st-emotion-cache-cnbvj8.e1nzilvr5 { /* Targets st.write/st.markdown text container */462 font-size: 1.1em;463 line-height: 1.6;464 color: #444;465 }466 467 /* Styling for st.metric */468 div[data-testid="stMetric"] {469 background-color: white;470 padding: 15px;471 border-radius: 10px;472 box-shadow: 0 2px 5px rgba(0,0,0,0.08);473 border: 1px solid #eee;474 text-align: center;475 margin-bottom: 15px; /* Space between metrics if they stack */476 }477 div[data-testid="stMetricLabel"] {478 font-size: 0.9em;479 color: #666;480 font-weight: 500;481 }482 div[data-testid="stMetricValue"] {483 font-size: 1.8em; /* Larger value */484 font-weight: 700;485 color: #1A2E4D; /* Primary blue */486 }487 div[data-testid="stMetricDelta"] {488 font-size: 0.8em;489 font-weight: 600;490 }491 492 /* Custom styling for Dashboard Quick Access buttons to make them look like cards */493 .quick-access-card {494 background-color: white;495 padding: 20px; /* More padding */496 border-radius: 12px; /* More rounded */497 box-shadow: 0 6px 15px rgba(0,0,0,0.12); /* Stronger shadow */498 transition: all 0.3s ease-in-out;499 margin-bottom: 20px; /* More space */500 height: 100%; /* Ensure cards are same height in columns */501 display: flex;502 flex-direction: column;503 justify-content: center;504 align-items: center;505 border: 1px solid #ddd;506 }507 .quick-access-card:hover {508 box-shadow: 0 10px 25px rgba(0,0,0,0.2);509 transform: translateY(-5px); /* More pronounced lift */510 }511 .quick-access-card .stButton button {512 background-color: transparent !important;513 color: #1A2E4D !important; /* Darker text for readability on white */514 border: none !important;515 box-shadow: none !important;516 text-align: center !important;517 font-size: 1.1em;518 font-weight: 700;519 padding: 0;520 margin: 0;521 height: auto;522 }523 .quick-access-card .stButton button:hover {524 color: #F27C00 !important; /* Change color on hover */525 background-color: transparent !important;526 transform: none; /* Disable button specific transform if parent has one */527 }528 .quick-access-card span { /* For the emoji icons */529 font-size: 2em; /* Larger emoji */530 margin-bottom: 0.5em;531 }532 533 /* Styling for forms (st.form) */534 div[data-testid="stForm"] {535 background-color: white;536 padding: 25px;537 border-radius: 12px;538 box-shadow: 0 5px 15px rgba(0,0,0,0.1);539 border: 1px solid #eee;540 margin-bottom: 30px;541 }542 div[data-testid="stForm"] .stTextInput label,543 div[data-testid="stForm"] .stDateInput label,544 div[data-testid="stForm"] .stTimeInput label,545 div[data-testid="stForm"] .stSelectbox label,546 div[data-testid="stForm"] .stFileUploader label {547 font-weight: 600;548 color: #1A2E4D;549 margin-bottom: 0.5rem;550 }551 div[data-testid="stForm"] input[type="text"],552 div[data-testid="st1pxazr7.e1f1d6z01 { /* Targeted column container */553 background-color: white; /* Ensure columns have white background if used as rows */554 padding: 10px;555 border-radius: 8px;556 margin-bottom: 5px;557 border: 1px solid #f0f0f0;558 }559 .st-emotion-cache-1pxazr7.e1f1d6z01:hover {560 background-color: #f9f9f9;561 }562 </style>563 """, unsafe_allow_html=True)564 565 # Adjust padding for the main content area566 st.markdown("<style>div.block-container{padding-top:1rem;}</style>", unsafe_allow_html=True)567 568 # Display modal if active (positioned at the top so it's always visible)569 modals.display_modal()570 571 # Render main content based on active_section572 if st.session_state.active_section == 'dashboard':573 dashboard.render_dashboard_section()574 elif st.session_state.active_section == 'game-management':575 game_management.render_game_management_section()576 elif st.session_state.active_section == 'video-analysis':577 video_analysis.render_video_analysis_section()578 elif st.session_state.active_section == 'rosters':579 roster.render_roster_section()580 elif st.session_state.active_section == 'player-performance':581 player_performance_section()582 elif st.session_state.active_section == 'team-statistics-report':583 team_statistics_report()584 elif st.session_state.active_section == 'game-summary-report':585 game_summary_report()586 elif st.session_state.active_section == 'league_comparison_report':587 league_comparison_report()588 elif st.session_state.active_section == 'manual_stats':589 manual_stats.render_manual_stats_section()590 591if __name__ == '__main__':592 main()593 