/**
 * CTA Section Styles - Object-Oriented CSS Architecture
 * قسم الدعوة لاتخاذ إجراء - بنية CSS كائنية التوجه
 * 
 * Structure:
 * - Base Component (.cta-section)
 * - Layout Modifiers (.cta-section--enhanced)
 * - Elements (.cta-section__title, .cta-section__button)
 * - State Modifiers (.cta-section__button--primary)
 */

/* ========================================
   Base Component - المكون الأساسي
   ======================================== */

.cta-section {
    position: relative;
    padding: 5rem 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    overflow: hidden;
}

/* ========================================
   Background Effects - تأثيرات الخلفية
   ======================================== */

.cta-section__background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.cta-section__gradient {
    position: absolute;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: cta-float 8s ease-in-out infinite;
}

.cta-section__gradient--top-right {
    top: -6rem;
    right: -6rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(139, 92, 246, 0.2) 100%);
}

.cta-section__gradient--bottom-left {
    bottom: -6rem;
    left: -6rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    animation-delay: 2s;
}

.cta-section__gradient--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    animation-delay: 4s;
}

/* Decorative Particles */
.cta-section__particles {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.cta-section__particle {
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.4), rgba(139, 92, 246, 0.3));
    opacity: 0.25;
    animation: cta-particle-float 6s ease-in-out infinite;
}

.cta-section__particle:nth-child(1) {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.cta-section__particle:nth-child(2) {
    top: 60%;
    right: 20%;
    animation-delay: 1.5s;
}

.cta-section__particle:nth-child(3) {
    bottom: 30%;
    left: 25%;
    animation-delay: 3s;
}

.cta-section__particle:nth-child(4) {
    top: 40%;
    right: 30%;
    width: 0.75rem;
    height: 0.75rem;
    animation-delay: 2s;
}

/* ========================================
   Content Container - حاوية المحتوى
   ======================================== */

.cta-section__container {
    position: relative;
    z-index: 10;
    max-width: 56rem;
    margin: 0 auto;
    text-align: center;
}

/* ========================================
   Title Elements - عناصر العنوان
   ======================================== */

.cta-section__title {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    background: linear-gradient(135deg, #0891b2 0%, #7c3aed 50%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: cta-gradient-shift 8s ease-in-out infinite;
    background-size: 200% 200%;
}

/* Adjust spacing for LTR - ضبط المسافات للغات LTR */
[dir="ltr"] .cta-section__title {
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

/* RTL spacing */
[dir="rtl"] .cta-section__title {
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
}

/* Responsive Title Sizes */
@media (min-width: 768px) {
    .cta-section__title {
        font-size: 2.5rem;
    }
    
    /* تقليل حجم الخط في اللغة الإنجليزية */
    [dir="ltr"] .cta-section__title {
        font-size: 2rem;
    }
}

@media (min-width: 1024px) {
    .cta-section__title {
        font-size: 2.75rem;
    }
    
    /* تقليل حجم الخط في اللغة الإنجليزية */
    [dir="ltr"] .cta-section__title {
        font-size: 2.25rem;
    }
}

/* Title with Icon */
.cta-section__title-icon {
    display: inline-block;
    margin-left: 0.75rem;
    font-size: 0.9em;
    animation: cta-icon-bounce 2s ease-in-out infinite;
}

/* ========================================
   Decorative Divider - الفاصل الزخرفي
   ======================================== */

.cta-section__divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #0891b2 0%, #7c3aed 50%, #db2777 100%);
    margin: 1.5rem auto;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.cta-section__divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: divider-shine 3s ease-in-out infinite;
}

@keyframes divider-shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* ========================================
   Description - الوصف
   ======================================== */

.cta-section__description {
    font-size: 1rem;
    line-height: 1.75;
    color: #4b5563;
    margin-bottom: 2rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

/* Consistent spacing for both languages */
[dir="ltr"] .cta-section__description {
    margin-bottom: 2rem;
}

[dir="rtl"] .cta-section__description {
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .cta-section__description {
        font-size: 1.125rem;
    }
}

/* ========================================
   Button Container - حاوية الأزرار
   ======================================== */

.cta-section__buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

@media (min-width: 640px) {
    .cta-section__buttons {
        flex-direction: row;
    }
}

/* ========================================
   Button Base - الزر الأساسي
   ======================================== */

.cta-section__button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 2rem;
    font-weight: 700;
    font-size: 0.9375rem;
    border-radius: 9999px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.cta-section__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Button Icon */
.cta-section__button-icon {
    transition: transform 0.3s ease;
}

.cta-section__button:hover .cta-section__button-icon {
    transform: translateX(-0.25rem);
}

/* ========================================
   Button Variants - أنواع الأزرار
   ======================================== */

/* Primary Button */
.cta-section__button--primary {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.cta-section__button--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.cta-section__button--primary:hover::before {
    opacity: 1;
}

.cta-section__button--primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cta-section__button--primary:hover::after {
    opacity: 1;
}

/* Secondary Button */
.cta-section__button--secondary {
    background: #ffffff;
    color: #1f2937;
    border-color: #e5e7eb;
}

.cta-section__button--secondary:hover {
    border-color: #06b6d4;
    color: #0891b2;
}

/* Button Text */
.cta-section__button-text {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* ========================================
   Enhanced Variant - النسخة المحسنة
   ======================================== */

.cta-section--enhanced {
    background: linear-gradient(135deg, #fefefe 0%, #ffffff 50%, #f9fbff 100%);
}

.cta-section--enhanced .cta-section__title {
    position: relative;
    display: inline-block;
}

.cta-section--enhanced .cta-section__title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #06b6d4, #8b5cf6, #ec4899, transparent);
    border-radius: 9999px;
    animation: cta-underline-expand 3s ease-in-out infinite;
}

/* RTL (Arabic) needs more spacing for proper visual balance */
[dir="rtl"] .cta-section--enhanced .cta-section__title::after {
    bottom: -0.75rem;
}

/* ========================================
   Animations - الحركات
   ======================================== */

@keyframes cta-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(10px, -10px) scale(1.05);
    }
    50% {
        transform: translate(-5px, 5px) scale(0.95);
    }
    75% {
        transform: translate(8px, -8px) scale(1.02);
    }
}

@keyframes cta-particle-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.25;
    }
    50% {
        transform: translateY(-15px) scale(1.1);
        opacity: 0.4;
    }
}

@keyframes cta-gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes cta-icon-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes cta-underline-expand {
    0%, 100% {
        width: 60%;
        opacity: 0.8;
    }
    50% {
        width: 80%;
        opacity: 1;
    }
}

/* ========================================
   RTL Support - دعم العربية
   ======================================== */

[dir="rtl"] .cta-section__button:hover .cta-section__button-icon {
    transform: translateX(0.25rem);
}

[dir="rtl"] .cta-section__title-icon {
    margin-left: 0;
    margin-right: 0.75rem;
}

/* ========================================
   Accessibility - إمكانية الوصول
   ======================================== */

.cta-section__button:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

.cta-section__button:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cta-section__gradient,
    .cta-section__particle,
    .cta-section__title,
    .cta-section__title-icon,
    .cta-section__button-icon {
        animation: none;
    }
    
    .cta-section__button:hover {
        transform: none;
    }
}

/* ========================================
   Print Styles - أنماط الطباعة
   ======================================== */

@media print {
    .cta-section__background,
    .cta-section__particles {
        display: none;
    }
    
    .cta-section {
        background: #ffffff;
        padding: 2rem 1rem;
    }
}
