/* Testimonials Section Styles */
#testi-sec {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

#testi-sec::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.testi-head {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.testi-head h2 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.testi-head p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.testi-slider {
    position: relative;
    z-index: 2;
    max-width: 800px; /* تحديد العرض الأقصى لضمان عرض تعليقين بشكل جميل */
    margin: 0 auto;
}

.testi-item {
    padding: 0 15px;
}

.testi-content {
    background: #fff;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%; /* ضمان ارتفاع موحد */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testi-content::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    color: #667eea;
    font-family: serif;
    opacity: 0.1;
}

.testi-content:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.testi-img {
    margin-bottom: 25px;
}

.testi-img img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    /* Force image reload */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Prevent image caching issues */
    max-width: 100%;
    height: auto;
}

/* Fallback for images that fail to load */
.testi-img img:not([src]), 
.testi-img img[src=""],
.testi-img img[src*="unsplash"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.testi-img img:not([src])::after, 
.testi-img img[src=""]::after,
.testi-img img[src*="unsplash"]::after {
    content: '👤';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: white;
}

.testi-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testi-text p {
    color: #555;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    font-style: italic;
    position: relative;
    z-index: 1;
    flex: 1;
}

.testi-text h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.testi-text span {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Slick Carousel Custom Styles */
.testi-slider .slick-dots {
    bottom: -50px;
}

.testi-slider .slick-dots li button:before {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    opacity: 1;
}

.testi-slider .slick-dots li.slick-active button:before {
    color: #fff;
}

.testi-slider .slick-prev,
.testi-slider .slick-next {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
}

.testi-slider .slick-prev:hover,
.testi-slider .slick-next:hover {
    background: rgba(255,255,255,0.3);
}

.testi-slider .slick-prev:before,
.testi-slider .slick-next:before {
    font-size: 20px;
    color: #fff;
}

/* تحسين عرض تعليقين */
.testi-slider .slick-track {
    display: flex;
    align-items: stretch;
}

.testi-slider .slick-slide {
    height: auto;
}

.testi-slider .slick-slide > div {
    height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    #testi-sec {
        padding: 60px 0;
    }
    
    .testi-head h2 {
        font-size: 2rem;
    }
    
    .testi-head p {
        font-size: 1rem;
    }
    
    .testi-content {
        padding: 30px 20px;
    }
    
    .testi-img img {
        width: 70px;
        height: 70px;
    }
    
    .testi-text p {
        font-size: 0.95rem;
    }
    
    .testi-text h4 {
        font-size: 1.1rem;
    }
    
    .testi-slider {
        max-width: 100%; /* إزالة القيد في الشاشات الصغيرة */
    }
}

@media (max-width: 576px) {
    .testi-head h2 {
        font-size: 1.8rem;
    }
    
    .testi-content {
        padding: 25px 15px;
    }
    
    .testi-img img {
        width: 60px;
        height: 60px;
    }
}

/* RTL Support */
[dir="rtl"] .testi-content::before {
    left: auto;
    right: 20px;
}

[dir="rtl"] .testi-slider .slick-prev {
    left: auto;
    right: -60px;
}

[dir="rtl"] .testi-slider .slick-next {
    right: auto;
    left: -60px;
}

/* Language-specific font families */
html[lang="ar"] #testi-sec {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="ar"] .testi-head h2,
html[lang="ar"] .testi-text h4,
html[lang="ar"] .testi-text span {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="de"] #testi-sec {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="it"] #testi-sec {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="ru"] #testi-sec {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
} 