/* League Performance Styles */
.lp-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
}

.lp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.lp-title-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lp-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0;
}

.lp-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lp-search {
    position: relative;
    display: flex;
    align-items: center;
}

.lp-search i {
    position: absolute;
    left: 12px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.lp-search input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px 8px 32px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    width: 200px;
    transition: border-color 0.2s;
}

.lp-search input:focus {
    border-color: var(--accent-yellow);
}

/* Custom Dropdown */
.lp-custom-dropdown {
    position: relative;
    width: 220px;
}

.lp-dropdown-selected {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.lp-dropdown-selected:hover {
    border-color: var(--accent-yellow);
}

.lp-dropdown-selected i {
    font-size: 11px;
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

.lp-custom-dropdown.open .lp-dropdown-selected i {
    transform: rotate(180deg);
}

.lp-custom-dropdown.open .lp-dropdown-selected {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 2px rgba(var(--accent-yellow-rgb), 0.1);
}

.lp-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    overflow: hidden;
}

.lp-custom-dropdown.open .lp-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lp-dropdown-item {
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
}

.lp-dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.lp-dropdown-item.active {
    background: rgba(var(--accent-yellow-rgb), 0.1);
    color: var(--accent-yellow);
    font-weight: 700;
}

/* Table */
.lp-table-wrapper {
    overflow-x: auto;
}

.lp-table {
    width: 100%;
    border-collapse: collapse;
}

.lp-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.lp-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.lp-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* League cell */
.lp-league-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.lp-league-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.lp-league-info {
    display: flex;
    flex-direction: column;
}

.lp-league-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s;
}

.lp-league-cell:hover .lp-league-name {
    color: var(--accent-yellow);
}

.lp-league-country {
    font-size: 10px;
    color: var(--text-tertiary);
}

/* 1X2 Bar */
.lp-1x2-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lp-1x2-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-tertiary);
}
.lp-1x2-home { background: #3b82f6; }
.lp-1x2-draw { background: #9ca3af; }
.lp-1x2-away { background: #ef4444; }

.lp-1x2-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Value cell (Goals, BTTS, O25) */
.lp-stat-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lp-stat-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.lp-stat-bar-bg {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.lp-stat-bar-fill {
    height: 100%;
    background: var(--accent-green);
    border-radius: 2px;
}

.lp-stat-bar-fill.high { background: #22c55e; }
.lp-stat-bar-fill.med { background: #facc15; }
.lp-stat-bar-fill.low { background: #ef4444; }

/* Match Count Badge */
.lp-match-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    min-width: 32px;
    text-align: center;
}
.lp-match-count.high {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}
.lp-match-count.med {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
}
.lp-match-count.low {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

@media (max-width: 900px) {
    .lp-container {
        border-radius: 8px;
        padding: 14px;
    }

    .lp-header {
        flex-direction: column;
        gap: 14px;
        margin-bottom: 14px;
        padding-bottom: 14px;
    }

    .lp-title {
        font-size: 15px;
        line-height: 1.25;
    }

    .lp-subtitle {
        line-height: 1.45;
    }

    .lp-controls {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
        gap: 10px;
    }

    .lp-search,
    .lp-search input,
    .lp-custom-dropdown {
        width: 100%;
    }

    .lp-search input,
    .lp-dropdown-selected {
        min-height: 40px;
    }
}

@media (max-width: 640px) {
    .lp-container {
        padding: 10px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .lp-container *,
    .lp-container *::before,
    .lp-container *::after {
        min-width: 0;
    }

    .lp-header {
        gap: 12px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .lp-title-container {
        gap: 6px;
    }

    .lp-title {
        align-items: flex-start;
        font-size: 14px;
    }

    .lp-title i {
        margin-top: 2px;
    }

    .lp-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lp-search input {
        padding-top: 10px;
        padding-bottom: 10px;
        font-size: 13px;
    }

    .lp-dropdown-selected {
        padding: 10px 12px;
        font-size: 12px;
    }

    .lp-dropdown-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 72px;
        max-height: min(320px, 55vh);
        overflow-y: auto;
        border-radius: 10px;
        z-index: 1200;
    }

    .lp-dropdown-item {
        min-height: 42px;
        display: flex;
        align-items: center;
        padding: 10px 14px;
    }

    .lp-table-wrapper {
        overflow-x: visible;
    }

    .lp-table,
    .lp-table tbody,
    .lp-table tr,
    .lp-table td {
        display: block;
        width: 100%;
    }

    .lp-table thead {
        display: none;
    }

    .lp-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .lp-table tr {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

    .lp-table tr:hover td {
        background: transparent;
    }

    .lp-table td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .lp-table td:last-child {
        border-bottom: 0;
    }

    .lp-table td:not(:first-child)::before {
        content: "";
        display: block;
        margin-bottom: 7px;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--text-tertiary);
    }

    .lp-table td:nth-child(2)::before { content: "1X2 Match Result"; }
    .lp-table td:nth-child(3)::before { content: "Goals / Match"; }
    .lp-table td:nth-child(4)::before { content: "BTTS"; }
    .lp-table td:nth-child(5)::before { content: "Over 1.5"; }
    .lp-table td:nth-child(6)::before { content: "Over 2.5"; }
    .lp-table td:nth-child(7)::before { content: "Over 3.5"; }
    .lp-table td:nth-child(8)::before { content: "Matches Played"; }

    .lp-table td[colspan]::before {
        display: none;
    }

    .lp-league-cell {
        gap: 10px;
    }

    .lp-league-flag {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
    }

    .lp-league-info {
        min-width: 0;
    }

    .lp-league-name,
    .lp-league-country {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lp-league-name {
        font-size: 13px;
        line-height: 1.25;
    }

    .lp-1x2-wrap,
    .lp-stat-cell {
        gap: 7px;
    }

    .lp-1x2-bar {
        height: 8px;
        border-radius: 999px;
    }

    .lp-1x2-labels {
        gap: 8px;
        flex-wrap: wrap;
        font-size: 10px;
        line-height: 1.2;
    }

    .lp-stat-cell {
        display: grid;
        grid-template-columns: 54px minmax(0, 1fr);
        align-items: center;
    }

    .lp-stat-val {
        font-size: 13px;
        font-weight: 800;
    }

    .lp-stat-bar-bg {
        height: 7px;
        border-radius: 999px;
    }

    #lp-loading {
        padding: 12px 0 !important;
    }

    #lp-load-more-container {
        padding: 14px 0 6px !important;
    }

    #lp-load-more-btn {
        width: 100%;
        min-height: 42px;
    }
}

@media (max-width: 380px) {
    .lp-container {
        padding: 8px;
    }

    .lp-title {
        font-size: 13px;
    }

    .lp-table td {
        padding: 9px 10px;
    }

    .lp-1x2-labels {
        justify-content: flex-start;
    }

    .lp-stat-cell {
        grid-template-columns: 48px minmax(0, 1fr);
    }
}
