/* =====================================================
   Yusef Tartib Frontend Styling (Standings & Top Scorers)
   ===================================================== */

.yusef-standings-box,
.yusef-scorers-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
}

[data-theme="dark"] .yusef-standings-box,
[data-theme="dark"] .yusef-scorers-box {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.yusef-standings-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

[data-theme="dark"] .yusef-standings-header {
    border-bottom-color: #334155;
}

.yusef-league-logo {
    width: 38px; height: 38px;
    object-fit: contain;
}

.yusef-league-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #d97706;
    margin: 0;
}

/* MULTI-GROUP TOURNAMENTS (CHAMPIONS LEAGUE, AFCON, WORLD CUP) */
.yusef-groups-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.yusef-group-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem;
}
[data-theme="dark"] .yusef-group-block {
    background: #0f172a;
    border-color: #334155;
}
.yusef-group-title-badge {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1d2327;
    background: #fef3c7;
    border-right: 4px solid #f59e0b;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    display: inline-block;
}
[data-theme="dark"] .yusef-group-title-badge {
    background: #78350f;
    color: #fef3c7;
}

/* RESPONSIVE TABLE WRAPPER */
.yusef-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.yusef-standings-table,
.yusef-scorers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.yusef-standings-table th,
.yusef-scorers-table th {
    background: #030712 !important;
    color: #ffffff !important;
    padding: 0.75rem 0.6rem;
    font-weight: 800;
    text-align: center;
    border-bottom: 2px solid #283548 !important;
}

.yusef-standings-table td,
.yusef-scorers-table td {
    background: #151c2c !important;
    color: #ffffff !important;
    padding: 0.65rem 0.6rem;
    text-align: center;
    border-bottom: 1px solid #283548 !important;
    vertical-align: middle;
}

/* COLUMN TYPES */
.col-rank { width: 40px; text-align: center; }
.col-team, .col-player { text-align: right !important; }
.col-num { width: 55px; }
.col-pts { width: 65px; font-weight: 800; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-weight: 800;
    font-size: 0.8rem;
}

.rank-1 .rank-badge { background: #f59e0b; color: #ffffff; }
.rank-2 .rank-badge { background: #94a3b8; color: #ffffff; }
.rank-3 .rank-badge { background: #b45309; color: #ffffff; }

.team-logo {
    width: 24px; height: 24px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.player-photo {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-left: 0.5rem;
    border: 1px solid #cbd5e1;
}

.team-name, .player-name {
    font-weight: 700;
}

.goals-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 900;
}

/* =====================================================
   LEAGUES HUB PAGE STYLING (MATCHING DESKTOP & MOBILE IMAGES)
   ===================================================== */
.yusef-leagues-hub-wrapper {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
    margin: 1.5rem 0;
}

.yusef-hub-title-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.yusef-hub-title-bar h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f59e0b;
    margin: 0;
}

/* DESKTOP 3-COLUMN GRID (IMAGE 1) */
.yusef-leagues-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.league-hub-card {
    background: #151c2c;
    border: 1px solid #283548;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.league-hub-card:hover {
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
}

.league-hub-header {
    background: #030712;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-bottom: 1px solid #1e293b;
    min-height: 70px;
}

.star-icon {
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}
.star-icon:hover { color: #f59e0b; }

.league-hub-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff !important;
    margin: 0;
    flex: 1;
    text-align: center !important;
    margin-right: 0.5rem;
}

.league-hub-subtext-mobile {
    display: none;
    font-size: 0.73rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    text-align: center !important;
}

.league-logo-box {
    width: 65px;
    height: 60px;
    background: #0b0f19 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px 0 0 4px;
    border-right: 5px solid #0284c7;
    padding: 0.35rem;
}
.league-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* CARD OPTIONS LIST */
.league-hub-options {
    display: flex;
    flex-direction: column;
    background: #151c2c;
}

.hub-option-btn {
    width: 100%;
    background: #151c2c;
    color: #ffffff !important;
    border: none;
    border-bottom: 1px solid #283548;
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.hub-option-btn:last-child { border-bottom: none; }
.hub-option-btn:hover {
    background: #1e293b;
    color: #f59e0b !important;
}

.mobile-arrow { display: none; }

/* INTERACTIVE MODAL FOR TARTIB & SCORERS */
.yusef-hub-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.yusef-hub-modal.active { display: flex; }

.hub-modal-content {
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid #334155;
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hub-modal-header {
    background: #0f172a;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #334155;
    color: #ffffff;
}
.hub-modal-header h3 { margin: 0; font-size: 1.1rem; color: #f59e0b; }
.hub-modal-close {
    background: #334155;
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.hub-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.yusef-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* MOBILE RESPONSIVE STACKED LIST VIEW (IMAGE 2) */
@media (max-width: 768px) {
    .yusef-leagues-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .league-hub-card {
        flex-direction: row-reverse;
        align-items: center;
        justify-content: space-between;
        padding: 0.6rem 0.85rem;
        background: #18181b;
        border-color: #27272a;
    }

    .league-hub-header {
        background: transparent;
        border: none;
        padding: 0;
        min-height: auto;
        flex: 1;
        flex-direction: row-reverse;
        justify-content: flex-end;
        gap: 0.75rem;
    }

    .league-hub-title {
        font-size: 0.95rem;
        margin-margin-right: 0;
    }

    .league-hub-subtext-mobile {
        display: block;
    }

    .league-logo-box {
        width: 50px;
        height: 50px;
        border-radius: 4px;
    }

    .league-hub-options {
        display: flex;
        flex-direction: row;
        gap: 0.35rem;
        margin-left: 0.5rem;
    }

    .hub-option-btn {
        background: #27272a;
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
        border-radius: 4px;
        border: none;
    }

/* =====================================================
   MULTI-LEAGUES PAGES (3-COLUMNS DESKTOP / 1-COLUMN MOBILE)
   ===================================================== */
.yusef-multi-leagues-page-wrapper {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
    margin: 1.5rem 0;
}

.yusef-multi-leagues-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.multi-league-col {
    width: 100%;
}

.multi-league-col .yusef-standings-box,
.multi-league-col .yusef-scorers-box {
    margin: 0;
}

@media (max-width: 1024px) {
    .yusef-multi-leagues-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .yusef-multi-leagues-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

