/* ==========================================================================
   1. الإعدادات العامة والحاويات الرئيسية (General & Containers)
   ========================================================================== */
body > div.container {
    width: 100%;
}

.AHMED-WEB-Standings-Top {
    background-color: #1a1a1a;
    padding: 40px 20px;
    direction: rtl;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    width: 88%;
    margin: 20px auto;
}

/* اختصار وتنظيف حاوية الصفحة المخصصة */
.AHMED-WEB-Standings-Top-Right-Wrap {
    width: 100%;
    flex-wrap: wrap;
    padding: 27px 24px 24px;
    border-radius: 25px;
    margin-bottom: 25px;
    border: var(--asp-0-to-1) solid #f1f2f8;
    border-bottom: 4px solid var(--asp-main, #39dbbf);
    transition: background 0.3s ease;
    background: url(/assets/images/profile-bg.svg) no-repeat center center / 100% 100% transparent;
}

html.light .AHMED-WEB-Standings-Top-Right-Wrap {
    background: url(/assets/images/card.svg) no-repeat center center / 100% 100% var(--asp-2d-f0, #e3e5f0);
}

.AHMED-WEB-Standings-Top-Right-Wrap > h1 {
    color: var(--asp-main);
    font-size: 26px;
    font-weight: 800;
    margin: 0;
}


/* ==========================================================================
   2. كارت تفاصيل اللاعب المخصص (SINGLE PLAYER CARD DETAILS)
   ========================================================================== */


/* 2.1 الهيدر والغلاف العلوي للاعب (الليل والنهار) */
.player-top-header {
    display: flex;
    flex-direction: row-reverse;
    padding: 50px;
    border-radius: 15px;
    width: 100%;
    overflow: hidden;
    background-size: 100% 100%;
    transition: background 0.3s ease, border-color 0.3s ease;
    background: url(/assets/images/profile-bg.svg) no-repeat center center transparent;
    border: 1px solid var(--asp-51-d1);
}

html.light .player-top-header {
    background: url(/assets/images/card.svg) no-repeat center center var(--asp-2d-f0);
    border-color: var(--asp-51-d1);
}

.player-headline {
    flex: 1;
    text-align: right;
}

.player-headline h2 {
    margin: 0;
    font-size: 22px;
    color: var(--asp-d4-19);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.player-headline p {
    font-size: 13.5px;
    color: var(--asp-d4-19);
    line-height: 1.6;
    margin: 0;
    opacity: 0.9;
}

.player-M {
    display: flex;
    gap: 12px;
    margin: 12px 0;
    justify-content: flex-start;
}

.player-M img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}

.player-M img:hover {
    transform: scale(1.2);
}

.player-card-box:hover {
    border-color: #00ff88;
}

/* 2.2 جدول المعلومات والإحصائيات السريعة */
.player-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px 6px;
    margin-top: 16px;
}

table.player-table tbody tr, 
table.SeasonStatistics tbody tr {
    background: var(--asp-2d-f0);
}

.player-table th:first-child {
    color: var(--asp-d4-19);
    width: 50%;
    border-radius: 12px;
    padding: 8px;
    font-size: 14px;
    text-align: center;
}

.player-table th:last-child {
    color: #ffffff;
    border-radius: 8px 0 0 8px;
    text-align: center;
    font-weight: bold;
}

.PlayerStats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.Stats {
    background: var(--asp-2d-f0);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 12px 5px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.Stats:hover {
    border-color: #00ff88;
    transform: translateY(-3px);
}

.Stats img { width: 28px; height: 28px; margin-bottom: 5px; }
.Stats span:nth-child(2) { font-size: 11px; color: #707488; }
.Stats span:last-child { font-size: 15px; font-weight: bold; color: var(--asp-d4-19); }
.light-mode .Stats img { filter: brightness(0.8) contrast(1.2); }

/* 2.3 التبويبات (Tabs) */
.stats-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px 5px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.stats-tabs::-webkit-scrollbar { display: none; }

.stats-tab {
    background: var(--asp-2d-f0);
    color: var(--asp-d4-19);
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid #30363d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.stats-tab.active {
    background: linear-gradient(90deg, #00ff88 0%, #00cc6a 100%);
    color: #000;
    border-color: transparent;
}

/* 2.4 الإحصائيات المتقدمة (Season Statistics) */
.advanced-stats {
    margin-top: 15px;
    direction: rtl;
}

.SeasonStatistics {
    width: 100%;
    border-collapse: separate;
    border-spacing: 10px;
    table-layout: fixed;
}

.SeasonStatistics tr { display: table-row; }
.SeasonStatistics th {
    background: var(--C-Color, var(--asp-2d-f0));
    border-radius: 12px;
    padding: 15px;
    font-weight: normal;
    display: table-cell;
    vertical-align: middle;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.SeasonStatistics th span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-direction: column;
}

.SeasonStatistics th span:first-child {
    color: #8b949e;
    font-size: 13px;
    text-align: right;
}

.SeasonStatistics th span:last-child {
    color: var(--asp-d4-19);
    font-weight: bold;
    font-size: 15px;
    text-align: left;
}

.SeasonStatistics th:hover {
    border-color: #00ff88;
    background: rgba(255, 255, 255, 0.1);
}

.stat-row {
    background: #161b22;
    border: 1px solid #30363d;
    transition: all 0.3s ease;
}

.stat-row td {
    color: var(--asp-d4-19);
    width: 50%;
    border-radius: 12px;
    padding: 8px;
    font-size: 14px;
    text-align: center;
}

.stat-row:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.01);
}

.stat-row:hover td { color: #fff; }

/* 2.5 سجل الانتقالات (Transfers Timeline) */
.player-transfers {
    display: block;
    position: relative;
    background: var(--asp-2d-f0);
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
}

.player-transfers li { display: flex; align-items: center; padding: 15px 0; position: relative; }
.player-transfers li::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--B-Color, #30363d);
    z-index: 1;
}

.s-r { flex: 1; text-align: left; padding-left: 15px; display: flex; flex-direction: column; }
.s-s { font-weight: bold; font-size: 13px; color: #707488; }
.s-d { font-size: 11px; color: var(--asp-d4-19); }
.s-p { font-size: 12px; color: #06d173; }
.s-c { width: 30px; display: flex; justify-content: center; z-index: 2; }
.l-c { width: 10px; height: 10px; background: #0d1117; border: 2px solid #00ff88; border-radius: 50%; }
.s-l { flex: 1; padding-right: 15px; }

.s-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 5px;
    display: flex;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.2));
}

/* 2.6 قسم الألقاب (Trophies) */
.player-trophies {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
}

.player-trophies li {
    background: var(--asp-2d-f0);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    position: relative;
}

.trophies-numbers {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--asp-25-ff);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

img.trophie-img, .trophie-img {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain !important;
    vertical-align: middle !important;
    margin-bottom: 5px;
}

.trophie-name {
    font-size: 11px;
    color: var(--asp-d4-19);
    height: 32px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-top: 5px;
}

/* 2.7 عناوين وأزرار الكارت */
.player-h5 h4 {
    border-right: 4px solid #00ff88;
    padding: 10px 0;
    margin: 25px 0 15px;
    font-size: 18px;
    font-weight: 700;
    color: #707488;
    display: block;
    text-align: center;
    background: linear-gradient(270deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0) 50%);
    border-radius: 0 4px 4px 0;
    line-height: 1.6;
    font-family: 'Cairo', sans-serif;
}

.show-more-btn {
    width: 100%;
    max-width: 200px;
    background: var(--asp-2d-f0);
    color: var(--asp-d4-19);
    border: 1px solid #ffffff;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin: 20px auto;
    display: block;
}


/* ==========================================================================
   3. قسم شبكة جميع اللاعبين / قائمة الفرق (ALL PLAYERS GRID LIST)
   ========================================================================== */
.Ahmed-web-Teams-list {
    padding: 20px 10px;
    direction: rtl;
    font-family: var(--asp-font, 'Segoe UI', Tahoma, sans-serif);
}

.Ahmed-web-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 🌙 1. تصميم الكارت في الوضع الليلي (الافتراضي) */
.Ahmed-web-cards .card {
    background: var(--asp-2d-f0);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--asp-51-d1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.35s ease, 
                border-color 0.35s ease;
}

/* ☀️ 2. تصميم الكارت في الوضع النهاري */
html.light .Ahmed-web-cards .card {
    background: var(--asp-25-ff);
    border-color: var(--asp-51-f8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* تأثير عند مرور الماوس على الكارت (Hover Effect) */
.Ahmed-web-cards .card:hover {
    transform: translateY(-7px) scale(1.02);
    border-color: var(--asp-main);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35), 0 0 15px var(--asp-rgb-15-f0);
}

html.light .Ahmed-web-cards .card:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.Ahmed-web-cards .card a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* منطقة الصورة والغلاف الخلفي */
.Ahmed-web-player-thumb {
    width: 100%;
    height: 105px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    overflow: hidden;
}

.Ahmed-web-player-thumb img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    border: 3px solid var(--asp-2d-ff);
    background: var(--asp-19-fc);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, border-color 0.3s ease;
    z-index: 2;
}

html.light .Ahmed-web-player-thumb img {
    border-color: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* تكبير الصورة بجمالية عند الـ Hover */
.Ahmed-web-cards .card:hover .Ahmed-web-player-thumb img {
    transform: scale(1.12) rotate(2deg);
    border-color: var(--asp-main);
}

/* اسم اللاعب */
.Ahmed-web-card-name {
    display: block;
    padding: 10px 4px;
    color: var(--asp-ff-19);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    background: var(--asp-21-fc);
    border-top: 1px solid var(--asp-51-d1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* تغيير لون الاسم عند تمرير الماوس */
.Ahmed-web-cards .card:hover .Ahmed-web-card-name {
    color: var(--asp-main);
}

/* ==========================================================================
   تجاوب الموبايل (4 لاعبين بجانب بعض متناسقين تماماً)
   ========================================================================== */
@media (max-width: 480px) {
    .Ahmed-web-cards {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    .Ahmed-web-cards .card {
        border-radius: 10px !important;
    }

    .Ahmed-web-player-thumb {
        height: 65px !important;
    }

    .Ahmed-web-player-thumb img {
        width: 42px !important;
        height: 42px !important;
        border-width: 1.5px !important;
    }

    .Ahmed-web-card-name {
        font-size: 9.5px !important;
        padding: 6px 2px !important;
    }
}

/* ==========================================================================
   4. التوافق مع الشاشات الصغيرة والموبايل (RESPONSIVE MEDIA QUERIES)
   ========================================================================== */
/* الشاشات التي تقل عن 768px (التابلت والموبايل) */
@media screen and (max-width: 768px) {
    .AHMED-WEB-Standings-Top-Right-Wrap,
    .Ahmed-web-PlayerCard {
        width: 95% !important;
    }

    .stats-tabs {
        display: flex !important;
        overflow-x: auto !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        gap: 10px;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .stats-tab {
        flex: 0 0 auto !important;
        display: inline-block !important;
    }

    table.SeasonStatistics {
        display: table !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 6px !important;
        table-layout: fixed !important;
    }

    table.SeasonStatistics tbody {
        display: table-row-group !important;
    }

    table.SeasonStatistics tr {
        display: table-row !important;
    }

    table.SeasonStatistics tr th {
        display: table-cell !important;
        width: 50% !important;
        background: var(--C-Color, var(--asp-2d-f0));
        border-radius: 8px !important;
        padding: 12px 4px !important;
        vertical-align: middle !important;
        text-align: center !important;
    }

    table.SeasonStatistics th span {
        display: block !important;
        margin: 0 auto !important;
        text-align: center !important;
        width: 100% !important;
    }

    table.SeasonStatistics th span:first-child {
        font-size: 10px !important;
        color: #8b949e !important;
        margin-bottom: 4px !important;
        line-height: 1.2 !important;
    }

    table.SeasonStatistics th span:last-child {
        font-size: 15px !important;
        color: var(--Primary-A-Color, #00ff88) !important;
        font-weight: bold !important;
        line-height: 1 !important;
    }
}

/* الهواتف الصغيرة (أقل من 480px) */
@media (max-width: 480px) {
    /* تجاوب تفاصيل اللاعب */
    .player-top-header {
        padding: 12px;
        gap: 10px;
    }

    .player-headline h2 { font-size: 18px; }
    .player-headline p { font-size: 12px; }
    .player-card-box { width: 85px; height: 85px; }
    .PlayerStats { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .Stats span:last-child { font-size: 13px; }
    .player-trophies { grid-template-columns: repeat(3, 1fr); }

    /* تجاوب شبكة جميع اللاعبين (4 أعمدة) */
    .Ahmed-web-cards {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    .Ahmed-web-player-thumb {
        height: 70px !important;
    }

    .Ahmed-web-player-thumb img {
        width: 45px !important;
        height: 45px !important;
        border-width: 1.5px !important;
    }

    .Ahmed-web-card-name {
        font-size: 9px !important;
        padding: 5px 1px !important;
    }

    .Ahmed-web-cards .card {
        border-radius: 8px !important;
    }
}