/* ===================================
   تحسينات متقدمة لعرض الخدمات
   Advanced Services Display Enhancements
   =================================== */

/* تحسين Container الخدمات */
.services-section {
    position: relative;
    overflow: hidden;
}

.services-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.services-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108, 117, 125, 0.02) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

/* تحسين بطاقات الخدمات */
.optech-iconbox-wrap.style-two {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 45px 35px;
    margin: 25px 15px;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 1px 8px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.optech-iconbox-wrap.style-two::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color, #007bff) 0%, var(--secondary-color, #6c757d) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.optech-iconbox-wrap.style-two:hover::before {
    transform: scaleX(1);
}

.optech-iconbox-wrap.style-two:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 25px rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.2);
}

/* تحسين الأيقونات */
.optech-iconbox-icon {
    position: relative;
    margin-bottom: 30px;
    text-align: center;
    z-index: 2;
}

.optech-iconbox-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(108, 117, 125, 0.05) 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.optech-iconbox-wrap:hover .optech-iconbox-icon::before {
    transform: translate(-50%, -50%) scale(1);
}

.optech-iconbox-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
}

.optech-iconbox-wrap:hover .optech-iconbox-icon img {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 10px 25px rgba(0, 123, 255, 0.2));
}

/* تحسين المحتوى */
.optech-iconbox-data {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    z-index: 2;
}

.optech-iconbox-data h5 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
    line-height: 1.4;
    transition: all 0.3s ease;
    position: relative;
}

.optech-iconbox-data h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color, #007bff), var(--secondary-color, #6c757d));
    transform: translateX(-50%);
    transition: width 0.4s ease;
}

.optech-iconbox-wrap:hover .optech-iconbox-data h5::after {
    width: 60px;
}

.optech-iconbox-wrap:hover .optech-iconbox-data h5 {
    color: var(--primary-color, #007bff);
}

.optech-iconbox-data p {
    flex: 1;
    font-size: 16px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 25px;
    transition: color 0.3s ease;
}

.optech-iconbox-wrap:hover .optech-iconbox-data p {
    color: #555;
}

/* تحسين الأزرار */
.optech-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color, #007bff) 0%, #0056b3 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: auto;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.optech-icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.optech-icon-btn:hover::before {
    left: 100%;
}

.optech-icon-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.4);
    gap: 15px;
}

.optech-icon-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.optech-icon-btn:hover i {
    transform: translateX(3px);
}

/* تحسين العنوان الرئيسي */
.services-section .optech-section-title h2 {
    position: relative;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 60px;
    text-align: center;
}

.services-section .optech-section-title h2::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color, #007bff), var(--secondary-color, #6c757d));
    transform: translateX(-50%);
    border-radius: 2px;
}

.services-section .optech-section-title h2::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    width: 40px;
    height: 4px;
    background: #fff;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* تأثيرات الحركة المتدرجة */
.optech-iconbox-wrap:nth-child(1) {
    animation-delay: 0.1s;
}

.optech-iconbox-wrap:nth-child(2) {
    animation-delay: 0.2s;
}

.optech-iconbox-wrap:nth-child(3) {
    animation-delay: 0.3s;
}

.optech-iconbox-wrap:nth-child(4) {
    animation-delay: 0.4s;
}

.optech-iconbox-wrap:nth-child(5) {
    animation-delay: 0.5s;
}

.optech-iconbox-wrap:nth-child(6) {
    animation-delay: 0.6s;
}

/* تحسين الـ Grid */
.services-section .row {
    position: relative;
    z-index: 2;
}

.services-section .row > [class*="col-"] {
    margin-bottom: 30px;
}

/* تأثيرات إضافية للتفاعل */
.optech-iconbox-wrap.style-two:hover {
    animation: serviceCardPulse 0.6s ease-out;
}

@keyframes serviceCardPulse {
    0% {
        transform: translateY(-15px) scale(1.02);
    }
    50% {
        transform: translateY(-18px) scale(1.03);
    }
    100% {
        transform: translateY(-15px) scale(1.02);
    }
}

/* تحسين للشاشات الكبيرة */
@media (min-width: 1400px) {
    .optech-iconbox-wrap.style-two {
        min-height: 420px;
        padding: 50px 40px;
    }
    
    .optech-iconbox-icon img {
        width: 90px;
        height: 90px;
    }
    
    .optech-iconbox-data h5 {
        font-size: 24px;
    }
    
    .optech-iconbox-data p {
        font-size: 17px;
    }
}

/* تحسين للشاشات المتوسطة */
@media (max-width: 1199px) {
    .optech-iconbox-wrap.style-two {
        min-height: 360px;
        padding: 40px 30px;
        margin: 20px 10px;
    }
    
    .optech-iconbox-data h5 {
        font-size: 20px;
    }
}

/* تحسين للتابلت */
@media (max-width: 991px) {
    .optech-iconbox-wrap.style-two {
        min-height: 340px;
        padding: 35px 25px;
        margin: 15px 5px;
    }
    
    .optech-iconbox-icon img {
        width: 70px;
        height: 70px;
    }
    
    .optech-iconbox-data h5 {
        font-size: 19px;
    }
    
    .optech-iconbox-data p {
        font-size: 15px;
    }
    
    .optech-icon-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* تحسين للموبايل */
@media (max-width: 767px) {
    .services-section::before,
    .services-section::after {
        display: none;
    }
    
    .optech-iconbox-wrap.style-two {
        min-height: auto;
        padding: 30px 25px;
        margin: 15px 0;
        border-radius: 15px;
    }
    
    .optech-iconbox-icon {
        margin-bottom: 25px;
    }
    
    .optech-iconbox-icon img {
        width: 65px;
        height: 65px;
    }
    
    .optech-iconbox-data h5 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .optech-iconbox-data p {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .optech-icon-btn {
        padding: 12px 25px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }
    
    .services-section .optech-section-title h2 {
        font-size: clamp(1.75rem, 6vw, 2.2rem);
        margin-bottom: 40px;
    }
}

/* تحسين للشاشات الصغيرة جداً */
@media (max-width: 575px) {
    .optech-iconbox-wrap.style-two {
        padding: 25px 20px;
    }
    
    .optech-iconbox-icon img {
        width: 60px;
        height: 60px;
    }
    
    .optech-iconbox-data h5 {
        font-size: 17px;
    }
    
    .optech-iconbox-data p {
        font-size: 14px;
    }
}

/* تحسين للطباعة */
@media print {
    .services-section::before,
    .services-section::after {
        display: none;
    }
    
    .optech-iconbox-wrap.style-two {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .optech-icon-btn {
        display: none;
    }
}

/* تحسين Accessibility */
.optech-iconbox-wrap.style-two:focus-within {
    outline: 2px solid var(--primary-color, #007bff);
    outline-offset: 4px;
}

.optech-icon-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* تحسين للحركة المقللة */
@media (prefers-reduced-motion: reduce) {
    .optech-iconbox-wrap.style-two,
    .optech-iconbox-icon img,
    .optech-icon-btn {
        transition: none;
        animation: none;
    }
    
    .optech-iconbox-wrap.style-two:hover {
        transform: none;
    }
}

/* تحسين للوضع الداكن */
@media (prefers-color-scheme: dark) {
    .optech-iconbox-wrap.style-two {
        background: linear-gradient(145deg, #2a2a2a 0%, #1e1e1e 100%);
        border-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .optech-iconbox-data h5 {
        color: #fff;
    }
    
    .optech-iconbox-data p {
        color: #ccc;
    }
    
    .optech-iconbox-wrap:hover .optech-iconbox-data h5 {
        color: var(--primary-color, #007bff);
    }
    
    .optech-iconbox-wrap:hover .optech-iconbox-data p {
        color: #ddd;
    }
}

/* تأثير Loading للبطاقات */
.service-card-loading {
    position: relative;
    overflow: hidden;
}

.service-card-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* تحسين الأرقام والإحصائيات */
.service-number {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color, #007bff), #0056b3);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.optech-iconbox-wrap:hover .service-number {
    opacity: 1;
    transform: scale(1);
}
/* =
==================================
   زر "تعرف على المزيد" في المنتصف
   Center "Learn More" Button
   =================================== */

.services-center-btn {
    text-align: center !important;
    margin-top: 60px;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* إصلاح RTL للزر المركزي */
[dir="rtl"] .services-center-btn {
    text-align: center !important;
    justify-content: center !important;
}

[dir="rtl"] .services-main-btn {
    text-align: center !important;
    margin: 0 auto !important;
}

.services-main-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px 50px;
    background: linear-gradient(135deg, var(--primary-color, #007bff) 0%, #0056b3 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 123, 255, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 250px;
}

.services-main-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.services-main-btn:hover::before {
    left: 100%;
}

.services-main-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 20px 40px rgba(0, 123, 255, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.services-main-btn .btn-wraper {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.services-main-btn:hover .btn-wraper {
    transform: scale(1.05);
}

/* تأثير النبض */
.services-main-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.services-main-btn:hover::after {
    width: 300px;
    height: 300px;
}

/* تحسين للشاشات المختلفة */
@media (max-width: 991px) {
    .services-center-btn {
        margin-top: 50px;
    }
    
    .services-main-btn {
        padding: 18px 40px;
        font-size: 15px;
        min-width: 220px;
    }
}

@media (max-width: 767px) {
    .services-center-btn {
        margin-top: 40px;
        padding: 0 20px;
    }
    
    .services-main-btn {
        width: 100%;
        max-width: 300px;
        padding: 16px 35px;
        font-size: 14px;
        min-width: auto;
    }
}

@media (max-width: 575px) {
    .services-main-btn {
        padding: 15px 30px;
        font-size: 14px;
        letter-spacing: 0.5px;
    }
}

/* تأثير Loading */
.services-main-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.services-main-btn.loading::before {
    left: 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* تحسين Accessibility */
.services-main-btn:focus {
    outline: 3px solid rgba(0, 123, 255, 0.5);
    outline-offset: 4px;
}

/* تحسين للطباعة */
@media print {
    .services-center-btn {
        display: none;
    }
}

/* تحسين للوضع الداكن */
@media (prefers-color-scheme: dark) {
    .services-main-btn {
        background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
        box-shadow: 
            0 10px 30px rgba(0, 86, 179, 0.4),
            0 5px 15px rgba(0, 0, 0, 0.2);
    }
    
    .services-main-btn:hover {
        box-shadow: 
            0 20px 40px rgba(0, 86, 179, 0.5),
            0 10px 25px rgba(0, 0, 0, 0.25);
    }
}

/* تحسين للحركة المقللة */
@media (prefers-reduced-motion: reduce) {
    .services-main-btn,
    .services-main-btn::before,
    .services-main-btn::after,
    .services-main-btn .btn-wraper {
        transition: none;
        animation: none;
    }
    
    .services-main-btn:hover {
        transform: none;
    }
}

/* تأثير إضافي للتفاعل */
.services-main-btn:active {
    transform: translateY(-3px) scale(1.02);
    transition: transform 0.1s ease;
}

/* تحسين Typography */
.services-main-btn {
    font-family: 'DIN Next LT Arabic', 'Sora', Arial, sans-serif;
}

/* تحسين للـ RTL */
[dir="rtl"] .services-main-btn {
    direction: rtl;
}

[dir="rtl"] .services-main-btn .btn-wraper {
    direction: rtl;
}