/* 
 * Premium Yalla Score Design Revamp 
 * Modern, Clean, and Vibrant Sports Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Noto+Sans+Arabic:wght@400;600;700&display=swap');

:root {
    --yalla-primary: #3d195b;
    --yalla-secondary: #ff005a;
    --yalla-accent: #00ff85;
    --yalla-bg: #f0f2f5;
    --yalla-card-bg: #ffffff;
    --yalla-text-main: #1a1a1a;
    --yalla-text-muted: #65676b;
    --yalla-border: #e4e6eb;
    --yalla-shadow: 0 2px 4px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
    --yalla-radius: 16px;
    --yalla-glass: rgba(255, 255, 255, 0.7);
}

/* Dark Mode Variables */
body.pl-hub-dark-mode {
    --yalla-bg: #0b1120;
    --yalla-card-bg: #1e293b;
    --yalla-text-main: #f1f5f9;
    --yalla-text-muted: #94a3b8;
    --yalla-border: #334155;
    --yalla-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --yalla-glass: rgba(30, 41, 59, 0.7);
}

/* Dashboard Wrapper */
.wp-pl-hub-dashboard {
    background: var(--yalla-bg);
    padding: 16px;
    border-radius: var(--yalla-radius);
    font-family: 'Inter', 'Noto Sans Arabic', -apple-system, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 1400px;
    margin: 0 auto;
}

/* Glassmorphism for Containers */
.wp-pl-hub-container { 
    background: var(--yalla-card-bg); 
    border: 1px solid var(--yalla-border); 
    border-radius: var(--yalla-radius); 
    box-shadow: var(--yalla-shadow); 
    padding: 16px; 
    margin-bottom: 20px; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(10px);
}
.wp-pl-hub-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.1);
}

/* Compact Yalla Shoot Style Match List */
.yalla-match-list { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 16px; 
    margin-bottom: 24px;
}
.match-center-controls {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    flex-wrap: wrap;
}
.match-filter-btn {
    border: 1px solid var(--yalla-border);
    background: var(--yalla-card-bg);
    color: var(--yalla-text-main);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.match-filter-btn.active {
    background: var(--yalla-primary);
    color: #fff;
    border-color: var(--yalla-primary);
}
.yalla-match-card {
    background: var(--yalla-card-bg);
    border: 1px solid var(--yalla-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}
.yalla-match-card:hover {
    border-color: var(--yalla-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.yalla-match-league {
    background: #4a1a6b; /* Consistent Dark Purple */
    color: #fff;
    font-size: 0.65rem;
    padding: 4px 10px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.yalla-match-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff;
    flex: 1;
}
.yalla-team { 
    flex: 1; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    gap: 8px; 
    text-decoration: none;
    color: var(--yalla-text-main);
    transition: color 0.2s;
}
.yalla-team:hover { color: var(--yalla-secondary); }
.yalla-team img { width: 36px; height: 36px; object-fit: contain; }
.yalla-team .team-name { 
    font-size: 0.8rem; 
    font-weight: 700; 
    text-align: center;
    line-height: 1.2;
}

.yalla-center { 
    flex: 0 0 80px; 
    text-align: center; 
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.yalla-score {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--yalla-primary);
    letter-spacing: 1px;
}
.yalla-start-time { 
    font-size: 0.9rem; 
    font-weight: 800; 
    color: #333; 
}
.yalla-status { 
    font-size: 0.6rem; 
    font-weight: 700; 
    padding: 2px 8px; 
    border-radius: 10px;
    display: inline-block;
    background: #f0f2f5;
    color: #65676b;
}
.yalla-status.in_play, .yalla-status.live {
    background: #ff005a;
    color: #fff;
}

.yalla-match-bottom {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid var(--yalla-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.yalla-meta { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
}
.meta-item {
    font-size: 0.65rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}
.yalla-watch-btn {
    background: #ff005a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    text-decoration: none;
    transition: opacity 0.2s;
}
.yalla-watch-btn:hover { opacity: 0.9; }
.yalla-watch-btn::before {
    content: '▶';
    font-size: 0.7rem;
}
.yalla-watch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(255, 0, 90, 0.3);
}

/* Modern Match Detail Page Styles */
.match-detail-page .match-detail-header {
    background: linear-gradient(135deg, var(--yalla-primary) 0%, #4a1a6b 100%);
    color: #fff;
    padding: 30px;
    border-radius: var(--yalla-radius);
    margin-bottom: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(61, 25, 91, 0.2);
}

.match-detail-page .match-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 20px auto;
}

.detail-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.team-crest-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    background: #fff;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.team-crest-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-team h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.detail-score {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.score-box {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 30px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Timeline Styling (SofaScore Style) */
.match-timeline {
    position: relative;
    padding: 20px 0;
}

.match-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--yalla-border);
    transform: translateX(-50%);
}

.timeline-event {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}

.event-minute {
    width: 40px;
    height: 40px;
    background: var(--yalla-card-bg);
    border: 2px solid var(--yalla-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--yalla-primary);
}

.event-icon {
    font-size: 1.2rem;
    margin: 0 15px;
}

.event-detail {
    background: var(--yalla-bg);
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    max-width: 40%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.home-event { flex-direction: row; }
.away-event { flex-direction: row-reverse; }

.home-event .event-detail { margin-right: auto; margin-left: 0; text-align: left; margin-left: 55%; }
.away-event .event-detail { margin-left: auto; margin-right: 0; text-align: right; margin-right: 55%; }

.home-event .event-icon { margin-left: 52%; position: absolute; }
.away-event .event-icon { margin-right: 52%; position: absolute; }

/* Match Stats Bars Styling */
.stats-rows {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--yalla-text-main);
}

.stat-progress-bar {
    height: 8px;
    background: var(--yalla-border);
    border-radius: 4px;
    display: flex;
    overflow: hidden;
}

.stat-progress {
    height: 100%;
    transition: width 1s ease-out;
}

.stat-progress.home {
    background: var(--yalla-primary);
}

.stat-progress.away {
    background: var(--yalla-secondary);
}

/* RTL Adjustments */
.rtl-support .match-timeline::before { left: 50%; }
.rtl-support .event-minute { left: 50%; }
.rtl-support .home-event { flex-direction: row-reverse; }
.rtl-support .away-event { flex-direction: row; }
.rtl-support .home-event .event-detail { text-align: right; margin-right: 55%; margin-left: auto; }
.rtl-support .away-event .event-detail { text-align: left; margin-left: 55%; margin-right: auto; }

.timeline-score {
    font-size: 0.7rem;
    background: var(--yalla-primary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    font-weight: 800;
}

.lineups-container .player-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lineups-container .player-list li {
    padding: 10px;
    border-bottom: 1px solid var(--yalla-border);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

.lineups-container .player-list li:last-child {
    border-bottom: none;
}

    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 0.95rem;
}
.rtl-support .yalla-watch-btn {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 0.85rem;
    flex-direction: row-reverse;
}
.rtl-support .yalla-watch-btn::before {
    content: '◀';
}

/* Layout Flex Optimization */
.hub-flex { display: flex; gap: 24px; align-items: flex-start; }
.hub-left { flex: 1.8; min-width: 0; } /* Standardized width */
.hub-right { flex: 1.2; min-width: 0; }

/* Table Improvements */
.wp-pl-hub-table { border-spacing: 0 4px; }
.wp-pl-hub-table td { 
    background: var(--yalla-card-bg); 
    padding: 12px; 
    border-bottom: 1px solid var(--yalla-border);
}
.wp-pl-hub-table tr:last-child td { border-bottom: none; }
.points { font-weight: 800; color: var(--yalla-primary); }

/* Header Actions Modernization */
.pl-hub-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--yalla-card-bg);
    padding: 12px 20px;
    border-radius: var(--yalla-radius);
    margin-bottom: 24px;
    box-shadow: var(--yalla-shadow);
}
#pl-hub-search-input {
    background: var(--yalla-bg);
    border: 1px solid transparent;
    padding: 10px 20px;
    width: 300px;
}
#pl-hub-search-input:focus {
    background: #fff;
    border-color: var(--yalla-primary);
    box-shadow: 0 0 0 4px rgba(61, 25, 91, 0.1);
}

/* News Ticker Fix */
.wp-pl-hub-ticker-wrapper {
    display: flex;
    background: var(--yalla-card-bg);
    border: 1px solid var(--yalla-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
    height: 44px;
    align-items: center;
    box-shadow: var(--yalla-shadow);
    position: relative;
}
.ticker-label {
    background: var(--yalla-secondary);
    color: #fff;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 2;
}
.ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.ticker-track {
    display: flex;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker-scroll 30s linear infinite;
}
.ticker-item {
    color: var(--yalla-text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.news-source-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ticker-bullet {
    color: var(--yalla-secondary);
    font-weight: 800;
}

/* League Tabs & Sub Nav Cleanup */
.pl-hub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}
.pl-tab-btn {
    background: var(--yalla-primary);
    color: rgba(255,255,255,0.8);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.pl-tab-btn.active, .pl-tab-btn:hover {
    background: var(--yalla-secondary);
    color: #fff;
    transform: translateY(-1px);
}

.pl-hub-sub-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.sub-tab-btn {
    background: var(--yalla-card-bg);
    border: 1px solid var(--yalla-border);
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--yalla-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.sub-tab-btn.active {
    background: var(--yalla-primary);
    color: #fff;
    border-color: var(--yalla-primary);
}

/* Lang Buttons Fix */
.pl-hub-lang-switcher {
    display: flex;
    gap: 4px;
}
.lang-btn {
    background: var(--yalla-primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0.7;
}
.lang-btn.active, .lang-btn:hover {
    opacity: 1;
    background: var(--yalla-secondary);
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Responsive Grid for Today's Matches */
@media (max-width: 1200px) {
    .yalla-match-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
/* Author Box E-E-A-T */
.author-box-container {
    background: linear-gradient(135deg, var(--yalla-card-bg) 0%, var(--yalla-bg) 100%);
    border-left: 4px solid var(--yalla-primary);
    padding: 20px;
}
.author-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.author-avatar {
    width: 60px;
    height: 60px;
    background: var(--yalla-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--yalla-shadow);
}
.author-name {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--yalla-text-main);
    margin-bottom: 5px;
}
.verified-badge {
    color: var(--yalla-accent);
    font-size: 0.9rem;
    margin-left: 5px;
}
.author-bio {
    font-size: 0.85rem;
    color: var(--yalla-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Popular Teams Grid */
.popular-teams-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.popular-team-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--yalla-bg);
    border-radius: 8px;
    text-decoration: none;
    color: var(--yalla-text-main);
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.popular-team-item:hover {
    border-color: var(--yalla-primary);
    background: var(--yalla-card-bg);
}
.popular-team-item img {
    width: 20px;
    height: 20px;
}

/* H2H Semantic Analysis */
.h2h-semantic-analysis {
    background: var(--yalla-primary);
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 4px solid var(--yalla-accent);
}
.rtl-support .h2h-semantic-analysis {
    border-left: none;
    border-right: 4px solid var(--yalla-accent);
}

/* Sticky Live Ticker for Competitor Advantage */
.sticky-live-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--yalla-primary);
    color: #fff;
    padding: 10px 25px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 2px solid var(--yalla-accent);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}
.live-pulse-icon {
    width: 10px;
    height: 10px;
    background: var(--yalla-accent);
    border-radius: 50%;
    animation: pulse-green 1.5s infinite;
}
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 133, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 133, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 133, 0); }
}

@media (max-width: 992px) {
    .hub-flex { flex-direction: column; }
    .hub-left, .hub-right { flex: 1; width: 100%; }
}

@media (max-width: 480px) {
    .yalla-match-top { padding: 8px 10px; }
    .yalla-team { gap: 6px; }
    .yalla-team img { width: 20px; height: 20px; }
    .yalla-team .team-name { font-size: 0.75rem; }
    .yalla-score { font-size: 0.9rem; padding: 2px 6px; }
    .yalla-center { flex: 0 0 80px; }
    .match-main { gap: 16px; }
    .detail-team img { width: 56px; height: 56px; }
    .detail-team h2 { font-size: 1rem; }
    .score-box, .time-box { font-size: 1.5rem; padding: 6px 16px; }
}

/* Match Detail Page Styling */
.match-detail-header {
    background: var(--yalla-card-bg);
    border: 1px solid var(--yalla-border);
    border-radius: var(--yalla-radius);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: var(--yalla-shadow);
}
.match-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin: 16px 0;
}
.detail-team img { width: 72px; height: 72px; margin-bottom: 8px; object-fit: contain; }
.detail-team h2 { font-size: 1.25rem; font-weight: 800; margin: 0; color: var(--yalla-text-main); }
.score-box, .time-box {
    background: var(--yalla-primary);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    padding: 8px 24px;
    border-radius: 10px;
}
.status-label {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--yalla-secondary);
    text-transform: uppercase;
}
.match-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    color: var(--yalla-text-muted);
    font-size: 0.85rem;
}

/* Team Detail Page Styling */
.team-detail-header {
    background: var(--yalla-card-bg);
    border: 1px solid var(--yalla-border);
    border-radius: var(--yalla-radius);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: var(--yalla-shadow);
}
.team-large-crest { width: 80px; height: 80px; margin-bottom: 16px; object-fit: contain; }
.team-meta-info { display: flex; justify-content: center; gap: 16px; color: var(--yalla-text-muted); font-size: 0.85rem; margin-top: 12px; }
.team-meta-info a { color: var(--yalla-primary); text-decoration: none; font-weight: 700; }
