/*
Theme Name: osooli Real Estate Theme
Theme URI: https://osooli.net
Author: osooli
Description: قالب مخصص ليتماشى مع إضافة العقارات
Version: 1.0
Text Domain: osooli-theme
*/

:root {
  --primary-color: #008a5f;
  --secondary-color: #002c4b;
  --accent-color: #f39c12;
  --light-bg: #f9f9f9;
  --dark-text: #1a1a1a;
  --light-text: #666;
  --white: #ffffff;
  --error-color: #e53e3e;
  --font-main: "tajawal", Arial, sans-serif, cairo;
}

/* =======================
   أنماط عامة للصفحات
======================= */
body {
  font-family: var(--font-main);
  color: var(--dark-text);
  background-color: var(--light-bg);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* تخصيص لون اللوجو */
.nospercent-header .logo h1 {
  color: var(--white) !important;
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

/* العناوين (افتراضياً أبيض فقط داخل الهيدر) */
header h1, 
header h2, 
header h3, 
header h4, 
header h5, 
header h6 {
  font-weight: 700;
  color: var(--white);
  margin-bottom: 15px;
}

/* استثناء صفحة اتصل بنا */
.contact-page h1,
.contact-page h2,
.contact-page h3,
.contact-page h4,
.contact-page h5,
.contact-page h6 {
  color: var(--primary-color) !important;
  margin-top: 0 !important;  /* إلغاء الفراغ فوق أول عنوان */
}

/* الروابط */
a {
  color: var(--secondary-color);
  text-decoration: none;
}
a:hover {
  color: var(--accent-color);
}

/* الحاوية */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* =======================
   أزرار الديسكتوب
======================= */
@media (min-width: 768px) {
  button,
  .btn,
  input[type="submit"],
  .elementor-button {
    display: inline-block !important;
    width: auto !important;
    min-width: 160px !important;
    max-width: none !important;
    margin: 8px 12px !important;
    text-align: center !important;
  }
}

/* =======================
   تحسين العنوان في نافذة المساعد
======================= */
.reaia-chat-header h3 {
    font-size: 16px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    color: var(--dark-text) !important;
}

/* تصغير العنوان على الموبايل */
@media (max-width: 480px) {
    .reaia-chat-header h3 {
        font-size: 14px !important;
    }
}

/* =======================
   تكبير الخطوط داخل الكروت على الموبايل
======================= */
@media (max-width: 480px) {
    .reaia-property-title {
        font-size: 15px !important;
    }
    .reaia-price-value {
        font-size: 17px !important;
    }
    .reaia-property-location,
    .reaia-property-specs,
    .reaia-property-type {
        font-size: 13px !important;
    }
    .reaia-message-content {
        font-size: 14px !important;
    }
}

/* =======================
   ضبط مقاسات نافذة المساعد
======================= */

/* إصلاح لون العنوان ومنطقة الكتابة */
.reaia-chat-header h3 {
    color: var(--white) !important;
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-align: center !important;
    padding: 0 10px !important;
}

/* إدخال الرسائل */
.reaia-chat-input {
    padding: 15px 20px !important;
    gap: 15px !important;
}
.reaia-chat-input input {
    flex: 1 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
}

/* زر الإرسال */
.reaia-send-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex-shrink: 0 !important;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 480px) {
    .reaia-chat-widget {
        width: 94vw !important;
        height: 70vh !important;
        max-height: 70vh !important;
        bottom: 70px !important;
        right: 3vw !important;
    }
    .reaia-chat-input {
        padding: 12px 15px !important;
        gap: 12px !important;
    }
    .reaia-chat-input input {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
    .reaia-send-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
    }
    .reaia-chat-header h3 {
        font-size: 15px !important;
        color: var(--white) !important;
    }
}

/* زر الإغلاق */
.reaia-close-btn {
    width: 30px !important;
    min-width: 30px !important;
    flex-shrink: 0 !important;
}

/* إظهار/إخفاء نافذة المساعد */
.reaia-chat-widget:not(.active) {
    display: none !important;
}
.reaia-chat-widget.active {
    display: flex !important;
}

/* الزر الدائري للغات */
.language-icon .gt_selector {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    border-radius: 50% !important;
    font-size: 12px !important;
    font-weight: bold !important;
    line-height: 36px !important;
    text-align: center !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    background: #002c4b !important;
    color: #fff !important;
}

/* أنماط أكثر قوة وتحديداً */
html[lang="en"] .nospercent-about-platform,
html[lang="en"] .nospercent-terms-platform {
    direction: ltr !important;
}

/* إضافة صفحة تواصل معنا */
html[lang="en"] .contact-page,
html[lang="en"] .nospercent-contact-platform {
    direction: ltr !important;
}

/* حل بديل بدون استخدام order */
html[lang="en"] .feature-header:not(.nospercent-homepage .feature-header),
html[lang="en"] .relation-item,
html[lang="en"] .service-item {
    display: flex !important;
    align-items: flex-start !important;
    flex-direction: row !important;
    gap: 8px !important;
    margin-bottom: 6px !important;
}

html[lang="en"] .feature-icon:not(.nospercent-homepage .feature-icon),
html[lang="en"] .relation-icon,
html[lang="en"] .service-icon {
    margin-left: 8px !important;
    margin-right: 0 !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
}

/* تحسين النص في الصفحات الأخرى */
html[lang="en"] .nospercent-about-platform .feature-card p,
html[lang="en"] .nospercent-terms-platform .feature-card p,
html[lang="en"] .nospercent-about-platform .relation-item p,
html[lang="en"] .nospercent-terms-platform .relation-item p {
    margin-top: 6px !important;
    line-height: 1.5 !important;
}

/* =====================================================
   إصلاح قسم "معلومات التواصل" في صفحة تواصل معنا
   ===================================================== */
html[lang="en"] .contact-content,
html[lang="en"] .contact-info,
html[lang="en"] .contact-method {
    direction: ltr !important;
    text-align: left !important;
}

html[lang="en"] .contact-method {
    display: flex !important;
    align-items: flex-start !important;
    flex-direction: row !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
}

html[lang="en"] .contact-icon {
    margin-left: 0 !important;
    margin-right: 0 !important;
    order: 1 !important;
    flex-shrink: 0 !important;
}

html[lang="en"] .contact-details {
    order: 2 !important;
    text-align: left !important;
    direction: ltr !important;
}

html[lang="en"] .contact-details h3,
html[lang="en"] .contact-details p {
    text-align: left !important;
    direction: ltr !important;
    margin: 0 !important;
}

html[lang="en"] .contact-details h3 {
    margin-bottom: 5px !important;
}

/* إصلاح وسائل التواصل الاجتماعي */
html[lang="en"] .social-contact {
    direction: ltr !important;
    text-align: left !important;
}

html[lang="en"] .social-contact h3 {
    text-align: left !important;
    margin-bottom: 15px !important;
}

html[lang="en"] .social-links {
    display: flex !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    direction: ltr !important;
}

html[lang="en"] .social-links a {
    margin: 0 !important;
}

/* =====================================================
   تحسينات للهاتف (<= 768px)
   ===================================================== */
@media (max-width: 768px) {
    html[lang="en"] .feature-header:not(.nospercent-homepage .feature-header),
    html[lang="en"] .relation-item,
    html[lang="en"] .service-item {
        gap: 6px !important;
        margin-bottom: 4px !important;
    }
    
    html[lang="en"] .feature-icon:not(.nospercent-homepage .feature-icon),
    html[lang="en"] .relation-icon,
    html[lang="en"] .service-icon {
        margin-left: 6px !important;
        margin-top: 1px !important;
    }
    
    html[lang="en"] .nospercent-about-platform .feature-card p,
    html[lang="en"] .nospercent-terms-platform .feature-card p {
        margin-top: 4px !important;
        line-height: 1.4 !important;
    }
    
    /* تحسينات الهاتف لصفحة تواصل معنا */
    html[lang="en"] .contact-method {
        gap: 12px !important;
        margin-bottom: 15px !important;
    }
    
    html[lang="en"] .social-links {
        gap: 8px !important;
        justify-content: center !important;
    }
}

/* =====================================================
   تحسينات للتابلت (769px - 1024px)
   ===================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    html[lang="en"] .feature-header:not(.nospercent-homepage .feature-header),
    html[lang="en"] .relation-item,
    html[lang="en"] .service-item {
        gap: 7px !important;
        margin-bottom: 5px !important;
    }
    
    html[lang="en"] .feature-icon:not(.nospercent-homepage .feature-icon),
    html[lang="en"] .relation-icon,
    html[lang="en"] .service-icon {
        margin-left: 7px !important;
    }
    
    html[lang="en"] .nospercent-about-platform .feature-card p,
    html[lang="en"] .nospercent-terms-platform .feature-card p {
        margin-top: 5px !important;
        line-height: 1.5 !important;
    }
    
    /* تحسينات التابلت لصفحة تواصل معنا */
    html[lang="en"] .contact-method {
        gap: 14px !important;
        margin-bottom: 18px !important;
    }
}

/* =====================================================
   تحسينات للديسكتوب (1025px+)
   ===================================================== */
@media (min-width: 1025px) {
    html[lang="en"] .feature-header:not(.nospercent-homepage .feature-header),
    html[lang="en"] .relation-item,
    html[lang="en"] .service-item {
        gap: 8px !important;
        margin-bottom: 6px !important;
    }
    
    html[lang="en"] .feature-icon:not(.nospercent-homepage .feature-icon),
    html[lang="en"] .relation-icon,
    html[lang="en"] .service-icon {
        margin-left: 8px !important;
    }
    
    /* تحسينات الديسكتوب لصفحة تواصل معنا */
    html[lang="en"] .contact-method {
        gap: 15px !important;
        margin-bottom: 20px !important;
    }
}

/* استثناء قسم ال features في الصفحة الرئيسية */
html[lang="en"] .nospercent-homepage .unique-features .feature-header {
    flex-direction: column !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
}

html[lang="en"] .nospercent-homepage .unique-features .feature-icon {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 6px !important;
}

/* إصلاح صفحة المفضلة في الـ LTR */
html[lang="en"] .nospercent-favorites-wrapper {
    direction: ltr !important;
    text-align: left !important;
}

html[lang="en"] .nospercent-favorites-header,
html[lang="en"] .nospercent-favorites-header h1,
html[lang="en"] .nospercent-favorites-header p {
    direction: ltr !important;
    text-align: center !important;
}

html[lang="en"] .nospercent-favorites-header h1 {
    flex-direction: row !important;
}

html[lang="en"] .nospercent-favorites-header h1 i {
    margin-left: 0 !important;
    margin-right: 15px !important;
}

/* إصلاح كروت العقارات */
html[lang="en"] .nospercent-property-card-new {
    direction: ltr !important;
    text-align: left !important;
}

html[lang="en"] .property-badges {
    right: 15px !important;
    left: auto !important;
}

html[lang="en"] .favorite-icon-wrapper {
    left: 15px !important;
    right: auto !important;
}

html[lang="en"] .views-counter {
    left: 55px !important;
    right: auto !important;
}

/* إصلاح المحتوى */
html[lang="en"] .property-title,
html[lang="en"] .property-location,
html[lang="en"] .property-price-section,
html[lang="en"] .property-details-grid {
    direction: ltr !important;
    text-align: left !important;
}

html[lang="en"] .property-location {
    justify-content: flex-start !important;
}

html[lang="en"] .detail-item {
    direction: ltr !important;
    text-align: left !important;
}

html[lang="en"] .detail-content {
    align-items: flex-start !important;
}

/* إصلاح زر عرض التفاصيل - إرجاعه للوسط */
html[lang="en"] .property-footer {
    direction: ltr !important;
    text-align: center !important; /* التصحيح هنا */
}

/* إصلاح الأزرار */
html[lang="en"] .property-btn-new,
html[lang="en"] .nospercent-btn-new {
    direction: ltr !important;
    flex-direction: row-reverse !important;
    justify-content: center !important; /* إضافة لتوسيط الزر */
    margin: 0 auto !important; /* توسيط الزر */
}

html[lang="en"] .property-btn-new .btn-icon,
html[lang="en"] .nospercent-btn-new i {
    margin-left: 0 !important;
    margin-right: 8px !important;
    transform: rotate(180deg) !important;
}

html[lang="en"] .property-btn-new:hover .btn-icon {
    transform: rotate(180deg) translateX(-5px) !important;
}

/* إصلاح الحالات الفارغة */
html[lang="en"] .nospercent-empty-state-new {
    direction: ltr !important;
    text-align: center !important;
}

/* تحسينات للهاتف */
@media (max-width: 768px) {
    html[lang="en"] .nospercent-favorites-header h1 {
        flex-direction: row !important;
    }
    
    html[lang="en"] .property-badges {
        right: 12px !important;
        left: auto !important;
    }
    
    html[lang="en"] .favorite-icon-wrapper {
        left: 12px !important;
        right: auto !important;
    }
    
    html[lang="en"] .views-counter {
        left: 50px !important;
        right: auto !important;
    }
    
    /* تأكيد توسيط الأزرار في الهاتف */
    html[lang="en"] .property-footer {
        text-align: center !important;
    }
    
    html[lang="en"] .property-btn-new {
        justify-content: center !important;
        margin: 0 auto !important;
    }
}