/* Date Navigator */
.kobit-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #0057b8; /* Main blue color */
    color: #FFFFFF;
    transition: background-color 0.3s ease;
}
.kobit-date-nav-btn {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #FFFFFF;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kobit-date-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.kobit-date-nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.kobit-datepicker {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #FFFFFF;
    border-radius: 4px;
    padding: 7px 10px; /* to match button height */
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 160px;
}
/* Match Filters */
.kobit-match-filters {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background-color: #F0F5FA;
    border-bottom: 1px solid #D1D5DB;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.kobit-filter-btn {
    background-color: #FFFFFF;
    border: 1px solid #D1D5DB;
    color: #212121;
    border-radius: 16px; /* Pill shape */
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.kobit-filter-btn.active, .kobit-filter-btn:hover {
    background-color: #0057b8;
    color: #FFFFFF;
    border-color: #0057b8;
}
/* Live Count Badge */
.kobit-live-badge {
    display: inline-block;
    margin-left: 8px;
    background-color: #E53935; /* Live Red */
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.2;
    vertical-align: middle;
    animation: kobitPulse 1.5s infinite;
}
.kobit-filter-btn.active .kobit-live-badge, .kobit-filter-btn:hover .kobit-live-badge {
    background-color: #FFFFFF;
    color: #0057b8;
    animation: none; /* Stop pulsing on hover/active */
}
@keyframes kobitPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}
.kobit-league-table th.rank, .kobit-league-table td.rank {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #0057b8 !important;
    color: #fff !important;
    width: 40px;
    min-width: 40px;
    text-align: center;
}
.kobit-league-table th.team, .kobit-league-table td.team {
    position: sticky;
    left: 40px;
    z-index: 2;
    background-color: #0057b8 !important;
    color: #fff !important;
    border-right: 1px solid #004494;
}
.kobit-league-table .team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 5px;
}
/* Player Stats List Table Styles */
.kobit-stats-table { font-size: 14px; }
.kobit-stats-table-header, .kobit-stats-table-row { display: flex; align-items: center; padding: 12px 8px; border-bottom: 1px solid #D1D5DB; }
.kobit-stats-table-header { font-weight: bold; color: #212121; border-bottom-width: 2px; }
.kobit-stats-table-row:hover { background-color: #E3F2FD; }
.col-rank { width: 40px; text-align: center; color: #888; flex-shrink: 0; }
.col-player { width: 45%; display: flex; align-items: center; padding-right: 15px; }
.col-player .player-photo { width: 32px; height: 32px; border-radius: 50%; margin-right: 12px; object-fit: cover; background-color: #F0F5FA; }
.col-team { width: 35%; display: flex; align-items: center; }
.col-team .team-logo { width: 22px; height: 22px; margin-right: 10px; object-fit: contain; }
.col-stat { width: 10%; text-align: right; font-weight: bold; font-size: 16px; padding-right: 10px; flex-shrink: 0; }

/* Player Season Stats Table */
.kobit-player-season-stats { font-size: 14px; }
.kobit-player-season-stats-header, .kobit-player-season-stats-row { display: flex; align-items: center; padding: 12px 8px; border-bottom: 1px solid #D1D5DB; }
.kobit-player-season-stats-header { font-weight: bold; color: #212121; }
.kobit-player-season-stats-row:hover { background-color: #e3f2fd; }
.kobit-player-season-stats .col-competition { flex-grow: 1; display: flex; align-items: center; }
.kobit-player-season-stats .col-competition .competition-logo { width: 20px; height: 20px; margin-right: 8px; object-fit: contain; }
.kobit-player-season-stats .col-stat-icon { width: 50px; text-align: center; flex-shrink: 0; }
.kobit-player-season-stats-header .col-stat-icon { font-size: 12px; }
.kobit-player-season-stats-header .col-stat-icon i { font-size: 16px; }
.kobit-player-season-stats-header .col-stat-icon .is-yellow-card { color: #ffc107; }
.kobit-player-season-stats-header .col-stat-icon .is-red-card { color: #dc3545; }
.kobit-player-season-stats a.col-competition { text-decoration: none; color: inherit; }
.kobit-player-season-stats a.col-competition:hover { color: #0057b8; }
.kobit-player-season-stats a.col-competition:hover span { text-decoration: underline; }

/* Modern Career Summary */
.kobit-career-summary.modern { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-top: 20px; }
.kobit-summary-card { background-color: #F0F5FA; border: 1px solid #D1D5DB; border-radius: 8px; padding: 20px; text-align: center; transition: transform 0.2s, box-shadow 0.2s; }
.kobit-summary-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.kobit-summary-card-icon { font-size: 28px; color: #0057b8; margin-bottom: 12px; }
.kobit-summary-card-value { font-size: 36px; font-weight: 700; color: #212121; line-height: 1.2; }
.kobit-summary-card-label { font-size: 14px; color: #555; margin-top: 4px; }

/* Modern Transfer History (Responsive) */
.kobit-transfer-history.modern { display: flex; flex-direction: column; gap: 12px; }
.kobit-transfer-header { 
    display: grid; 
    grid-template-columns: 100px 1fr 100px; 
    padding: 0 16px 8px 16px; 
    font-weight: 600; 
    color: #757575; 
    font-size: 13px;
    border-bottom: 1px solid #D1D5DB;
    transition: border-color 0.3s ease, color 0.3s ease;
}
.kobit-transfer-header .th-movement { text-align: center; }
.kobit-transfer-header .th-type { text-align: right; }

.kobit-transfer-card { 
    background-color: #E3F2FD; 
    color: #000000;
    border: 1px solid #D1D5DB; 
    border-radius: 8px; 
    padding: 16px; 
    display: grid;
    grid-template-columns: 100px 1fr 100px;
    align-items: center;
    gap: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.transfer-meta { display: flex; flex-direction: column; gap: 4px; }
.transfer-date { font-size: 13px; color: #757575; }
.transfer-type-badge { display: inline-block; background-color: #FFFFFF; color: #212121; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; width: fit-content; }

.transfer-movement { display: flex; align-items: center; justify-content: center; gap: 12px; flex: 1; }
.transfer-team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; width: 45%; }
.transfer-team img { width: 32px; height: 32px; object-fit: contain; }
.transfer-team span { font-size: 13px; font-weight: 500; line-height: 1.2; }
.transfer-arrow { color: #BDBDBD; font-size: 14px; }

/* Mobile Transfers */
@media (max-width: 767px) {
    .kobit-transfer-header { display: none; }
    .kobit-transfer-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .transfer-meta { 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        border-bottom: 1px solid #F0F5FA; 
        padding-bottom: 8px; 
    }
    .transfer-movement { justify-content: space-between; }
    .transfer-team { flex-direction: row; width: auto; gap: 8px; text-align: left; }
    .transfer-team.from { justify-content: flex-start; }
    .transfer-team.to { justify-content: flex-end; flex-direction: row-reverse; text-align: right; }
}

/* Date Navigator */
body.kobit-dark-mode .kobit-date-nav {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
}

/* Match Filters */
body.kobit-dark-mode .kobit-match-filters {
    background-color: #2c2c2c;
    border-bottom-color: #333;
}
body.kobit-dark-mode .kobit-filter-btn {
    background-color: #1e1e1e;
    border-color: #444;
    color: #e0e0e0;
}
body.kobit-dark-mode .kobit-filter-btn.active, body.kobit-dark-mode .kobit-filter-btn:hover {
    background-color: #4dabf5;
    border-color: #4dabf5;
    color: #fff;
}

/* Transfer History */
body.kobit-dark-mode .kobit-transfer-header {
    border-bottom-color: #333;
    color: #a0a0a0;
}
body.kobit-dark-mode .kobit-transfer-card {
    background-color: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}
body.kobit-dark-mode .transfer-meta { border-bottom-color: #333; }
body.kobit-dark-mode .transfer-type-badge { background-color: #333; color: #4dabf5; }
body.kobit-dark-mode .transfer-arrow { color: #666; }

/* Sticky Table Columns in Dark Mode */
body.kobit-dark-mode .kobit-league-table th.rank,
body.kobit-dark-mode .kobit-league-table td.rank,
body.kobit-dark-mode .kobit-league-table th.team,
body.kobit-dark-mode .kobit-league-table td.team {
    background-color: #1e1e1e !important;
    color: #fff !important;
    border-right-color: #333;
}

/* Highlighted Sticky Columns in Dark Mode */
body.kobit-dark-mode .kobit-league-table tr.highlighted td.rank,
body.kobit-dark-mode .kobit-league-table tr.highlighted td.team {
    background-color: #333 !important;
}

/* Force full team names on mobile for match list and stack logo/text */
@media (max-width: 768px) {
    .kobit-match-row {
        height: auto;
        min-height: 70px;
        padding: 8px 12px;
    }
    .kobit-match-row .kobit-team-name.full-name {
        display: inline-block !important;
        white-space: normal;
        text-align: center;
        font-size: 11px;
        line-height: 1.2;
    }
    .kobit-match-row .kobit-team-name.short-name {
        display: none !important;
    }
    .kobit-match-row .kobit-team.home {
        flex-direction: column-reverse;
    }
    .kobit-match-row .kobit-team.away {
        flex-direction: column;
    }
    .kobit-match-row .kobit-team {
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
}

/* Mobile Sticky Bottom Nav */
@media (max-width: 768px) {
    body.kobit-sticky-bottom-active .kobit-date-nav,
    body.kobit-sticky-bottom-active .kobit-tabs-nav,
    body.kobit-sticky-bottom-active .kobit-sport-tabs-nav {
        position: fixed;
        left: 0;
        right: 0;
        z-index: 9999;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
        transition: transform 0.3s ease, bottom 0.3s ease;
        animation: kobitStickySlideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }

    body.kobit-sticky-bottom-active .kobit-date-nav {
        bottom: 46px; /* Height of tabs approx */
        padding: 6px;
        justify-content: center;
        transform: scale(0.9);
        transform-origin: bottom center;
        width: 111.11%; /* Compensate for 0.9 scale (1/0.9) */
        left: -5.55%;
    }

    body.kobit-sticky-bottom-active .kobit-tabs-nav,
    body.kobit-sticky-bottom-active .kobit-sport-tabs-nav {
        bottom: 0;
        background-color: #fff;
        padding: 0;
        height: 50px; /* Fixed height for tabs */
        align-items: center;
        transform: scale(0.9);
        transform-origin: bottom center;
        width: 111.11%;
        left: -5.55%;
        border-top: 1px solid #eee;
    }

    /* Specific style for Sport Tabs to maintain brand color */
    body.kobit-sticky-bottom-active .kobit-sport-tabs-nav {
        background-color: #0057b8;
        color: #fff;
        border-top: none;
    }

    /* Dark Mode adjustments */
    body.kobit-dark-mode.kobit-sticky-bottom-active .kobit-tabs-nav,
    body.kobit-dark-mode.kobit-sticky-bottom-active .kobit-sport-tabs-nav {
        background-color: #1e1e1e;
        border-top-color: #444;
    }

    /* Restore border for sport tabs in dark mode for better separation */
    body.kobit-dark-mode.kobit-sticky-bottom-active .kobit-sport-tabs-nav {
        border-top: 1px solid #444;
    }
    
    /* Adjust padding to prevent content being hidden behind sticky elements */
    body.kobit-sticky-bottom-active {
        padding-bottom: 100px;
    }

    /* Move floating buttons up when sticky footer is active */
    body.kobit-sticky-bottom-active .kobit-fav-floating-btn {
        bottom: 110px !important;
        transition: bottom 0.3s ease;
    }
    body.kobit-sticky-bottom-active .kobit-my-teams-floating-btn {
        bottom: 175px !important;
        transition: bottom 0.3s ease;
    }

    @keyframes kobitStickySlideUp {
        from {
            transform: translateY(100%) scale(0.9);
            opacity: 0;
        }
        to {
            transform: translateY(0) scale(0.9);
            opacity: 1;
        }
    }
}

/* My Teams Page Floating Button */
.kobit-my-teams-floating-btn {
    position: fixed;
    bottom: 85px; /* 20px (bottom) + 50px (btn height) + 15px (gap) */
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #fff;
    color: #0057b8;
    border: 2px solid #0057b8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none;
}
.kobit-my-teams-floating-btn:hover {
    transform: scale(1.1);
    background-color: #f0f8ff;
}
body.kobit-dark-mode .kobit-my-teams-floating-btn {
    background-color: #1e1e1e;
    color: #4dabf5;
    border-color: #4dabf5;
}
body.kobit-dark-mode .kobit-my-teams-floating-btn:hover {
    background-color: #2c2c2c;
}

/* Floating Button Tooltips */
.kobit-fav-floating-btn::after,
.kobit-my-teams-floating-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px; /* Position to the left of the button */
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.kobit-fav-floating-btn:hover::after,
.kobit-my-teams-floating-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

@keyframes kobitStickySlideUp {
    from {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(0.9);
        opacity: 1;
    }
}
