/* 1. المتغيرات والأساسيات */
:root {
    --bg-color: #f8fafc;
    --text-dark: #334155;
    --accent-color: #00ff85;
    --border-color: #e2e8f0;
    --primary-indigo: #6366f1;
    --purple-grad: linear-gradient(90deg, #514b9a 0%, #7d77d8 100%);
    --light-bg: #f0f4ff;
}

.transfers-container-pro {
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 2. الفلاتر العلوية */
.AHMED-WEB-Section-Header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.AHMED-WEB-Transfers-Filter {
    display: flex;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 12px;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.AHMED-WEB-Filter-Btn {
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    background: transparent;
    color: #64748b;
    transition: 0.3s;
}

.AHMED-WEB-Filter-Btn.active {
    background: #ffffff;
    color: var(--primary-indigo);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 3. عناوين الأقسام والتاغات */
.selection-wrapper {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--B-Color);
    border-radius: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 20px 0;
    border-right: 4px solid var(--accent-color);
    padding-right: 10px;
    display: flex;
    align-items: center;
}

.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    margin-bottom: 6px;
    margin-left: 6px;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
    padding: 8px;
    background: var(--C-Color);
    -moz-transition: var(--Tran-1);
    -o-transition: var(--Tran-1);
}
body > div.container {
    width: 95%;
}

.tag-item:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.tag-item img {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    margin-left: 8px;
    object-fit: contain;
}

.tag-item span { font-size: 13px; font-weight: 500; }

/* 4. كروت الانتقالات (التصميم الموحد) */
.transfer-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    color: #fff;
    background: var(--purple-grad);
    direction: ltr; /* لضمان ترتيب العناصر: فريق جديد | سهم | لاعب */
}

.transfer-card-row.light-style {
    background: var(--B-Color);
    color: var(--Primary-B-Color);
}

/* الأطراف */
.player-side {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    direction: rtl;
    flex-direction: row-reverse;
}

.player-side { justify-content: flex-end; } /* اللاعب على اليمين */

.player-name-box { text-align: right; }
.player-name-box b { display: block; font-size: 14px; }

.player-img-v, .player-img {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

.team-badge-circle {
    width: 38px;
    height: 38px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-badge-circle img { width: 28px !important; height: 28px !important; object-fit: contain; }

/* 5. منطقة السهم والتدفق (التصميم الجديد) */
.exchange-sec {
    flex: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}


/* تأثيرات الصور (Lazy Load) */
.lazy-img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.lazy-img.loaded {
    opacity: 1;
}

/* هيكل جهة اللاعب الجديد */
.player-side {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    direction: rtl;
}

.player-info-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.player-name-box h5 {
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    color: inherit;
    white-space: nowrap;
}

/* صناديق الصور لضمان عدم "قفز" المحتوى عند التحميل */
.img-box, .club-logo {
    /* background: rgba(255, 255, 255, 0.1); */
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exchange-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.exchange-label svg {
    position: absolute;
    width: 100%;
    max-width: 210px;
    opacity: 0.4;
}

.exchange-label span {
    background: #fff;
    color: #000;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.light-style .exchange-label span {
    background: var(--primary-indigo);
    color: #fff;
}

.price-value {
    font-size: 0.75rem;
    color: var(--Primary-A-Color);
    margin-top: 5px;
    font-weight: bold;
    z-index: 2;
}

.date-v { font-size: 10px; font-family: monospace; opacity: 0.8; }

/* 6. أدوات المساعدة والأنيميشن */
.spinner {
    width: 35px;
    height: 35px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-indigo);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.load-more-btn {
    background: var(--primary-indigo);
    color: white;
    padding: 10px 30px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

/* الحاوية الرئيسية لجهة اللاعب */
.player-side {
    display: flex;
    align-items: center; /* محاذاة شعار النادي مع منتصف صورة اللاعب */
    gap: 12px;
    flex: 1;
    justify-content: flex-end; /* ليبقى في جهة اليمين */
    direction: rtl; /* لترتيب العناصر من اليمين لليسار: شعار النادي ثم اللاعب */
}

/* حاوية الصورة والاسم بشكل عمودي */
.player-info-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px; /* المسافة بين الصورة والاسم */
    min-width: 80px; /* مساحة كافية للاسم */
}

/* ضبط الاسم */
.player-name-box {
    text-align: center;
}

.player-name-box b {
    font-size: 12px;
    white-space: nowrap; /* لمنع انكسار الاسم على سطرين */
    display: block;
}

/* شعار النادي المنفصل */
.team-badge-circle {
    flex-shrink: 0; /* منع انكماش شعار النادي */
}

.player-img-box {
    -webkit-border-radius: var(--Border-Radius-2);
    -moz-border-radius: var(--Border-Radius-2);
    border-radius: 6px;
    margin-left: 12px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: flex-end;
    -ms-flex-align: flex-end;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    background: #ffffff;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

/* تعديل للموبايل */
@media (max-width: 767px) {
    .player-info-vertical {
        min-width: 60px;
    }
    .player-name-box b {
        font-size: 10px;
    }
    .player-img-box img {
        width: 35px !important;
        height: 35px !important;
    }
}

.hidden-transfer { display: none !important; }

/* 7. الاستجابة للموبايل */
@media (max-width: 767px) {
    /* 1. تحسين الشبكة لضمان عدم انضغاط العناصر */
    .tags-grid {
        display: grid !important;
        /* repeat(4, 1fr) قد يكون ضيقاً جداً على بعض الهواتف، نستخدم auto-fit لمرونة أكبر */
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)) !important;
        gap: 8px !important;
        width: 110%;
        margin: -10px;
    }

    .tag-item {
        display: -webkit-inline-box;
        display: inline-flex;
        -ms-flex-align: center;
        -ms-flex-pack: center;
        -moz-border-radius: 15px;
        border-radius: 15px;
        padding: 3px;
        -moz-transition: var(--Tran-1);
        -o-transition: var(--Tran-1);
        flex-direction: column;
    }

    /* 2. ضبط الصور (الحل الأساسي لمشكلة الصورة) */
    .tag-item img { 
        margin: 0 0 6px 0 !important; 
        width: 35px !important; /* تكبير بسيط للوضوح */
        height: 35px !important; 
        object-fit: contain !important; /* يضمن ظهور اللوجو كاملاً دون تمطيط */
        display: block !important;
    }

    .tag-item span { 
        font-size: 10px !important; /* تكبير الخط درجة واحدة للقراءة */
        text-align: center; 
        line-height: 1.2;
        word-wrap: break-word;
    }

    /* 3. ضبط كروت الانتقالات وصور اللاعبين */
    .player-img-v { 
        width: 40px !important; 
        height: 40px !important; 
        object-fit: cover !important; /* صور اللاعبين يفضل أن تملأ الدائرة */
        border-radius: 50%;
    }

    .team-badge-circle { 
        width: 32px !important; 
        height: 32px !important; 
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .team-badge-circle img {
        width: 80% !important; /* تجعل الشعار مرتاحاً داخل الدائرة */
        height: 80% !important;
        object-fit: contain !important;
    }

    .exchange-label svg { max-width: 100px !important; } /* تصغير السهم ليتناسب مع المساحة */
    .exchange-label span { font-size: 9px !important; padding: 2px 6px !important; }
}

.tag-item span {
    color: var(--Primary-B-Color);
}


/* تأثير احترافي: تعتيم + حركة للأعلى قليلاً */
.lazy-img {
    opacity: 0;
    transform: scale(0.95); /* تبدأ أصغر قليلاً */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.lazy-img.loaded {
    opacity: 1;
    transform: scale(1); /* تعود لحجمها الطبيعي عند الظهور */
}

/* إضافة خلفية رمادية خفيفة أثناء التحميل */
.img-box, .club-logo {
    /* background: #e2e8f0 !important; */
    position: relative;
}

