/**
 * Enhanced Contact Section Styles
 * ملف الأنماط المحسن لقسم اتصل بنا
 * 
 * المميزات:
 * - تصميم متجاوب بالكامل
 * - دعم RTL/LTR
 * - تأثيرات بصرية متقدمة
 * - تحسين للأداء
 * - متوافق مع جميع المتصفحات
 */

/* قسم اتصل بنا الرئيسي */
#contact {
    position: relative;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 50%, #eef2ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* تأثيرات الخلفية */
#contact::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* عنوان القسم */
#contact h2 {
    background: linear-gradient(135deg, #1e40af, #3730a3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

#contact h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: 2px;
}

/* بطاقات معلومات التواصل */
.contact-card {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.contact-card::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;
}

.contact-card:hover::before {
    left: 100%;
}

.contact-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.contact-card-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.contact-card:hover .contact-card-icon {
    transform: scale(1.1) rotate(5deg);
}

/* بطاقة الهاتف */
.contact-card.phone .contact-card-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* بطاقة البريد الإلكتروني */
.contact-card.email .contact-card-icon {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* بطاقة العنوان */
.contact-card.address .contact-card-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

/* نموذج التواصل */
.contact-form {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6, #ec4899);
}

/* حقول النموذج */
.form-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-input.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.2rem;
    transition: color 0.2s ease;
    pointer-events: none;
}

.form-input:focus + .form-icon {
    color: #3b82f6;
}

/* منطقة النص */
.form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    resize: none;
    min-height: 120px;
}

.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

/* عداد الأحرف */
.character-counter {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: right;
    margin-top: 0.25rem;
}

.character-counter.warning {
    color: #f59e0b;
}

.character-counter.error {
    color: #ef4444;
}

/* زر الإرسال */
.submit-button {
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* رسائل التنبيه */
.alert {
    position: fixed;
    top: 2rem;
    right: 2rem;
    left: 2rem;
    z-index: 1000;
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.alert.show {
    transform: translateY(0);
    opacity: 1;
}

.alert.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-left: 4px solid #065f46;
}

.alert.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-left: 4px solid #991b1b;
}

/* رسائل الخطأ في الحقول */
.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    animation: shake 0.3s ease;
}

.field-error::before {
    content: '⚠';
    margin-right: 0.5rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* مؤشر التحميل */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    #contact {
        padding: 3rem 0;
        min-height: 100vh;
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .contact-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    #contact h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .form-input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
        font-size: 1rem;
    }
    
    .submit-button {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .alert {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1200px) {
    .contact-form {
        padding: 4rem;
    }
    
    .contact-card {
        padding: 2.5rem;
    }
}

/* دعم الوضع المظلم */
@media (prefers-color-scheme: dark) {
    #contact {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    }
    
    .contact-card {
        background: rgba(30, 41, 59, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .contact-form {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .form-input,
    .form-textarea {
        background: rgba(15, 23, 42, 0.8);
        border-color: #374151;
        color: #f9fafb;
    }
    
    .form-label {
        color: #f3f4f6;
    }
    
    #contact h2 {
        background: linear-gradient(135deg, #60a5fa, #a78bfa);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* تحسينات إضافية للأداء */
.contact-card,
.contact-form {
    will-change: transform;
}

.form-input,
.form-textarea,
.submit-button {
    will-change: border-color, box-shadow;
}

/* تأثيرات التركيز للوصولية */
.form-input:focus,
.form-textarea:focus,
.submit-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* انتقالات سلسة للوضع المظلم */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}