/* General Styling for Fixtures, Standings, and Scorers */
.echo-fixture-list, .echo-standings-table, .echo-scorers-list {
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* --- إصلاح التموضع (CRITICAL CSS FOR SCROLLBOARD LAYOUT) --- */

.sp-scoreboard-wrapper {
    position: relative; 
    overflow: hidden;
    height: auto; 
    padding: 20px 0; /* تم زيادتها لضمان رؤية الأسهم بالكامل */
}

.sp-scoreboard-content {
    /* إضافة حشوة (Padding) لمنع المحتوى من الاختفاء خلف الأزرار */
    padding: 0 45px; /* تم زيادتها لتوفير مساحة أكبر للأسهم */
    overflow: hidden; 
    white-space: nowrap; 
}

/* تنسيق قائمة المباريات لتدعم التمرير الأفقي */
.echo-fixture-list {
    display: flex; 
    white-space: nowrap; 
    padding: 0; 
    border: none;
    background-color: transparent;
    transition: right 0.3s ease-out, left 0.3s ease-out; 
}

/* تنسيق الأزرار وتوسيطها عمودياً */
.sp-scoreboard-nav {
    position: absolute;
    top: 50%; /* تموضع الأزرار في منتصف ارتفاع المحتوى */
    transform: translateY(-50%); /* تعويض نصف ارتفاع الزر لضمان التوسيط الدقيق */
    z-index: 10;
    
    /* تنسيق الزر الأساسي */
    cursor: pointer;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px; 
    height: 40px; 
    line-height: 40px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    /* ضمان عرض الأيقونة بالكامل */
    display: flex;
    justify-content: center;
    align-items: center;
    /* إضافة انتقال بسيط عند التمرير */
    transition: opacity 0.3s; 
}

.sp-scoreboard-nav i {
    font-size: 1.1em;
}

.sp-scoreboard-prev {
    left: 5px;  /* تموضع الزر السابق (لليسار في RTL) */
}

.sp-scoreboard-next {
    right: 5px; /* تموضع الزر التالي (لليمين في RTL) */
}

.sp-scoreboard-nav-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none; /* لمنع النقر حتى لو كانت شفافة */
}

/* نهاية إصلاح التموضع */

/* تنسيق بطاقة المباراة (Match Card Styling) */
.match-card {
    flex-shrink: 0; 
    display: inline-block; 
    vertical-align: top;
    width: 320px; 
    margin: 0 5px; 
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* تنسيق خطوط البطاقة الداخلية */
.match-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
}

.top-line {
    margin-bottom: 10px;
}

.team {
    display: flex;
    align-items: center;
    flex-basis: 40%;
}

.team-name {
    flex-grow: 1;
    font-weight: bold;
    flex-basis: auto; 
    text-align: inherit; 
}

.team img {
    width: 25px;
    height: 25px;
    margin: 0 5px;
}

.team.home {
    flex-direction: row-reverse; 
    justify-content: flex-start;
}
.team.home .team-name {
    text-align: right;
}

.team.away {
    flex-direction: row; 
    justify-content: flex-end;
}
.team.away .team-name {
    text-align: left;
}

.match-score {
    flex-basis: auto; 
    padding: 0 10px;
    font-size: 1.1em;
    color: #c00;
}

/* خط التفاصيل (Detail Line) */
.details-line {
    font-size: 0.85em;
    color: #888;
    justify-content: space-around;
}

.details-line span {
    display: flex;
    align-items: center;
}

.details-line i {
    margin-left: 5px;
    font-size: 1.1em;
}

/* تنسيق الجدول (Table Styling) - Unchanged */
.echo-standings-table table, .echo-scorers-list table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.echo-standings-table th, .echo-scorers-list th {
    background-color: #333;
    color: white;
    padding: 10px;
    text-align: right; 
}

.echo-standings-table td, .echo-scorers-list td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    text-align: right; 
}

.echo-standings-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}