:root {
    /* Theme Variables */
    --font-family-base: 'Segoe UI', sans-serif;

    /* Grayscale & Common */
    --color-text: #777;
    --color-muted: #666;
    --color-light-bg: #f9f9f9;
    --color-white: #fff;
    --color-dark: #222;
    --color-border: #ccc;
    --color-shadow: rgba(0, 0, 0, 0.1);

    /* Primary & Accent */
    --color-primary: #c3002f;
    --color-header-bg: #003366;
    --color-hover-bg: #f0f8ff;

    /* Status Colors */
    --color-live: #d9534f;
    --color-finished: #5cb85c;
    --color-upcoming: #f0ad4e;

    /* Team Colors */
    --color-blue-team: #337ab7;
    --color-red-team: #d9534f;
}

/* --- Base Styling --- */
.betsapi-widget {
    color: var(--color-text) !important;
}

.league-container {
    max-width: 100%;
    margin: 20px auto;
    padding: 0;
    /*15px*/
    background: var(--color-light-bg);
    border-radius: 8px;
    font-family: var(--font-family-base);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.layout-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px;
}

.block {
    background: var(--color-light-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--color-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.league-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--color-white);
    background: var(--color-primary);
    padding: 10px;
    border-radius: 6px 6px 0 0;
}

.match {
    padding: 20px;
    background: var(--color-white);
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.3s;
}

.match:hover {
    background: var(--color-hover-bg);
}

.teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.team {
    flex: 1 1 25%;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
}

.score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-dark);
    flex: 1 1 40%;
    min-width: 100px;
}

.score img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    border-radius: 50%;
    background: var(--color-white);
    border: 1px solid var(--color-border);
}

.status {
    margin-top: 5px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--color-muted);
}

.status-date {
    color: var(--color-dark)
}

.status.live {
    color: var(--color-live);
    font-weight: bold;
}

.status.finished {
    color: var(--color-finished);
}

.status.upcoming {
    color: var(--color-upcoming);
}

.half-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.half-block {
    flex: 0 0 48%;
    background: var(--color-light-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--color-shadow);
}

.half-header {
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 1.2rem;
    padding: 10px;
    text-align: center;
    border-radius: 6px 6px 0 0;
}

.half-content {
    display: flex;
    flex-direction: column;
}

.half-row {
    padding: 12px 15px;
    border-bottom: 1px solid var(--color-border);
}

.half-row:last-child {
    border-bottom: none;
}

.half-row.three-cols {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.half-row.three-cols>div {
    flex: 1;
    text-align: center;
}

.match-row {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
}

.match-row:last-child {
    border-bottom: none;
}

.colz {
    font-size: 0.95rem;
    color: #333;
}

.result-badge {
    font-weight: bold;
    color: var(--color-white);
    text-align: center;
    border-radius: 4px;
    padding: 4px 8px;
    min-width: 24px;
    display: inline-block;
}

.result-badge.win {
    background-color: var(--color-finished);
}

.result-badge.loss {
    background-color: var(--color-live);
}

.result-badge.draw {
    background-color: var(--color-upcoming);
}

.team.blue {
    color: var(--color-blue-team);
}

.team.red {
    color: var(--color-red-team);
}

/* 📌 League Table Styles */
.league-table-container {
    background: var(--color-light-bg);
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 8px var(--color-shadow);
    margin-bottom: 20px;
    padding: 0;
    /*20px*/
}

.league-table-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--color-white);
    background: var(--color-primary);
    padding: 10px;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
}

.league-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background: var(--color-white);
}

.league-table thead {
    background-color: var(--color-header-bg);
    color: var(--color-white);
}

.league-table th,
.league-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.95rem;
}

.league-table td.team-name {
    text-align: left;
    font-weight: 600;
    color: #333;
}

.league-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.league-table tbody tr:hover {
    background-color: var(--color-hover-bg);
}

/* 📱 Responsive */
@media (max-width: 768px) {
    .half-block {
        flex: 0 0 100%;
    }

    .match-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "fixture"
            "league"
            "date"
            "result"
            "score";
        text-align: center;
    }

    .col.league {
        grid-area: league;
    }

    .col.date {
        grid-area: date;
    }

    .col.fixture {
        grid-area: fixture;
    }

    .col.result-badge {
        grid-area: result;
    }

    .col.score {
        grid-area: score;
    }

    .col {
        margin-bottom: 6px;
    }

    .teams {
        flex-direction: column;
        align-items: center;
    }

    .team,
    .score {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }

    .score {
        font-size: 1.1rem;
    }

    .score img {
        width: 28px;
        height: 28px;
    }

    .half-row.three-cols {
        flex-direction: column;
        text-align: center;
    }

    .half-row.three-cols>div {
        margin-bottom: 6px;
    }

    .league-table {
        font-size: 0.85rem;
        min-width: 600px;
    }

    .league-table-container {
        overflow-x: auto;
    }
}

.bapi-tabs .tabs-wrapper {
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    margin-bottom: 30px;
    overflow: hidden;
}

.bapi-tabs .tab-buttons {
    display: flex;
    justify-content: center;
    background: #eee;
    padding: 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.bapi-tabs .tab-buttons button {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 0 1px #ccc;
}

.bapi-tabs .tab-buttons button:hover {
    background: #e8e8e8;
    border-color: #c3002f;
}

.bapi-tabs .tab-buttons button.active {
    background: #c3002f;
    color: #fff;
    border-color: #c3002f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bapi-tabs .tab-content {
    display: none;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #ccc;
    border-radius: 0 0 12px 12px;
}

.bapi-tabs .tab-content.active {
    display: block;
}

/* ==== Refined Full-Width Player Profile Styles ==== */

.player-profile-widget {
    /* max-width: 900px;*/
    /* Limit width on large screens */
    margin: 20px auto;
    /* Center horizontally */
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    color: #222;
    display: flex;
    flex-direction: column;
}

.player-profile-title {
    background-color: #c3002f;
    color: #fff;
    font-weight: 700;
    font-size: 1.8rem;
    text-align: center;
    padding: 15px 0;
    border-radius: 10px 10px 0 0;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.player-header {
    display: flex;
    align-items: center;
    padding: 30px 40px;
    gap: 40px;
    /* More breathing space between image and text */
    border-bottom: 3px solid #c3002f;
    background: #fafafa;
    /* Lighter background for subtle contrast */
    flex-wrap: nowrap;
    /* No wrap on large screens */
}

.player-header img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #c3002f;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(195, 0, 47, 0.4);
    flex-shrink: 0;
}

.player-header h2 {
    font-size: 2rem;
    font-weight: 900;
    color: #111;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(195, 0, 47, 0.4);
    flex-grow: 1;
    max-width: 600px;
    /* Prevent heading stretching too wide */
}

/* Player Info Section */
.player-info {
    padding: 30px 40px;
    background: #fff;
    font-size: 1.1rem;
    line-height: 1.6;
    display: block;
}

.player-info p {
    background: #fdf6f8;
    /* Very light pinkish background */
    border-radius: 6px;
    padding: 12px 15px;
    margin: 0 0 8px 0;
    /* Consistent spacing between lines */
    font-weight: 500;
    color: #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: inset 0 0 6px rgba(195, 0, 47, 0.05);
}

.player-info p strong {
    color: #c3002f;
    min-width: 140px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.player-info p span {
    flex: 1;
    text-align: right;
    color: #333;
}

/* Shirt number styling */
.player-info .shirt-number {
    font-weight: 700;
    color: #555;
    margin-left: 5px;
}

/* Two-column layout for player info on larger screens */
@media (min-width: 720px) {
    .player-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px 40px;
    }

    .player-info p {
        justify-content: flex-start;
    }

    .player-info p strong {
        min-width: 100px;
    }

    .player-info p span {
        text-align: left;
    }
}

/* Responsive for smaller screens */
@media (max-width: 768px) {
    .player-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 20px;
        flex-wrap: wrap;
        /* Allow wrapping */
    }

    .player-header img {
        margin-bottom: 15px;
    }

    .player-header h2 {
        font-size: 1.6rem;
        max-width: 100%;
    }

    .player-info {
        padding: 20px;
        display: block;
    }

    .player-info p {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        box-shadow: none;
        background: transparent;
        padding: 6px 0;
        margin-bottom: 6px;
    }

    .player-info p strong {
        margin-bottom: 4px;
    }

    .player-info p span {
        text-align: left;
    }
}


/* Transfer Widget Wrapper */
.player-transfer-widget {
    /*max-width: 900px;*/
    margin: 20px auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #222;
}

/* Section Header */
.league-title {
    background-color: #c3002f;
    color: #fff;
    font-weight: 700;
    font-size: 1.8rem;
    padding: 15px 0;
    text-align: center;
    border-radius: 10px 10px 0 0;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Table Wrapper */
.transfers-table-wrapper {
    padding: 0 20px 20px;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

/* Transfer Table */
.transfers-table {
    width: 95%;
    border-collapse: collapse;
    font-size: 1rem;
    table-layout: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Table Header */
.transfers-table thead {
    background-color: var(--color-header-bg);
    color: #fff;
}

.transfers-table th,
.transfers-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.transfers-table th {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Team Cell Content */
.team-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.team-logo {
    border-radius: 50%;
    border: 2px solid #c3002f;
    box-shadow: 0 0 6px rgba(195, 0, 47, 0.5);
    object-fit: cover;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.team-name {
    font-weight: 700;
    color: #c3002f;
    white-space: normal;
    word-break: break-word;
}

.country-flag {
    border-radius: 3px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    width: 20px;
    height: 14px;
}

.date-cell {
    color: #555;
    white-space: nowrap;
}

.active-cell {
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.type-cell {
    font-style: italic;
    color: #666;
    white-space: nowrap;
}

/* Highlight current club */
.active-transfer {
    background-color: #fff0f1;
    font-weight: 700;
    box-shadow: inset 5px 0 0 0 #c3002f;
}

/* Hover row effect */
.transfers-table tbody tr:hover {
    background-color: #f9e6ea;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
    .transfers-table-wrapper {
        padding: 0 10px 20px;
        overflow-x: visible !important;
        max-width: 100%;
    }

    .transfers-table {
        width: 91%;
        display: block;
    }

    .transfers-table thead {
        background-color: var(--color-header-bg);
        display: none;
    }

    .transfers-table tbody,
    .transfers-table tr {
        display: block;
        width: 100%;
    }

    .transfers-table tr {
        margin-bottom: 20px;
        border-radius: 10px;
        background: #fff0f1;
        box-shadow: 0 0 10px rgba(195, 0, 47, 0.2);
        padding: 15px;
        font-weight: 600;
    }

    .transfers-table tr.active-transfer {
        background: #ffd7db;
        box-shadow: 0 0 15px rgba(195, 0, 47, 0.5);
    }

    .transfers-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #ddd;
        position: relative;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal !important;
    }

    .transfers-table td:last-child {
        border-bottom: none;
    }

    .transfers-table td::before {
        flex-shrink: 0;
        width: 100px;
        font-weight: 700;
        color: #c3002f;
        padding-right: 10px;
        white-space: normal;
    }

    .transfers-table td.team-cell::before {
        content: "Team";
    }

    .transfers-table td.date-cell:nth-of-type(2)::before {
        content: "Start Date";
    }

    .transfers-table td.date-cell:nth-of-type(3)::before {
        content: "End Date";
    }

    .transfers-table td.active-cell::before {
        content: "Active";
    }

    .transfers-table td.type-cell::before {
        content: "Role/Type";
    }

    .team-cell {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
        word-break: break-word;
        white-space: normal;
    }

    .team-name {
        font-size: 1.1rem;
        word-break: break-word;
        white-space: normal;
    }

    .team-logo {
        width: 40px !important;
        height: 40px !important;
        border-width: 3px;
    }

    .type-cell {
        display: none;
        /* hide less important column */
    }
}

/* Player Matches */
/* Player Match Table Entry Layout */
.player-matches-table .match-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: 0;
}

/* Team logo wrapper */
.player-matches-table .team-img {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.player-matches-table .team-img img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-border);
}

/* Soccer ball icon */
.player-matches-table .team-img.with-icon {
    padding-left: 5px;
}

.player-matches-table .team-img .ball-icon {
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-primary);
    background: #fff;
    border-radius: 50%;
    padding: 2px;
}

/* Score styling */
.player-matches-table .score {
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-dark);
    padding: 0;
    min-width: 0;
}

/* Make match column wider */
.player-matches-table td.match-col {
    min-width: 0;
}

/* Responsive - stack only on small screens */
@media (max-width: 768px) {
    .player-matches-table .match-entry {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .player-matches-table .team-img img {
        width: 24px;
        height: 24px;
    }

    .player-matches-table .team-img .ball-icon {
        font-size: 0.65rem;
        left: -8px;
    }

    .player-matches-table td.match-col {
        min-width: 100%;
    }
}

/* ======================================
   🧩 DYNAMIC CONTENT THEME (betsapi-widget)
   Applies to: $data / player-content-widget
====================================== */
/* Dynamic safe content inside player-content-widget */
.betsapi-widget .player-content-widget {
    background: #ffffff;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    font-family: var(--font-family-base);
    color: var(--color-dark);
    overflow-wrap: break-word;
}

/* Headers */
.betsapi-widget .player-content-widget h1,
.betsapi-widget .player-content-widget h2,
.betsapi-widget .player-content-widget h3 {
    color: var(--color-primary);
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 6px;
}

.betsapi-widget .player-content-widget h1 {
    font-size: 1.6rem;
}

.betsapi-widget .player-content-widget h2 {
    font-size: 1.4rem;
}

.betsapi-widget .player-content-widget h3 {
    font-size: 1.2rem;
}

/* Paragraphs */
.betsapi-widget .player-content-widget p {
    margin-bottom: 14px;
    color: var(--color-dark);
    font-size: 1rem;
    line-height: 1.6;
}

/* Lists */
.betsapi-widget .player-content-widget ul,
.betsapi-widget .player-content-widget ol {
    margin: 12px 0 20px;
    padding-left: 20px;
}

.betsapi-widget .player-content-widget li {
    margin-bottom: 8px;
}

/* Tables */
.betsapi-widget .player-content-widget table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.betsapi-widget .player-content-widget table th,
.betsapi-widget .player-content-widget table td {
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    text-align: left;
}

.betsapi-widget .player-content-widget table th {
    background: var(--color-header-bg);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
}

/* Blockquotes */
.betsapi-widget .player-content-widget blockquote {
    border-left: 4px solid var(--color-primary);
    background: #fdf6f8;
    padding: 14px 18px;
    font-style: italic;
    color: var(--color-muted);
    margin: 20px 0;
    border-radius: 8px;
}

/* Inline styles */
.betsapi-widget .player-content-widget strong {
    font-weight: bold;
    color: #111;
}

.betsapi-widget .player-content-widget em {
    font-style: italic;
    color: var(--color-muted);
}

/* Responsive table fallback */
@media (max-width: 768px) {
    .betsapi-widget .player-content-widget table {
        display: block;
        overflow-x: auto;
        font-size: 0.95rem;
    }
}