/* =====================================================
   REFERENCES - BRANDS SECTION
   File : assets/css/references.css
===================================================== */

/*=====================================================
  SECTION BASE
===================================================== */

.References {
    position: relative;
    padding: 80px 0;
    background: #f8fafc;
    overflow: hidden;
}

.References.Section {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* خلفية القسم */
.References-BgImage {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.05;
}

.References-BgImage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*=====================================================
  SECTION HEADER
===================================================== */

.Section-Header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 55px;
    position: relative;
    z-index: 1;
}

.Section-SubTitle {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 30px;
    background: rgba(242, 140, 40, 0.10);
    color: #F28C28;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.Section-Title {
    font-size: 38px;
    font-weight: 700;
    color: #0B2B4A;
    margin-bottom: 16px;
    line-height: 1.2;
}

.Section-Description {
    font-size: 18px;
    color: #64748b;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/*=====================================================
  BRANDS GRID - STATIC LOGOS
===================================================== */

.References-Grid {
    display: grid;
    gap: 30px;
    position: relative;
    z-index: 1;
    padding: 10px 0;
}

/* عدد الأعمدة حسب عدد الماركات */
.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cols-8 {
    grid-template-columns: repeat(8, 1fr);
}

/*=====================================================
  BRAND ITEM
===================================================== */

.References-Item {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e8edf2;
    position: relative;
    min-height: 110px;
}

/* تأثير hover احترافي */
.References-Item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #F28C28;
}

.References-Item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(242, 140, 40, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.References-Item:hover::after {
    opacity: 1;
}

.References-Link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    gap: 10px;
}

/*=====================================================
  BRAND LOGO IMAGE
===================================================== */

.References-Image {
    max-width: 100%;
    max-height: 65px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: grayscale(0.8) brightness(0.9);
    opacity: 0.75;
}

.References-Item:hover .References-Image {
    filter: grayscale(0) brightness(1);
    opacity: 1;
    transform: scale(1.05);
}

/*=====================================================
  BRAND PLACEHOLDER (عند عدم وجود صورة)
===================================================== */

.References-Placeholder {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.References-Item:hover .References-Placeholder {
    background: linear-gradient(135deg, #F28C28, #d97706);
    transform: scale(1.05);
}

.Brand-Initial {
    font-size: 28px;
    font-weight: 700;
    color: #475569;
    transition: color 0.3s ease;
}

.References-Item:hover .Brand-Initial {
    color: #ffffff;
}

/*=====================================================
  BRAND NAME (يظهر عند hover)
===================================================== */

.References-Name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.3px;
}

.References-Item:hover .References-Name {
    opacity: 1;
    transform: translateY(0);
}

/*=====================================================
  RESPONSIVE
===================================================== */

/* Large Tablets */
@media (max-width: 1024px) {
    .grid-cols-8 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablets */
@media (max-width: 768px) {
    .References {
        padding: 60px 0;
    }

    .Section-Title {
        font-size: 30px;
    }

    .Section-Description {
        font-size: 16px;
    }

    .grid-cols-4,
    .grid-cols-8 {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .References-Item {
        padding: 20px 15px;
        min-height: 90px;
    }

    .References-Image {
        max-height: 50px;
    }

    .References-Placeholder {
        width: 55px;
        height: 55px;
    }

    .Brand-Initial {
        font-size: 22px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .References {
        padding: 45px 0;
    }

    .Section-Title {
        font-size: 26px;
    }

    .Section-SubTitle {
        font-size: 12px;
        padding: 4px 16px;
    }

    .grid-cols-4,
    .grid-cols-8 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .References-Item {
        padding: 15px 12px;
        min-height: 75px;
        border-radius: 12px;
    }

    .References-Image {
        max-height: 40px;
    }

    .References-Placeholder {
        width: 45px;
        height: 45px;
    }

    .Brand-Initial {
        font-size: 18px;
    }

    .References-Name {
        font-size: 11px;
    }
}

/*=====================================================
  RTL SUPPORT
===================================================== */

[dir="rtl"] .References {
    direction: rtl;
}

[dir="rtl"] .References-Item:hover {
    transform: translateY(-6px);
}

[dir="rtl"] .References-Link {
    direction: rtl;
}

[dir="rtl"] .Brand-Initial {
    font-family: inherit;
}

[dir="rtl"] .References-Name {
    font-family: inherit;
}

/*=====================================================
  ANIMATIONS
===================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.References-Item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.References-Item:nth-child(1) { animation-delay: 0.05s; }
.References-Item:nth-child(2) { animation-delay: 0.10s; }
.References-Item:nth-child(3) { animation-delay: 0.15s; }
.References-Item:nth-child(4) { animation-delay: 0.20s; }
.References-Item:nth-child(5) { animation-delay: 0.25s; }
.References-Item:nth-child(6) { animation-delay: 0.30s; }
.References-Item:nth-child(7) { animation-delay: 0.35s; }
.References-Item:nth-child(8) { animation-delay: 0.40s; }