/* ================================================================
   WP GOAL PLUGIN — Next-Gen Responsive Sports Interface Design
   Design System: Modern Glassmorphism, Dynamic Typography & Responsive Layouts
   Compatible with ALL WordPress Themes (Light & Dark Auto-Adapt)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Outfit:wght@600;800;900&display=swap');

.wp-goal-wrap {
    /* Color Palette Design Tokens (Tailored HSL System) */
    --wpg-font: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --wpg-num-font: 'Outfit', 'Cairo', sans-serif;
    
    /* Default Dynamic Theme (Light Canvas) */
    --wpg-bg-main: #f8fafc;
    --wpg-bg-card: #ffffff;
    --wpg-bg-card-hover: #ffffff;
    --wpg-bg-subtle: #f1f5f9;
    --wpg-bg-subtle-hover: #e2e8f0;
    --wpg-bg-accent: rgba(14, 165, 233, 0.08);
    
    --wpg-text-main: #0f172a;
    --wpg-text-muted: #475569;
    --wpg-text-light: #64748b;
    
    --wpg-border: #e2e8f0;
    --wpg-border-subtle: #f1f5f9;
    --wpg-border-focus: #38bdf8;
    
    --wpg-primary: #0284c7;
    --wpg-primary-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --wpg-primary-hover: #0369a1;
    --wpg-primary-light: #e0f2fe;
    
    --wpg-success: #10b981;
    --wpg-success-bg: rgba(16, 185, 129, 0.1);
    --wpg-warning: #f59e0b;
    --wpg-warning-bg: rgba(245, 158, 11, 0.1);
    --wpg-danger: #ef4444;
    --wpg-danger-bg: rgba(239, 68, 68, 0.1);
    --wpg-live: #dc2626;
    
    --wpg-radius-xl: 20px;
    --wpg-radius-lg: 16px;
    --wpg-radius-md: 12px;
    --wpg-radius-sm: 8px;
    
    --wpg-shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --wpg-shadow-md: 0 4px 14px -2px rgba(0,0,0,0.06), 0 2px 6px -1px rgba(0,0,0,0.03);
    --wpg-shadow-lg: 0 12px 28px -4px rgba(0,0,0,0.1), 0 4px 10px -2px rgba(0,0,0,0.04);
    --wpg-shadow-glow: 0 0 20px rgba(14, 165, 233, 0.15);
    
    /* Core Scoped Resets */
    font-family: var(--wpg-font);
    background-color: var(--wpg-bg-main);
    color: var(--wpg-text-main);
    direction: rtl;
    text-align: right;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Force dark mode compatibility if parent container or body is dark */
body.dark-theme .wp-goal-wrap,
body.dark .wp-goal-wrap,
[data-theme="dark"] .wp-goal-wrap,
.dark-mode .wp-goal-wrap {
    --wpg-bg-main: #0b1329;
    --wpg-bg-card: #111c38;
    --wpg-bg-card-hover: #162447;
    --wpg-bg-subtle: #1b294a;
    --wpg-bg-subtle-hover: #24355e;
    --wpg-bg-accent: rgba(56, 189, 248, 0.12);
    
    --wpg-text-main: #f8fafc;
    --wpg-text-muted: #94a3b8;
    --wpg-text-light: #64748b;
    
    --wpg-border: #1e2d4a;
    --wpg-border-subtle: #16233d;
    --wpg-border-focus: #38bdf8;
    
    --wpg-primary: #38bdf8;
    --wpg-primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --wpg-primary-hover: #7dd3fc;
    --wpg-primary-light: rgba(56, 189, 248, 0.15);
    
    --wpg-shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --wpg-shadow-md: 0 6px 16px rgba(0,0,0,0.35);
    --wpg-shadow-lg: 0 14px 32px rgba(0,0,0,0.5);
    --wpg-shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);
}

.wp-goal-wrap *, 
.wp-goal-wrap *::before, 
.wp-goal-wrap *::after { 
    box-sizing: border-box; 
}

.wp-goal-wrap a { 
    color: inherit; 
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Glass Card Base Component ---- */
.g-card {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--wpg-shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.g-card:hover {
    box-shadow: var(--wpg-shadow-md);
    border-color: var(--wpg-border-focus);
}

/* ---- Entity Hero Header ---- */
.ent-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(135deg, var(--wpg-bg-card) 0%, var(--wpg-bg-subtle) 100%);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-xl);
    position: relative;
    overflow: hidden;
    box-shadow: var(--wpg-shadow-md);
}

.ent-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--wpg-primary-gradient);
}

.ent-logo {
    flex-shrink: 0;
}

.ent-logo img { 
    max-height: 95px; 
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.12));
    transition: transform 0.3s ease;
}

.ent-logo img:hover {
    transform: scale(1.06);
}

.ent-info {
    flex-grow: 1;
}

.ent-info h1 {
    font-size: 28px; 
    font-weight: 900; 
    margin: 0 0 10px;
    color: var(--wpg-text-main);
    line-height: 1.25;
    letter-spacing: -0.5px;
}

.ent-meta { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}

.ent-meta span {
    background: var(--wpg-bg-card); 
    padding: 6px 16px;
    border-radius: 20px; 
    border: 1px solid var(--wpg-border);
    font-size: 13px; 
    font-weight: 700; 
    color: var(--wpg-text-muted);
    box-shadow: var(--wpg-shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---- Tabs Navigation ---- */
.g-tabs { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 24px; 
    overflow-x: auto; 
    border-bottom: 2px solid var(--wpg-border); 
    padding-bottom: 8px; 
    scrollbar-width: none; 
}

.g-tabs::-webkit-scrollbar { display: none; }

.g-tab {
    background: transparent; 
    border: none; 
    color: var(--wpg-text-muted);
    padding: 10px 24px; 
    font-size: 15px; 
    font-weight: 800;
    cursor: pointer; 
    border-radius: var(--wpg-radius-md); 
    white-space: nowrap; 
    transition: all 0.25s ease;
    font-family: var(--wpg-font);
}

.g-tab:hover { 
    color: var(--wpg-text-main); 
    background: var(--wpg-bg-subtle); 
}

.g-tab.active { 
    color: var(--wpg-primary); 
    background: var(--wpg-primary-light); 
    font-weight: 900;
}

.g-tab-panel { display: none; }
.g-tab-panel.active { 
    display: block; 
    animation: wpgFadeUp 0.35s ease-out; 
}

@keyframes wpgFadeUp { 
    from { opacity: 0; transform: translateY(8px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ---- Standings Table (Fully Responsive) ---- */
.st-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--wpg-radius-md);
    -webkit-overflow-scrolling: touch;
}

.st-table { 
    width: 100%; 
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.st-table th, 
.st-table td { 
    padding: 14px 12px; 
    text-align: center; 
    border-bottom: 1px solid var(--wpg-border); 
}

.st-table th { 
    background: var(--wpg-bg-subtle);
    color: var(--wpg-text-muted); 
    font-size: 12px; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

.st-table tr:last-child td {
    border-bottom: none;
}

.st-table td { 
    font-size: 14px; 
    font-weight: 700; 
    color: var(--wpg-text-main);
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.st-table tr:hover td { 
    background-color: var(--wpg-bg-subtle); 
}

.st-team { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    text-align: right !important; 
    font-family: var(--wpg-font);
}

.st-team img { 
    width: 30px; 
    height: 30px; 
    object-fit: contain; 
}

.st-team a { 
    color: var(--wpg-text-main); 
    font-weight: 800; 
}

.st-team a:hover { 
    color: var(--wpg-primary); 
}

.st-pos { 
    font-weight: 900; 
    width: 36px; 
    color: var(--wpg-text-muted); 
}

.st-pts { 
    font-weight: 900; 
    color: var(--wpg-primary); 
    font-size: 16px; 
}

/* ---- Match List & Scoreboard Cards ---- */
.m-list { 
    display: flex; 
    flex-direction: column; 
    gap: 14px; 
}

.m-card {
    display: grid; 
    grid-template-columns: 1fr auto 1fr;
    align-items: center; 
    padding: 16px 20px;
    background: var(--wpg-bg-card); 
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-md); 
    transition: all 0.25s ease;
}

.m-card:hover { 
    border-color: var(--wpg-primary); 
    box-shadow: var(--wpg-shadow-md); 
    transform: translateY(-2px); 
}

.m-team { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-weight: 800; 
    font-size: 15px; 
    color: var(--wpg-text-main); 
}

.m-team img { 
    width: 36px; 
    height: 36px; 
    object-fit: contain; 
    flex-shrink: 0;
}

.m-team.home { justify-content: flex-end; }
.m-team.away { justify-content: flex-start; }

.m-team a:hover { color: var(--wpg-primary); }

.m-center { 
    text-align: center; 
    padding: 0 16px; 
}

.m-score {
    display: inline-block; 
    padding: 6px 18px; 
    border-radius: var(--wpg-radius-sm);
    font-size: 20px; 
    font-weight: 900; 
    letter-spacing: 1px;
    background: var(--wpg-bg-subtle); 
    border: 1px solid var(--wpg-border);
    color: var(--wpg-text-main); 
    font-family: var(--wpg-num-font), var(--wpg-font);
    transition: all 0.2s ease;
}

.m-score:hover { 
    background: var(--wpg-primary); 
    color: #ffffff; 
    border-color: var(--wpg-primary); 
}

.m-time { 
    font-size: 12px; 
    color: var(--wpg-text-muted); 
    margin-top: 6px; 
    font-weight: 700; 
}

.live-badge { 
    background: var(--wpg-danger); 
    color: #ffffff; 
    padding: 3px 10px; 
    border-radius: 20px; 
    font-size: 11px; 
    font-weight: 900; 
    display: inline-block;
    animation: wpgPulse 2s infinite; 
}

@keyframes wpgPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---- Match Detail Header ---- */
.m-match-header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    width: 100%;
    text-align: center;
}

.big-score { 
    font-size: 48px; 
    font-weight: 900; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 16px; 
    color: var(--wpg-text-main); 
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.big-score .sep { 
    font-size: 24px; 
    color: var(--wpg-text-muted); 
}

.status-pill {
    display: inline-block; 
    padding: 6px 20px; 
    border-radius: 20px;
    font-weight: 800; 
    font-size: 14px; 
    color: var(--wpg-primary);
    background: var(--wpg-primary-light); 
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.match-team-link { 
    text-decoration: none; 
    color: var(--wpg-text-main); 
    text-align: center; 
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, color 0.2s ease; 
}

.match-team-link:hover { 
    color: var(--wpg-primary); 
    transform: translateY(-3px); 
}

.match-team-link img { 
    max-height: 80px; 
    width: auto;
    display: block; 
    margin: 0 auto; 
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08)); 
}

.match-team-link h3 { 
    margin-top: 12px; 
    font-size: 18px; 
    font-weight: 900; 
}

/* ---- Squad & Player Grid ---- */
.sq-title { 
    color: var(--wpg-primary); 
    font-size: 18px; 
    margin-bottom: 16px; 
    border-right: 4px solid var(--wpg-primary); 
    padding-right: 12px; 
    font-weight: 900; 
}

.sq-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); 
    gap: 16px; 
    margin-bottom: 28px; 
}

.sq-card {
    background: var(--wpg-bg-card); 
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-md); 
    padding: 16px 10px; 
    text-align: center;
    transition: all 0.25s ease; 
    display: block; 
    color: var(--wpg-text-main);
    box-shadow: var(--wpg-shadow-sm);
}

.sq-card:hover { 
    border-color: var(--wpg-primary); 
    transform: translateY(-4px); 
    box-shadow: var(--wpg-shadow-md); 
}

.sq-card img { 
    width: 65px; 
    height: 65px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 3px solid var(--wpg-bg-subtle); 
    margin: 0 auto 10px; 
    display: block; 
}

.sq-card .name { 
    font-weight: 800; 
    font-size: 13px; 
    line-height: 1.3;
}

.sq-card .num { 
    font-size: 12px; 
    color: var(--wpg-text-muted); 
    margin-top: 6px; 
    font-weight: 700; 
    background: var(--wpg-bg-subtle); 
    display: inline-block; 
    padding: 2px 8px; 
    border-radius: 10px; 
    font-family: var(--wpg-num-font), var(--wpg-font);
}

/* ---- Player Profile ---- */
.player-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 24px; 
}

.player-photo { 
    text-align: center; 
    padding: 20px; 
}

.player-photo img {
    width: 130px; 
    height: 130px; 
    border-radius: 50%;
    border: 4px solid var(--wpg-primary); 
    box-shadow: var(--wpg-shadow-md);
    margin-bottom: 16px;
    object-fit: cover;
}

.p-stat-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
    gap: 16px; 
}

.p-stat { 
    background: var(--wpg-bg-card); 
    border: 1px solid var(--wpg-border); 
    border-radius: var(--wpg-radius-md); 
    padding: 16px; 
    text-align: center; 
    box-shadow: var(--wpg-shadow-sm); 
}

.p-stat .val { 
    font-size: 26px; 
    font-weight: 900; 
    color: var(--wpg-primary); 
    margin-bottom: 2px; 
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.p-stat .lbl { 
    font-size: 13px; 
    color: var(--wpg-text-muted); 
    font-weight: 700; 
}

/* ---- Timeline (Events) ---- */
.timeline { 
    position: relative; 
    padding-right: 28px; 
    border-right: 2px solid var(--wpg-border); 
    margin-right: 12px; 
}

.tl-item { 
    margin-bottom: 20px; 
    position: relative; 
}

.tl-dot {
    position: absolute; 
    right: -40px; 
    top: 2px;
    width: 24px; 
    height: 24px; 
    border-radius: 50%;
    background: var(--wpg-bg-card); 
    border: 2px solid var(--wpg-primary);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 12px;
    box-shadow: var(--wpg-shadow-sm);
}

.tl-time { 
    font-size: 13px; 
    font-weight: 900; 
    color: var(--wpg-primary); 
    margin-bottom: 2px; 
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.tl-desc { 
    color: var(--wpg-text-main); 
    font-weight: 800; 
    font-size: 14px; 
}

.tl-desc .team-tag { 
    font-size: 12px; 
    color: var(--wpg-text-muted); 
    font-weight: 600; 
}

/* ---- Stats Bars ---- */
.stat-rows { 
    display: flex; 
    flex-direction: column; 
    gap: 18px; 
}

.stat-row-info { 
    display: flex; 
    justify-content: space-between; 
    font-weight: 800; 
    font-size: 14px; 
    margin-bottom: 6px; 
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.stat-bar-wrap { 
    display: flex; 
    height: 10px; 
    background: var(--wpg-bg-subtle); 
    border-radius: 5px; 
    overflow: hidden; 
    border: 1px solid var(--wpg-border); 
}

.stat-bar-h { 
    background: var(--wpg-primary); 
    transition: width 0.8s ease; 
}

.stat-bar-sep { 
    width: 2px; 
    background: var(--wpg-bg-card); 
}

.stat-bar-a { 
    background: var(--wpg-danger); 
    transition: width 0.8s ease; 
}

/* ---- No Data Box ---- */
.no-data { 
    text-align: center; 
    color: var(--wpg-text-muted); 
    padding: 32px 20px; 
    font-style: italic; 
    font-weight: 600; 
    background: var(--wpg-bg-subtle); 
    border-radius: var(--wpg-radius-md); 
}

/* Base Headings */
h2, h3, h4 { color: var(--wpg-text-main); font-weight: 900; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

/* ================================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ================================================================ */

/* Mobile Small (< 480px) */
@media (max-width: 480px) {
    .wp-goal-wrap {
        padding: 12px 10px;
    }
    .g-card {
        padding: 16px 12px;
        border-radius: var(--wpg-radius-md);
    }
    .ent-header {
        padding: 20px 14px;
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
    .ent-logo img {
        max-height: 75px;
    }
    .ent-info h1 {
        font-size: 22px;
    }
    .ent-meta {
        justify-content: center;
    }
    .m-match-header-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .m-card {
        padding: 14px 10px;
        grid-template-columns: 1fr auto 1fr;
    }
    .m-team {
        font-size: 13px;
        gap: 6px;
    }
    .m-team img {
        width: 26px;
        height: 26px;
    }
    .m-score {
        padding: 4px 12px;
        font-size: 16px;
    }
    .big-score {
        font-size: 32px;
        gap: 10px;
    }
    .sq-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
    .sq-card {
        padding: 12px 8px;
    }
    .sq-card img {
        width: 50px;
        height: 50px;
    }
    .timeline {
        padding-right: 20px;
        margin-right: 8px;
    }
    .tl-dot {
        right: -31px;
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Tablet (>= 768px) */
@media (min-width: 768px) {
    .wp-goal-wrap { padding: 32px 24px; }
    .ent-info h1 { font-size: 32px; }
    .sq-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Desktop (>= 1024px) */
@media (min-width: 1024px) {
    .wp-goal-wrap { 
        padding: 40px; 
        max-width: 1320px; 
    }
    
    .desktop-2col { 
        display: grid; 
        grid-template-columns: 7fr 3fr; 
        gap: 28px; 
        align-items: start; 
    }
    
    .desktop-2col-eq { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 28px; 
        align-items: start; 
    }
    
    .player-grid { 
        grid-template-columns: 280px 1fr; 
    }
}

/* ================================================================
   TEAM PAGE REFERENCE DESIGN STYLES
   ================================================================ */

.wpg-team-header-card {
    padding: 24px;
    background: linear-gradient(135deg, var(--wpg-bg-card) 0%, var(--wpg-bg-subtle) 100%);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wpg-team-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpg-follow-btn {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    color: var(--wpg-text-main);
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--wpg-shadow-sm);
    transition: all 0.2s ease;
}

.wpg-follow-btn:hover {
    background: var(--wpg-primary);
    color: #ffffff;
    border-color: var(--wpg-primary);
}

.wpg-team-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wpg-team-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--wpg-border);
    padding-bottom: 0;
}

.wpg-team-tabs .g-tab {
    border-radius: 0;
    border-bottom: 3px solid transparent;
    padding: 10px 18px;
    font-size: 15px;
}

.wpg-team-tabs .g-tab.active {
    background: transparent;
    border-bottom-color: #10b981;
    color: #10b981;
}

/* Squad List Rows (Ref Design) */
.wpg-squad-section {
    margin-bottom: 24px;
}

.wpg-squad-group-header {
    background: var(--wpg-bg-subtle);
    padding: 10px 16px;
    border-radius: var(--wpg-radius-sm);
    font-size: 15px;
    font-weight: 900;
    color: var(--wpg-text-main);
    margin-bottom: 10px;
}

.wpg-squad-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpg-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-md);
    transition: all 0.2s ease;
}

.wpg-player-row:hover {
    border-color: var(--wpg-primary);
    transform: translateX(-4px);
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-p-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpg-p-badge {
    background: var(--wpg-bg-subtle);
    border: 1px solid var(--wpg-border);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--wpg-primary);
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.wpg-p-role {
    font-size: 13px;
    color: var(--wpg-text-muted);
    font-weight: 700;
}

.wpg-p-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpg-p-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--wpg-text-main);
}

.wpg-p-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--wpg-bg-subtle);
}

/* Sidebar Matches List Cards (Ref Design) */
.wpg-sidebar-matches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpg-side-match-card {
    background: var(--wpg-bg-subtle);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-md);
    overflow: hidden;
}

.wpg-sm-header {
    background: rgba(0, 0, 0, 0.03);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 800;
    color: var(--wpg-text-muted);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--wpg-border);
}

.wpg-sm-body {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.wpg-sm-body .team-name {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpg-sm-body .team-name.home {
    text-align: left;
}

.wpg-sm-body .team-name.away {
    text-align: right;
}

.sm-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.sm-time-badge, .sm-score-badge {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 900;
    color: var(--wpg-text-main);
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.sm-score-badge {
    background: var(--wpg-primary);
    color: #ffffff;
    border-color: var(--wpg-primary);
}


/* ================================================================
   MATCHES WIDGET SHORTCODE STYLES [wp_goal_matches]
   ================================================================ */

.wpg-shortcode-matches-wrapper {
    position: relative;
    transition: opacity 0.3s ease;
}

.wpg-shortcode-matches-wrapper.wpg-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Date Navigator Bar */
.wpg-date-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-lg);
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-nav-title {
    font-size: 20px;
    font-weight: 900;
    color: #10b981;
}

.wpg-date-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    direction: ltr;
}

.wpg-date-arrow {
    background: var(--wpg-bg-subtle);
    border: 1px solid var(--wpg-border);
    color: var(--wpg-text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpg-date-arrow:hover {
    background: var(--wpg-primary);
    color: #ffffff;
    border-color: var(--wpg-primary);
}

.wpg-date-display {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wpg-bg-subtle);
    border: 1px solid var(--wpg-border);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
    color: var(--wpg-text-main);
    cursor: pointer;
    direction: rtl;
}

.wpg-date-picker-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Tournament Block */
.wpg-tournament-block {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-tournament-header {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.dark-theme .wpg-tournament-header,
body.dark .wpg-tournament-header,
[data-theme="dark"] .wpg-tournament-header {
    background: #0f172a;
}

.wpg-t-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpg-t-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.wpg-t-name {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff !important;
}

.wpg-t-name:hover {
    color: #38bdf8 !important;
}

/* Matches List inside Tournament Block */
.wpg-tournament-matches {
    display: flex;
    flex-direction: column;
}

.wpg-match-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--wpg-border);
    transition: background 0.2s ease;
}

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

.wpg-match-row:hover {
    background: var(--wpg-bg-subtle);
}

.wpg-m-team {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 15px;
    color: var(--wpg-text-main);
}

.wpg-m-team.home {
    justify-content: flex-end;
}

.wpg-m-team.away {
    justify-content: flex-start;
}

.wpg-m-team .team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.wpg-m-team .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpg-m-team:hover {
    color: var(--wpg-primary);
}

.wpg-m-center {
    text-align: center;
    padding: 0 16px;
    min-width: 90px;
}

.time-box {
    display: inline-block;
    padding: 4px 14px;
    background: var(--wpg-bg-subtle);
    border: 1px solid var(--wpg-border);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
    color: var(--wpg-text-main);
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.score-box {
    display: inline-block;
    padding: 4px 16px;
    background: var(--wpg-primary);
    color: #ffffff;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 900;
    font-family: var(--wpg-num-font), var(--wpg-font);
}

@media (max-width: 600px) {
    .wpg-date-nav-bar {
        padding: 12px 14px;
    }
    .wpg-nav-title {
        font-size: 16px;
    }
    .wpg-match-row {
        padding: 12px 10px;
        grid-template-columns: 1fr auto 1fr;
    }
    .wpg-m-team {
        font-size: 13px;
        gap: 6px;
    }
    .wpg-m-team .team-logo {
        width: 22px;
        height: 22px;
    }
    .time-box, .score-box {
        font-size: 12px;
        padding: 3px 10px;
    }
}

/* ================================================================
   2D VISUAL TACTICAL PITCH & APP-STYLE UI (E-FOOTBALL DESIGN)
   Inspired by modern mobile sports apps (Rounded cards, clean stats, smooth pills)
   ================================================================ */

/* App-style Pill Navigation Bar */
.g-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    border-bottom: none;
    padding: 6px 2px 10px;
    scrollbar-width: none;
}

.g-tab {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    color: var(--wpg-text-muted);
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    border-radius: 30px; /* Rounded pill style from mobile mockup */
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--wpg-shadow-sm);
}

.g-tab:hover {
    color: var(--wpg-primary);
    background: var(--wpg-bg-subtle);
}

.g-tab.active {
    color: #ffffff;
    background: var(--wpg-primary);
    border-color: var(--wpg-primary);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Mobile Clean Stat Row Progress Bars */
.stat-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-row-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 6px;
}

.stat-bar-wrap {
    height: 10px;
    background: var(--wpg-bg-subtle);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    position: relative;
}

.stat-bar-h {
    background: #0284c7; /* Home team bar color */
    border-radius: 20px 0 0 20px;
    transition: width 0.6s ease;
}

.stat-bar-sep {
    width: 2px;
    background: var(--wpg-bg-card);
    z-index: 2;
}

.stat-bar-a {
    background: #f97316; /* Away team bar color (Orange vs Blue from screenshot) */
    border-radius: 0 20px 20px 0;
    transition: width 0.6s ease;
}

/* Player Detail Mobile Card System */
.p-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .p-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.p-stat {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--wpg-shadow-sm);
}

.p-stat .val {
    font-size: 22px;
    font-weight: 900;
    color: var(--wpg-text-main);
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.p-stat .lbl {
    font-size: 12px;
    color: var(--wpg-text-muted);
    font-weight: 700;
}

/* Match Header Mobile Clean Design */
.m-match-header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

@media (max-width: 600px) {
    .wp-goal-wrap {
        padding: 12px 10px;
    }
    
    .ent-header {
        padding: 20px 14px;
        border-radius: 16px;
    }
    
    .match-team-link img {
        max-height: 52px;
    }
    
    .match-team-link h3 {
        font-size: 14px;
        margin-top: 6px;
    }
    
    .big-score {
        font-size: 32px;
        gap: 8px;
    }
    
    .status-pill {
        font-size: 12px;
        padding: 4px 12px;
    }
}

.wpg-pitch-2col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

@media (max-width: 900px) {
    .wpg-pitch-2col-layout {
        grid-template-columns: 1fr;
    }
}

.wpg-pitch-card {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-lg);
    padding: 16px;
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-pitch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wpg-border-subtle);
}

.wpg-pitch-team-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpg-pitch-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.wpg-pitch-team-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--wpg-text-main);
}

.wpg-pitch-formation {
    font-size: 12px;
    color: var(--wpg-text-muted);
    font-weight: 700;
    font-family: var(--wpg-num-font), var(--wpg-font);
}

/* Green Grass Pitch Board */
.wpg-tactical-pitch {
    background: linear-gradient(180deg, #4da459 0%, #3e8d49 100%);
    border: 2px solid #367d3e;
    border-radius: 14px;
    position: relative;
    padding: 24px 12px;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.15);
}

.wpg-pitch-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wpg-pitch-lines::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 4px;
}

.wpg-pitch-penalty-area-top {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 70px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-top: none;
}

.wpg-pitch-center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.wpg-pitch-center-line {
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
}

/* Formation Grid Rows */
.wpg-pitch-formation-grid {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 20px;
}

.wpg-pitch-row {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
}

.wpg-pitch-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wpg-player-shirt {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e11d48; /* Default Red shirt */
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    font-family: var(--wpg-num-font), var(--wpg-font);
}

.wpg-pitch-2col-layout > div:last-child .wpg-player-shirt {
    background: #2563eb; /* Blue shirt for away team */
}

.wpg-shirt-gk {
    background: #10b981 !important; /* Green/Orange shirt for GK */
}

.wpg-player-name-pill {
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
}

/* Substitutes Bench Grid */
.wpg-subs-bench-card {
    margin-top: 16px;
    background: var(--wpg-bg-subtle);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-md);
    padding: 12px 14px;
}

.wpg-subs-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--wpg-text-muted);
    text-align: center;
    margin-bottom: 10px;
}

.wpg-subs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.wpg-sub-item {
    background: var(--wpg-bg-card);
    border: 1px solid var(--wpg-border);
    border-radius: var(--wpg-radius-sm);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.wpg-sub-name {
    font-weight: 700;
    color: var(--wpg-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpg-sub-num {
    font-weight: 800;
    color: var(--wpg-text-muted);
    font-size: 11px;
    font-family: var(--wpg-num-font), var(--wpg-font);
}

/* Sidebar Widgets Layout */
.wpg-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wpg-sidebar-card {
    padding: 20px !important;
}

.wpg-sidebar-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--wpg-text-main);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wpg-border-subtle);
}

.wpg-match-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}

.wpg-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed var(--wpg-border-subtle);
}

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

.wpg-info-label {
    color: var(--wpg-text-muted);
    font-weight: 700;
}

.wpg-info-val {
    font-weight: 800;
    color: var(--wpg-text-main);
}

.wpg-news-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wpg-news-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    border-radius: var(--wpg-radius-sm);
    border: 1px solid var(--wpg-border);
    background: var(--wpg-bg-card);
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.wpg-news-item:hover {
    border-color: var(--wpg-primary);
    transform: translateY(-2px);
    box-shadow: var(--wpg-shadow-sm);
}

.wpg-news-text h5 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--wpg-text-main);
    line-height: 1.4;
}

.wpg-news-date {
    font-size: 11px;
    color: var(--wpg-text-light);
    font-weight: 700;
}

.wpg-news-img {
    width: 60px;
    height: 50px;
    border-radius: var(--wpg-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.wpg-news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



