/*
Theme Name: RackTrack
Description: Professional pool league management system with FargoRate integration
Author: Break Point Technologies
Author URI: https://breakpointtechnologies.com
Version: 1.1.81
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    position: relative;
    z-index: 100;
}

.header-top {
    position: relative;
    height: var(--header-height);
    background-image: var(--header-bg-image);
    background-size: var(--header-bg-size);
    background-position: var(--header-bg-position);
    background-repeat: var(--header-bg-repeat);
    display: flex;
    align-items: center;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--header-overlay-color);
    opacity: var(--header-overlay-opacity);
    z-index: 1;
}

.header-branding {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    height: calc(var(--header-height) * 0.7);
    width: auto;
    max-width: 200px;
}

.site-info {
    color: white;
}

.site-title {
    margin: 0;
    font-size: 2.2em;
    font-weight: bold;
}

.site-title a {
    color: white;
    text-decoration: none;
}

.site-title a:hover {
    color: #e0e0e0;
}

.site-description {
    margin: 5px 0 0 0;
    font-size: 1.1em;
    color: #e0e0e0;
    font-style: italic;
}


/* Navigation Styles */
.main-navigation {
    background-color: var(--nav-menu-bg-color);
    border-bottom: 2px solid #dee2e6;
    width: 100%;
    transition: all 0.3s ease;
}

.main-navigation.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-navigation .container {
    padding: 0;
}

.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    width: 100%;
}

.nav-menu li {
    margin: 0;
    flex: 1;
}

.nav-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--nav-text-color);
    text-decoration: none;
    font-weight: 500;
    background-color: var(--nav-button-color);
    transition: all 0.3s ease;
    border-top: none;
    border-bottom: none;
    border-left: var(--nav-border-width) solid var(--nav-border-color);
    border-right: var(--nav-border-width) solid var(--nav-border-color);
    text-align: center;
    text-transform: var(--nav-text-transform);
    font-family: var(--nav-font-family);
    text-shadow: var(--nav-text-shadow);
}

.nav-menu li:first-child a {
    border-left-width: calc(var(--nav-border-width) * 2);
}

.nav-menu li:last-child a {
    border-right-width: calc(var(--nav-border-width) * 2);
}

.nav-menu a:hover {
    background-color: var(--nav-button-hover-color);
    color: var(--nav-text-hover-color);
}

/* Dropdown Menu Styles */
.nav-menu li {
    position: relative;
}

/* Target all possible WordPress submenu classes with maximum specificity */
.main-navigation .nav-menu .sub-menu,
.main-navigation .nav-menu .children,
.main-navigation .nav-menu ul ul,
nav.main-navigation ul.nav-menu ul.sub-menu,
.main-navigation.sticky .nav-menu .sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background-color: var(--nav-menu-bg-color) !important;
    min-width: 200px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 10000 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.main-navigation .nav-menu li:hover .sub-menu,
.main-navigation .nav-menu li:hover .children,
.main-navigation .nav-menu li:hover ul ul,
nav.main-navigation ul.nav-menu li:hover ul.sub-menu,
.main-navigation.sticky .nav-menu li:hover .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    transform: translateY(0) !important;
    height: auto !important;
    overflow: visible !important;
    z-index: 10000 !important;
}

.nav-menu .sub-menu li {
    width: 100%;
    flex: none;
}

.nav-menu .sub-menu a {
    display: block;
    padding: 12px 20px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    background-color: var(--nav-dropdown-button-color);
}

.nav-menu .sub-menu a:hover {
    background-color: var(--nav-button-hover-color);
}

.nav-menu .sub-menu li:last-child a {
    border-bottom: none;
}

/* Dropdown Arrow Indicator */
.nav-menu .menu-item-has-children > a::after {
    content: ' ▼';
    font-size: 10px;
    opacity: 0.7;
}

/* Force dropdown hiding with list styling reset */
ul.sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background-color: var(--nav-menu-bg-color) !important;
    min-width: 200px !important;
    z-index: 1000 !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Also remove bullets from sub-menu list items */
.sub-menu li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Show on hover */
.nav-menu li:hover .sub-menu {
    display: block !important;
}

/* Main Content */
.site-main {
    background-color: white;
    min-height: 400px;
}

.site-main .container {
    padding: 0 0px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.welcome-message {
    font-size: 1.2em;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.default-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.default-content p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

/* Page Templates */
.page-content, .page-content-with-sidebar {
    padding: 20px 0;
}

/* Align full-width template content with navigation */
.page-content {
    margin-top: -40px;
}



.page-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 20px;
}

.page-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin: 0;
}

.page-body {
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
}

/* Sidebar Layout */
.page-content-with-sidebar-container {
    padding: 0;
    margin: 0;
    height: auto;
    min-height: fit-content;
}

.page-content-with-sidebar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px;
    display: flex;
    gap: 20px;
}

.main-content-area {
    flex: 3;
    min-width: 0;
    margin-top: -40px;
}

.page-sidebar {
    flex: 1;
    min-width: 300px;
    background-color: #ffffff;
    border-radius: 8px;
    height: fit-content;
}

.sidebar-placeholder {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.page-content-with-sidebar .page-article {
    max-width: none;
    margin: 0;
    padding: 0;
}

.page-content-with-sidebar .page-header {
    text-align: left;
}

/* Widget Areas */
.main-content-widgets {
    margin-top: 40px;
}

.widget {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.widget-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sub-finder-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
    padding: 0;
}

.widget-placeholder {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

/* Footer Styles */
.footer-divider-bar {
    height: 40px;
    background-color: var(--page-background-color, #f4f4f4);
}

.site-footer {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 0 0 20px 0;
    margin-top: 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 40px 0 0 0 ;
    margin-bottom: 30px;
}

.footer-info {
    flex: 1;
    min-width: 250px;
}

.footer-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #ffffff;
}

.footer-info p {
    margin: 0;
    color: #cccccc;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    flex: 2;
}

.footer-column {
    flex: 1;
    min-width: 150px;
}

.footer-column h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #ffffff;
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column li {
    margin-bottom: 8px;
}

.footer-column a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: #cccccc;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    margin: 5px 0;
    color: #cccccc;
    font-size: 0.9em;
}

.footer-bottom a {
    color: #ffffff;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: #cccccc;
}

/* Mobile Menu Hamburger */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 15px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--nav-text-color);
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Mobile Menu Animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-branding {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .logo-section {
        flex-direction: column;
        gap: 10px;
    }

    .site-title {
        font-size: 1.8em;
    }

    .site-description {
        display: none;
    }

    /* Mobile Navigation */
    .main-navigation .container {
        position: relative;
        padding: 0;
        justify-content: flex-start;
    }

    .mobile-menu-toggle {
        display: flex;
        margin-left: 20px;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--nav-menu-bg-color);
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 1000;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add shadow for better visibility */
    }

    .nav-menu.active {
        max-height: calc(100vh - 150px); /* Limit to viewport height minus header space */
        overflow-y: auto; /* Enable scrolling */
        overflow-x: hidden; /* Prevent horizontal scroll */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scrollbar-width: thin; /* Firefox */
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent; /* Firefox */
    }

    /* Custom scrollbar styling for WebKit browsers */
    .nav-menu.active::-webkit-scrollbar {
        width: 6px;
    }

    .nav-menu.active::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-menu.active::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .nav-menu.active::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }

    .nav-menu li {
        flex: none;
    }

    .nav-menu a {
        text-align: left;
        padding: 15px 20px;
        border-left: none;
        border-right: none;
        border-bottom: var(--nav-border-width) solid var(--nav-border-color);
    }

    .nav-menu li:first-child a {
        border-left-width: var(--nav-border-width);
        border-top: var(--nav-border-width) solid var(--nav-border-color);
    }

    .nav-menu li:last-child a {
        border-right-width: var(--nav-border-width);
        border-bottom: var(--nav-border-width) solid var(--nav-border-color);
    }

    /* Mobile submenu behavior - override desktop absolute positioning */
    .main-navigation .nav-menu .sub-menu,
    .main-navigation .nav-menu .children,
    .main-navigation .nav-menu ul ul,
    nav.main-navigation ul.nav-menu ul.sub-menu,
    .main-navigation.sticky .nav-menu .sub-menu,
    .nav-menu .sub-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        background-color: var(--nav-dropdown-button-color) !important;
        min-width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Override desktop hover-to-show behavior on mobile - force submenus to stay hidden on hover */
    .nav-menu li:hover .sub-menu,
    .main-navigation .nav-menu li:hover .sub-menu,
    .main-navigation.sticky .nav-menu li:hover .sub-menu {
        display: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }

    /* But allow button hover colors to still work */
    .nav-menu a:hover,
    .nav-menu .sub-menu a:hover {
        background-color: var(--nav-button-hover-color) !important;
    }

    /* Show submenu when mobile-active class is added */
    .main-navigation .nav-menu .sub-menu.mobile-active,
    .main-navigation .nav-menu .children.mobile-active,
    .main-navigation .nav-menu ul ul.mobile-active,
    nav.main-navigation ul.nav-menu ul.sub-menu.mobile-active,
    .main-navigation.sticky .nav-menu .sub-menu.mobile-active,
    .nav-menu .sub-menu.mobile-active {
        display: block !important;
        /* Height now set dynamically by JavaScript */
    }

    /* Ensure submenu hides when mobile-active class is removed */
    .main-navigation .nav-menu .sub-menu:not(.mobile-active),
    .main-navigation .nav-menu .children:not(.mobile-active),
    .main-navigation .nav-menu ul ul:not(.mobile-active),
    nav.main-navigation ul.nav-menu ul.sub-menu:not(.mobile-active),
    .main-navigation.sticky .nav-menu .sub-menu:not(.mobile-active),
    .nav-menu .sub-menu:not(.mobile-active) {
        display: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }

    .nav-menu .sub-menu a {
        padding: 12px 30px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        background-color: var(--nav-dropdown-button-color) !important;
    }

    /* Add indicator to parent menu items on mobile */
    .nav-menu .menu-item-has-children > a::after {
        content: ' ▼' !important;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
        font-size: 16px;
        font-weight: bold;
    }

    .nav-menu .menu-item-has-children > a {
        position: relative;
        padding-right: 40px !important; /* Make room for arrow */
    }

    /* Rotate arrow when submenu is open */
    .nav-menu .menu-item-has-children:has(.sub-menu.mobile-active) > a::after {
        transform: rotate(180deg);
    }

/* Close mobile styles section */

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }

    .footer-links {
        flex-direction: column;
        gap: 25px;
    }

    /* Responsive sidebar layout */
    .page-content-with-sidebar {
        flex-direction: column;
        gap: 30px;
    }

    .page-sidebar {
        min-width: auto;
    }
}

/* Mobile-only (very small screens) */
@media (max-width: 480px) {
    .nav-menu.active {
        max-height: calc(100vh - 120px); /* Even more conservative height on small phones */
    }

    .header-top {
        min-height: 80px;
        padding: 10px 0;
    }

    .header-branding {
        justify-content: center;
        align-items: center;
        gap: 0;
    }

    .logo-section {
        justify-content: center;
        align-items: center;
        gap: 0;
    }

    .site-info {
        display: none;
    }

    .site-logo {
        height: calc(var(--header-height) * 0.9);
        width: auto;
        max-width: 90%;
        object-fit: contain;
    }

    /* Calendar widget mobile adjustments */
    .page-sidebar {
        padding: 5px;
    }

    .page-sidebar .widget {
        margin: 0;
        padding: 20px;
    }

    .racktrack-calendar-widget {
        overflow-x: auto;
        margin: 0;
        padding: 0;
    }

    .calendar-grid {
        min-width: 280px;
        font-size: 11px;
    }

    .calendar-grid th,
    .calendar-day {
        padding: 4px 2px;
        font-size: 10px;
    }

    .calendar-day {
        height: 28px;
    }

    .day-number {
        font-size: 10px;
    }
}

/* RackTrack Calendar Widget Styles */
.racktrack-calendar-widget {
    margin-bottom: 20px;
}

.calendar-header {
    margin-bottom: 15px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

.calendar-month-year {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    flex: 1;
    text-align: center;
}

.calendar-nav-prev,
.calendar-nav-next {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.calendar-nav-prev:hover,
.calendar-nav-next:hover {
    background-color: #007cba;
    color: #fff;
    border-color: #007cba;
    text-decoration: none;
}

.calendar-nav-prev:focus,
.calendar-nav-next:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Calendar loading state */
.calendar-loading {
    opacity: 0.6;
    pointer-events: none;
}

.calendar-loading .calendar-nav a {
    cursor: not-allowed;
    background-color: #e9ecef !important;
    color: #6c757d !important;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    background-color: #fff;
}

.calendar-grid th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: bold;
    text-align: center;
    padding: 8px 4px;
    border: 1px solid #ddd;
    font-size: 12px;
}

.calendar-day {
    width: 14.28%;
    height: 35px;
    border: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
    position: relative;
    background-color: #fff;
    cursor: default;
}

.calendar-day.empty {
    background-color: #f8f9fa;
}

.day-number {
    font-size: 12px;
    color: #333;
    font-weight: normal;
}

/* Event Color Coding */
.calendar-day.has-meeting {
    background-color: #dc3545 !important;
}

.calendar-day.has-meeting .day-number {
    color: #fff;
    font-weight: bold;
}

.calendar-day.has-league-night {
    background-color: #28a745 !important;
}

.calendar-day.has-league-night .day-number {
    color: #fff;
    font-weight: bold;
}

.calendar-day.has-tournament {
    background-color: #6f42c1 !important;
}

.calendar-day.has-tournament .day-number {
    color: #fff;
    font-weight: bold;
}

/* Calendar Color Key */
.calendar-color-key {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.calendar-color-key h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.color-key-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.color-key-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.color-box {
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: 2px;
    display: inline-block;
}

.color-box.meeting {
    background-color: #dc3545;
}

.color-box.league-night {
    background-color: #28a745;
}

.color-box.tournament {
    background-color: #6f42c1;
}

/* Upcoming Events */
.upcoming-events {
    margin-top: 20px;
}

.events-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.events-section h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.event-item {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.4;
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-item.meeting {
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
}

.event-item.league_night {
    background-color: #d4edda;
    border-left: 3px solid #28a745;
}

.event-item.tournament {
    background-color: #e2d9f3;
    border-left: 3px solid #6f42c1;
}

.event-item strong {
    color: #333;
    display: block;
    margin-bottom: 2px;
}

.event-date {
    color: #666;
    font-size: 11px;
}

.event-time {
    color: #666;
    font-size: 11px;
    display: inline-block;
    margin-top: 3px;
}

.event-location {
    color: #666;
    font-size: 11px;
    display: inline-block;
    margin-top: 3px;
}

/* Add to Calendar Button */
.racktrack-add-to-calendar {
    background: #228B22;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
    display: inline-block;
    width: auto;
    text-align: center;
}

.racktrack-add-to-calendar:hover {
    background: #1a6b1a;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(34, 139, 34, 0.3);
}

.racktrack-add-to-calendar:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(34, 139, 34, 0.3);
}

.racktrack-add-to-calendar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .racktrack-add-to-calendar {
        width: 100%;
        display: block;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* RackTrack Team Standings Widget */
.racktrack-team-standings {
    margin: 0;
    padding: 0;
}

.standing-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 2px;
}

.standing-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.rank-ball {
    font-size: 16px;
    margin-right: 12px;
    min-width: 30px;
    text-align: center;
    line-height: 1;
}

.team-name {
    font-size: 13px;
    color: #333;
    line-height: 1.3;
    flex: 1;
    font-weight: 500;
}

.racktrack-standings-error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    text-align: center;
}

.racktrack-standings-error p {
    margin: 0;
    font-size: 12px;
}

/* Pool Ball Image Styling */
.pool-ball-image {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rank-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    text-align: center;
    line-height: 24px;
    font-size: 10px;
    font-weight: bold;
}

/* Event Tooltip */
.event-tooltip {
    position: absolute;
    z-index: 1000;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #999;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    max-width: 250px;
    word-wrap: break-word;
}

.event-tooltip.show {
    opacity: 1;
    visibility: visible;
}

/* Tooltip background colors - very light tints of event colors */
.event-tooltip.meeting {
    background-color: #fef7f7; /* Very light red tint */
}

.event-tooltip.league_night {
    background-color: #f7fef8; /* Very light green tint */
}

.event-tooltip.tournament {
    background-color: #fbf8fe; /* Very light purple tint */
}

.event-tooltip-title {
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.2;
}

.event-tooltip-detail {
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.3;
}

.event-tooltip-detail:last-child {
    margin-bottom: 0;
}

/* RackTrack Sub Finder Widget Styles */
.racktrack-sub-finder-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.racktrack-sub-finder-widget .widget-header {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    padding: 25px 30px !important;
    text-align: center !important;
}

.racktrack-sub-finder-widget .widget-title {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.racktrack-sub-finder-widget .widget-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

.racktrack-sub-finder-widget .alert-section {
    background: #f8f9fa;
    padding: 25px 30px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.racktrack-sub-finder-widget .alert-section h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.racktrack-sub-finder-widget .alert-section p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.racktrack-sub-finder-widget .alert-button {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 25px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3) !important;
}

.racktrack-sub-finder-widget .alert-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.racktrack-sub-finder-widget .results-section {
    padding: 25px 30px;
}

.racktrack-sub-finder-widget .results-header {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.racktrack-sub-finder-widget .filter-bar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.racktrack-sub-finder-widget .filter-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 14px;
}

.racktrack-sub-finder-widget .filter-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.racktrack-sub-finder-widget .filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    min-width: 80px;
}

.racktrack-sub-finder-widget .filter-to {
    color: #666;
    font-weight: 500;
    margin: 0 5px;
}

.racktrack-sub-finder-widget .filter-clear {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s ease;
}

.racktrack-sub-finder-widget .filter-clear:hover {
    background: #5a6268;
}

.racktrack-sub-finder-widget .no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.racktrack-sub-finder-widget .sub-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.racktrack-sub-finder-widget .sub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.racktrack-sub-finder-widget .sub-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.racktrack-sub-finder-widget .sub-details {
    margin-bottom: 15px;
}

.racktrack-sub-finder-widget .sub-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.racktrack-sub-finder-widget .sub-detail span:first-child {
    font-size: 16px;
    width: 20px;
}

.racktrack-sub-finder-widget .contact-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.racktrack-sub-finder-widget .contact-btn {
    background: #28a745 !important;
    color: white !important;
    text-decoration: none !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
}

.racktrack-sub-finder-widget .contact-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.racktrack-sub-finder-widget .contact-btn.phone-btn {
    background: #007bff !important;
}

.racktrack-sub-finder-widget .contact-btn.phone-btn:hover {
    background: #0056b3 !important;
}

.racktrack-sub-finder-widget .contact-btn.text-btn {
    background: #6f42c1 !important;
}

.racktrack-sub-finder-widget .contact-btn.text-btn:hover {
    background: #5a32a3 !important;
}

.racktrack-sub-finder-widget .contact-btn.email-btn {
    background: #fd7e14 !important;
}

.racktrack-sub-finder-widget .contact-btn.email-btn:hover {
    background: #e96500 !important;
}

.racktrack-sub-finder-widget .contact-btn.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.racktrack-sub-finder-widget .contact-btn.disabled:hover {
    background: #6c757d;
    transform: none;
}

/* Modal Styles */
.racktrack-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.racktrack-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    text-align: center;
}

.racktrack-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.racktrack-modal-close:hover {
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .racktrack-sub-finder-widget .filter-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .racktrack-sub-finder-widget .filter-input {
        min-width: auto;
    }

    .racktrack-sub-finder-widget .contact-buttons {
        justify-content: center;
    }

    .racktrack-sub-finder-widget .widget-header {
        padding: 20px;
    }

    .racktrack-sub-finder-widget .results-section,
    .racktrack-sub-finder-widget .alert-section {
        padding: 20px;
    }
}

/* League Standings Widget (Full Stats) - Full Width */
.racktrack-league-standings-full {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

/* Timestamp styling for widget title - smaller and italicized but readable on mobile */
.standings-timestamp {
    font-size: 12px !important;
    font-weight: 300 !important;
    font-style: italic !important;
    color: #555 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: inherit !important;
    display: inline-block !important;
    vertical-align: baseline !important;
}

.standings-table {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.standings-header {
    display: grid;
    grid-template-columns: 80px 2fr 80px 100px 100px 100px;
    gap: 15px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px 25px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.standings-header .col-rank,
.standings-header .col-team,
.standings-header .col-pts,
.standings-header .col-games,
.standings-header .col-rounds,
.standings-header .col-weeks {
    color: white !important;
    font-size: 14px !important;
    font-weight: bold !important;
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 100%;
}

.standings-header .col-team {
    justify-content: flex-start;
    padding-left: 10px;
}

.standings-header .col-rank,
.standings-header .col-pts,
.standings-header .col-games,
.standings-header .col-rounds,
.standings-header .col-weeks {
    justify-content: center;
}

.standings-row {
    display: grid;
    grid-template-columns: 80px 2fr 80px 100px 100px 100px;
    gap: 15px;
    padding: 12px 25px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: all 0.3s ease;
    text-align: center;
}

.standings-row:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.standings-row:last-child {
    border-bottom: none;
}

.standings-row:nth-child(even) {
    background-color: #fafbfc;
}

.standings-row:nth-child(even):hover {
    background-color: #f8f9fa;
}

/* Column styles for full width */
.col-rank {
    text-align: center;
}

.col-team {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    text-align: left;
    padding-left: 10px;
}

.col-pts, .col-games, .col-rounds, .col-weeks {
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.col-pts {
    color: #555555 !important;
    font-weight: bold;
}

.col-games {
    color: #555555 !important;
}

.col-rounds {
    color: #555555 !important;
}

.col-weeks {
    color: #555555 !important;
}

/* Pool ball images in full-width league standings */
.racktrack-league-standings-full .pool-ball-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.racktrack-league-standings-full .rank-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Mobile responsive for full-width league standings */
@media (max-width: 768px) {
    .racktrack-league-standings-full {
        margin: 10px 0;
        border-radius: 8px;
    }

    .standings-header {
        padding: 15px 20px;
        font-size: 12px;
        grid-template-columns: 60px 2fr 60px 80px 80px 80px;
        gap: 10px;
    }

    .standings-row {
        padding: 15px 20px;
        grid-template-columns: 60px 2fr 60px 80px 80px 80px;
        gap: 10px;
    }

    .col-team {
        font-size: 14px;
    }

    .col-pts, .col-games, .col-rounds, .col-weeks {
        font-size: 14px;
    }

    .racktrack-league-standings-full .pool-ball-image {
        width: 26px;
        height: 26px;
    }

    .racktrack-league-standings-full .rank-number {
        width: 26px;
        height: 26px;
        line-height: 26px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .standings-header {
        padding: 12px 15px;
        font-size: 10px;
        grid-template-columns: 50px 1.5fr 50px 60px 60px 60px;
        gap: 8px;
    }

    .standings-row {
        padding: 12px 15px;
        grid-template-columns: 50px 1.5fr 50px 60px 60px 60px;
        gap: 8px;
    }

    .col-team {
        font-size: 13px;
        padding-left: 5px;
    }

    .col-pts, .col-games, .col-rounds, .col-weeks {
        font-size: 12px;
    }

    .racktrack-league-standings-full .pool-ball-image {
        width: 24px;
        height: 24px;
    }

    .racktrack-league-standings-full .rank-number {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .standings-header {
        padding: 10px 12px;
        font-size: 9px;
        grid-template-columns: 40px 1fr 40px 50px 50px 50px;
        gap: 5px;
    }

    .standings-row {
        padding: 10px 12px;
        grid-template-columns: 40px 1fr 40px 50px 50px 50px;
        gap: 5px;
    }

    .col-team {
        font-size: 12px;
        padding-left: 3px;
    }

    .col-pts, .col-games, .col-rounds, .col-weeks {
        font-size: 11px;
    }

    .racktrack-league-standings-full .pool-ball-image {
        width: 20px;
        height: 20px;
    }

    .racktrack-league-standings-full .rank-number {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 10px;
    }
}

/* Top Players Widget Styling */
.racktrack-top-players-widget {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.top-player-category {
    padding: 0 0 5px 0;
    margin-bottom: 12px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.top-player-category:last-child {
    margin-bottom: 0;
}

.top-player-category:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.category-title {
    font-size: 14px;
    text-align: center;
    font-weight: 600;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    margin: 0 0 5px 0;
    padding: 12px 20px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.player-info {
    margin-left: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10% 8px 5%;
    /* gap: 25%; */
    min-height: 40px;
}

.player-list {
    padding: 0 0;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10% 8px 5%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.075);
}

.player-item:last-child {
    border-bottom: none;
}

.player-rank-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-rank-info *,
.player-rank-info img,
.player-rank-info span {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.player-name {
    font-size: 15px;
    font-weight: 500;
    color: #34495e;
    border: none !important;
    outline: none !important;
}

.top-players-pool-ball {
    border: none !important;
    outline: none !important;
}

.player-value {
    font-size: 16px;
    font-weight: 600;
    color: #27ae60;
    background: #ecf0f1;
    padding: 4px 8px;
    border: 2px solid rgba(82, 131, 93, 0.4);
    border-radius: 12px;
}

.top-players-pool-ball {
    width: 25px;
    height: 25px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}



/* Responsive design for top players widget */
@media (max-width: 768px) {
    .top-player-category {
        margin-bottom: 10px;
        padding: 0 0 5px 0;
    }

    .category-title {
        font-size: 13px;
        padding: 10px 15px;
    }

    .player-info {
        margin-left: 32.5px;
        margin-right: 10%;
        padding: 8px 0 8px 5%;
        /* gap: 25%; */
        min-height: 36px;
    }

    .player-list {
        padding: 0 0;
    }

    .player-name {
        font-size: 14px;
    }

    .player-value {
        font-size: 14px;
        padding: 4px 8px;
    }

    .top-players-pool-ball {
        width: 22.5px;
        height: 22.5px;
    }
}

/* Player Stats Widget Styling */
.racktrack-player-stats-widget {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.player-stats-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.player-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
}

.player-stats-table thead tr {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
    border-right: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.player-stats-table thead th:first-child {
    border-top-left-radius: 8px;
}

.player-stats-table thead th:last-child {
    border-top-right-radius: 8px;
}

.player-stats-table thead th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    user-select: none;
    white-space: nowrap;
}

.player-stats-table thead th.sortable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.player-stats-table thead th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.player-stats-table thead th:last-child {
    border-right: none;
}

/* Sort arrow styling */
.player-stats-table thead th .sort-arrow {
    display: inline-block;
    margin-left: 4px;
    opacity: 0;
    font-size: 12px;
    visibility: hidden;
}

.player-stats-table thead th .sort-arrow.asc {
    opacity: 1;
    visibility: visible;
}

.player-stats-table thead th .sort-arrow.asc::before {
    content: '↑';
}

.player-stats-table thead th .sort-arrow.desc {
    opacity: 1;
    visibility: visible;
}

.player-stats-table thead th .sort-arrow.desc::before {
    content: '↓';
}

.player-stats-table tbody tr.player-stats-row {
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    border-left: 2px solid rgba(0, 0, 0, 0.1);
    border-right: 2px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
}

.player-stats-table tbody tr.player-stats-row:hover {
    background-color: rgba(52, 73, 94, 0.05);
}

.player-stats-table tbody tr.player-stats-row:last-child {
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.player-stats-table tbody tr.player-stats-row:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.player-stats-table tbody tr.player-stats-row:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.player-stats-table tbody td {
    padding: 10px 8px;
    text-align: center;
    color: #2c3e50;
}

.player-stats-table tbody td.name-col {
    text-align: left;
    font-weight: 500;
    color: #34495e;
}

.player-stats-table tbody td.rank-col {
    font-weight: 600;
    color: #7f8c8d;
}

.player-stats-table tbody td.win-pct-col {
    font-weight: 600;
    color: #27ae60;
}

/* Column width optimization */
.player-stats-table .rank-col {
    width: 4%;
    min-width: 40px;
}

.player-stats-table .name-col {
    width: 15%;
    min-width: 120px;
}

.player-stats-table .avg-col,
.player-stats-table .win-pct-col {
    width: 6%;
    min-width: 55px;
}

.player-stats-table .games-col,
.player-stats-table .points-col {
    width: 7%;
    min-width: 60px;
}

.player-stats-table .weeks-col,
.player-stats-table .br-col,
.player-stats-table .wz-col,
.player-stats-table .tr-col,
.player-stats-table .wb-col,
.player-stats-table .cw-col,
.player-stats-table .pm-col {
    width: 5%;
    min-width: 45px;
}

/* Responsive design for player stats widget */
@media (max-width: 1024px) {
    .player-stats-table {
        font-size: 12px;
    }

    .player-stats-table thead th {
        padding: 10px 6px;
        font-size: 11px;
    }

    .player-stats-table tbody td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .player-stats-table {
        font-size: 11px;
    }

    .player-stats-table thead th {
        padding: 8px 4px;
        font-size: 10px;
        letter-spacing: 0.3px;
    }

    .player-stats-table tbody td {
        padding: 6px 4px;
    }

    .player-stats-table .name-col {
        min-width: 100px;
    }
}

/* RackTrack Venue Map Widget Styles with Pool Table Overlay */
.racktrack-venue-map-container {
    width: 100%;
    height: 0;
    padding-bottom: 50%; /* 2:1 aspect ratio */
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    position: relative;
    transition: all 0.3s ease;
}

.racktrack-venue-map-container:hover {
    transform: translateY(-3px);
}

.racktrack-venue-map {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92% !important; /* Slightly smaller to fit inside table rails */
    height: 84% !important; /* Pulled in from top/bottom rails */
    border: none;
    border-radius: 0;
    z-index: 1; /* Behind the table overlay */
}

.racktrack-pool-table-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/map_pool_table_transparent_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10; /* On top of the map */
    pointer-events: none; /* Allow clicks to pass through to the map */
    border-radius: 0;
}

.venue-map-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(231, 76, 60, 0.95);
    border: 3px solid #ffffff;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 15; /* Above both map and table overlay */
}

.venue-map-error::before {
    content: '🎱';
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.venue-map-error p {
    margin: 0;
    font-weight: 500;
}

/* Responsive adjustments for pool table overlay venue map */
@media (max-width: 768px) {
    .racktrack-venue-map-container {
        border-radius: 8px;
    }

    .racktrack-venue-map {
        border-radius: 8px;
    }

    .racktrack-pool-table-overlay {
        border-radius: 8px;
    }

    .venue-map-error {
        width: 75%;
        height: 55%;
        font-size: 13px;
    }

    .venue-map-error::before {
        font-size: 28px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .racktrack-venue-map-container {
        border-radius: 6px;
    }

    .racktrack-venue-map {
        border-radius: 6px;
    }

    .racktrack-pool-table-overlay {
        border-radius: 6px;
    }

    .venue-map-error {
        width: 70%;
        height: 50%;
        font-size: 12px;
    }

    .venue-map-error::before {
        font-size: 24px;
        margin-bottom: 8px;
    }
}

/* ============================================================================
   TEAM STATS WIDGET
   ============================================================================ */

.team-stats-view-selector {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.team-stats-view-selector label {
    color: #495057;
    font-size: 14px;
}

.team-stats-view-select {
    font-size: 14px;
    min-width: 200px;
}

.team-stats-container {
    margin: 20px 0;
}

.team-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.team-stats-table thead tr {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

.team-stats-table th {
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    font-size: 11px;
}

.team-stats-table th.player-name-col,
.team-stats-table th.total-label-col {
    text-align: left;
    min-width: 150px;
    position: sticky;
    left: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    z-index: 2;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.team-stats-table th.week-col {
    min-width: 35px;
    font-size: 10px;
}

.team-stats-table th.summary-col {
    background: linear-gradient(135deg, #16a085, #1abc9c);
    font-size: 11px;
    min-width: 45px;
}

.team-stats-table th:first-child {
    border-top-left-radius: 8px;
    border-left: 2px solid #2c3e50;
}

.team-stats-table th:last-child {
    border-top-right-radius: 8px;
    border-right: 2px solid #2c3e50;
}

.team-stats-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.team-stats-table tbody tr:hover {
    background-color: #f8f9fa;
}

.team-stats-table tbody tr:last-child {
    border-bottom: 2px solid #2c3e50;
}

.team-stats-table td {
    padding: 8px 6px;
    text-align: center;
    border-right: 1px solid #ecf0f1;
    border-left: 2px solid #2c3e50;
}

.team-stats-table td:last-child {
    border-right: 2px solid #2c3e50;
}

.team-stats-table td.player-name {
    text-align: left;
    font-weight: 600;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid #ecf0f1;
    white-space: nowrap;
}

.team-stats-table td.week-score {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 700;
}

/* Add visual separation between rows in player weekly view */
.team-stats-table.player-weekly-only tbody tr {
    border-bottom: 2px solid #dee2e6;
}

/* Sticky columns for responsive week filtering */
.team-stats-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
}

.team-stats-table thead .sticky-col {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    z-index: 20;
}

.team-stats-table tbody .sticky-col {
    background: #fff;
}

.team-stats-table tbody tr:nth-child(even) .sticky-col {
    background: #fafafa;
}

.team-stats-table .team-total-row .sticky-col {
    background: #ecf0f1 !important;
}

.team-stats-table .sticky-summary {
    position: sticky;
    right: 0;
    z-index: 10;
}

.team-stats-table thead .sticky-summary {
    background: linear-gradient(135deg, #16a085, #1abc9c);
    z-index: 20;
}

.team-stats-table tbody .sticky-summary {
    background: #d5f4e6;
}

.team-stats-table.team-totals-only thead .sticky-summary {
    background: linear-gradient(135deg, #16a085, #1abc9c);
}

.team-stats-table td.summary-stat {
    background-color: #e8f8f5;
    font-weight: 600;
    color: #16a085;
}

/* Team total rows styling */
.team-stats-table tr.separator-row {
    height: 2px;
    background: #34495e;
}

.team-stats-table tr.separator-row td {
    padding: 0;
    border: none;
}

.team-stats-table tr.team-total-row {
    background-color: #f8f9fa;
    font-weight: 700;
}

.team-stats-table tr.team-total-row:hover {
    background-color: #e9ecef;
}

.team-stats-table td.total-label {
    text-align: left;
    background: #ecf0f1;
    font-weight: 700;
    color: #2c3e50;
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid #bdc3c7;
}

.team-stats-table td.total-value {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #34495e;
}

.team-stats-table td.total-summary {
    background-color: #d5f4e6;
    font-weight: 700;
    color: #16a085;
    text-align: center;
}

/* Alternating row colors for players */
.team-stats-table .player-row:nth-child(even) {
    background-color: #fafafa;
}

.team-stats-table .player-row:nth-child(odd) {
    background-color: #ffffff;
}

/* Timestamp styling */
.team-stats-timestamp {
    font-style: italic;
    padding: 8px 12px;
    background: #ecf0f1;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

/* Specific styling for team totals and player summary views */
.team-stats-table.team-totals-only th.total-label-col,
.team-stats-table.team-totals-only td.total-label {
    min-width: auto;
    width: auto;
    white-space: nowrap;
}

.team-stats-table.player-summary-only th.player-name-col,
.team-stats-table.player-summary-only td.player-name {
    min-width: auto;
    width: auto;
    white-space: nowrap;
}

/* Responsive design */
@media (max-width: 768px) {
    .team-stats-table {
        font-size: 11px;
    }

    .team-stats-table th,
    .team-stats-table td {
        padding: 6px 4px;
    }

    .team-stats-table th.player-name-col,
    .team-stats-table td.player-name {
        min-width: 120px;
        font-size: 11px;
    }

    .team-stats-table th.week-col {
        min-width: 30px;
        font-size: 9px;
    }

    .team-stats-table th.summary-col {
        font-size: 10px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .team-stats-table {
        font-size: 10px;
    }

    .team-stats-table th,
    .team-stats-table td {
        padding: 4px 2px;
    }

    .team-stats-table th.player-name-col,
    .team-stats-table td.player-name {
        min-width: 100px;
        font-size: 10px;
    }

    .team-stats-table th.week-col {
        min-width: 28px;
        font-size: 8px;
    }
}

/* ============================================
   Rating History Chart Styles
   ============================================ */

.profile-rating-history {
    margin-top: 30px;
}

.rating-history-header {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #228B22 0%, #1a6b1a 100%);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.current-rating-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.current-rating-display .rating-label {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.current-rating-display .rating-value {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chart-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.chart-filters .filter-btn {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-filters .filter-btn:hover {
    background-color: #e9ecef;
    border-color: #228B22;
    color: #228B22;
}

.chart-filters .filter-btn.active {
    background-color: #228B22;
    border-color: #228B22;
    color: #fff;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chart-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

.chart-message p {
    margin: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chart-filters {
        gap: 8px;
    }

    .chart-filters .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .chart-container {
        padding: 15px;
    }
}
