:root {
    --primary: #34143D;
    --primary-color:#8B2B54;
    --primary-light:#e7f1ff;
    --accent: #8B2B54;
    --bg-light: #F6F0F8;
    --text-dark: #2c3e50;
    --muted: #7A5B75; /* نص ثانوي بنفسجي */

}

* {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}


.card {
    border: none;
    border-radius: 12px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
}

.progress {
    height: 8px;
    border-radius: 10px;
}

.match-card {
    transition: transform 0.2s;
}

.match-card:hover {
    transform: translateY(-5px);
}

.profile-completion {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
}

.blur-image {
    filter: blur(20px);
    transition: filter 0.3s;
}

/* فقاعات الشات - نسخة موحدة */
.chat-message{
  max-width:75%;
  margin-bottom:12px;
  padding:10px 14px;
  border-radius:18px;
  line-height:1.6;
  word-wrap:break-word;
}
.chat-message.sent{
  background-color:#34143D;
  color:#fff;
  margin-left:auto;
  border-bottom-right-radius:4px;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
}
.chat-message.received{
  background-color:#F6F0F8;
  color:#34143D;
  margin-right:auto;
  border-bottom-left-radius:4px;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.chat-message small{font-size:12px;opacity:.8}
@media (max-width:768px){ .chat-message{max-width:85%} }


.plan-card {
    border: 2px solid transparent;
    transition: all 0.3s;
}

.plan-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(139, 43, 84, 0.2);
}

.plan-card.featured {
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(139, 43, 84, 0.15);
}

.footer-links a {
    color: var(--text-dark);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* RTL Enhancements */
.text-end {
    text-align: right !important;
}


/* ============ حقل الكتابة وزر الإرسال ============ */
#messageInput {
  border-radius: 20px;
  resize: none;
  border: 1px solid #dee2e6;
  padding: 10px 15px;
  font-size: 14px;
}

#messageInput:focus {
  border-color: #8B2B54;
  box-shadow: 0 0 0 0.2rem rgba(139, 43, 84, 0.15);
}

/* زر الإرسال */
#chatForm .btn-primary {
  background-color: #8B2B54;   /* اللون الثانوي */
  border-color: #8B2B54;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  margin-left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

#chatForm .btn-primary:hover {
  background-color: #a43c69;
  border-color: #a43c69;
  transform: scale(1.05);
}

#chatForm .btn-primary:active {
  transform: scale(0.95);
}

/* ============ منطقة الدردشة ============ */
#chatMessages {
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

/* زر تحميل أقدم */
#loadMoreBtn {
  border-radius: 30px;
  padding: 4px 14px;
  font-size: 13px;
  transition: all 0.2s ease;
}

#loadMoreBtn:hover {
  background-color: #f8f9fa;
  border-color: #8B2B54;
  color: #8B2B54;
}

#loadMoreBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============ قائمة المحادثات ============ */
.conv-list .conv-item {
  border: 0;
  border-bottom: 1px solid rgba(52,20,61,.08);
  padding-top: 12px;
  padding-bottom: 12px;
  transition: all 0.2s ease;
}

.conv-list .conv-item:last-child {
  border-bottom: 0;
}

.conv-list .conv-item:hover {
  background-color: #F6F0F8;
  transform: translateX(-2px);
}

/* ============ أفاتار أحرف ============ */
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  user-select: none;
  flex-shrink: 0;
}

.avatar-soft {
  background: rgba(139,43,84,.12);          /* من لون accent */
  color: #8B2B54;
  border: 1px solid rgba(139,43,84,.22);
}

/* ألوان متنوعة للأفاتار (اختياري) */
.avatar-purple { background: rgba(139,43,84,.12); color: #8B2B54; }
.avatar-blue { background: rgba(13,110,253,.12); color: #0d6efd; }
.avatar-green { background: rgba(25,135,84,.12); color: #198754; }
.avatar-orange { background: rgba(253,126,20,.12); color: #fd7e14; }

/* ============ بادج غير المقروء ============ */
.badge-unread {
  min-width: 26px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  font-size: 11px;
  padding: 4px 8px;
}

/* ============ عناوين وألوان عامة ============ */
h2.text-primary, .text-primary { 
  color: #34143D !important; 
}

.btn-primary {
  background-color: #8B2B54;
  border-color: #8B2B54;
}

.btn-primary:hover {
  background-color: #a43c69;
  border-color: #a43c69;
}

.btn-outline-primary {
  color: #8B2B54;
  border-color: #8B2B54;
}

.btn-outline-primary:hover {
  background-color: #8B2B54;
  border-color: #8B2B54;
  color: #fff;
}

/* ============ Card تحسينات ============ */
.card.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(52,20,61,.075) !important;
}

.card.border-0 {
  border: none !important;
}

.card.rounded-3 {
  border-radius: 0.5rem !important;
}

.card-header.bg-white {
  background-color: #fff !important;
}

/* ============ زر الخيارات (ثلاث نقاط) ============ */
.dropdown-toggle::after {
  display: none;
}

.dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  border: 1px solid rgba(0,0,0,.05);
}

.dropdown-item {
  padding: 8px 16px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #F6F0F8;
  color: #8B2B54;
}

.dropdown-item.text-danger:hover {
  background-color: #f8d7da;
  color: #dc3545;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {

  
  .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  
  #chatForm .btn-primary {
    width: 40px;
    height: 40px;
  }
}

/* ============ الوضع الداكن (اختياري) ============ */
body.dark-mode .chat-message.sent {
  background-color: #8B2B54;
}

body.dark-mode .chat-message.received {
  background-color: #2c2c2c;
  color: #fff;
}

body.dark-mode #chatMessages {
  background-color: #1a1a1a;
  border-color: #333;
}

body.dark-mode .conv-list .conv-item {
  border-color: rgba(255,255,255,.08);
}

body.dark-mode .conv-list .conv-item:hover {
  background-color: #2c2c2c;
}

/* ============ تحسينات إضافية ============ */

/* تحسين شريط التمرير */
#chatMessages::-webkit-scrollbar {
  width: 8px;
}

#chatMessages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#chatMessages::-webkit-scrollbar-thumb {
  background: #8B2B54;
  border-radius: 10px;
}

#chatMessages::-webkit-scrollbar-thumb:hover {
  background: #a43c69;
}

/* تحسين حقل البحث */
#convSearch {
  border-radius: 20px;
  padding: 6px 15px;
  border: 1px solid #dee2e6;
}

#convSearch:focus {
  border-color: #8B2B54;
  box-shadow: 0 0 0 0.2rem rgba(139, 43, 84, 0.15);
}

/* تحسين الأزرار الصغيرة */
.btn-sm {
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
}

/* تحسين الفواصل */
.dropdown-divider {
  margin: 0.5rem 0;
  border-top: 1px solid rgba(0,0,0,.08);
}

/* تحسين النصوص */
.fw-semibold {
  font-weight: 600;
}

.fw-bold {
  font-weight: 700;
}

/* تحسين المسافات */
.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

/* إصلاح ترتيب RTL للمحادثات */
/* عكس اتجاه الصف الخارجي فقط */
.conv-item .conv-row{ flex-direction: row-reverse; }
.conv-item .conv-row .avatar{ margin-right:1rem }

.conv-item .avatar {
  order: 1;
  margin-left: 0;
  margin-right: 1rem;
}

.conv-item .flex-grow-1 {
  order: 2;
}

  /* بطاقات أنيقة */
  .form-section{background:#fff;border-radius:1rem;padding:1.25rem;box-shadow:0 6px 16px rgba(0,0,0,.06);}

  /* عنوان الكارد: أيقونة + عنوان + وصف */
  .section-head{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem;}
  .section-head .icon{
    width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;
    background:#F1F5F9; /* رمادي فاتح */
  }
  .section-head .icon i{font-size:1rem;}
  .section-head .title{margin:0;font-size:1.05rem;font-weight:700;}
  .section-head .sub{font-size:.875rem;color:#6b7280;} /* رمادي */

  /* أزرار الاختيار (btn-check) كشرائح ناعمة */
  .btn-check:checked + .btn{color:#fff;}
  .pill{border-radius:999px !important;padding:.35rem .9rem !important;}
  .btn-outline-primary.pill{border-width:1.5px;}
  /* مسافات التفاف جميلة */
  .choices-wrap{display:flex;flex-wrap:wrap;gap:.5rem;}

  /* الحاوية العامة للكارد */
.form-section {
  background:#fff;
  border-radius:1rem;
  padding:1.25rem;
  box-shadow:0 6px 16px rgba(0,0,0,.05);
}

/* رأس القسم */
.section-head {
  display:flex;
  align-items:center;
  gap:.75rem;
  margin-bottom:1rem;
  border-bottom: var(--primary-light) 1px solid;
  padding-bottom: 5px;
}

.section-head .icon {
  width:42px;
  height:42px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#8B2B54;
}

.section-head .title {
  margin:0;
  font-size:1.05rem;
  font-weight:700;
  color:#8B2B54; /* رمادي غامق مريح للقراءة */
}

.section-head .sub {
  font-size:.875rem;
  color:#64748b; /* رمادي متوسط */
}

/* الكبسولات (أزرار الاهتمامات والعادات) */
.btn-check:checked + .btn {
  color:#fff;
}
.btn-outline-primary.pill {
  border-color:var(--primary-color);
  color:var(--primary-color);
}
.btn-outline-primary.pill:hover {
  background:var(--primary-color);
  color:#fff;
}
.btn-primary.pill {
  background:var(--primary-color);
  border-color:var(--primary-color);
  color:#fff;
}
.pill {
  border-radius:999px !important;
  padding:.35rem .9rem !important;
}

/* ========== Generic Content Pages ========== */
.page-content .card {
  border-radius: 16px;
}

.page-content .card-body {
  padding: 2.5rem !important;
}

/* عنوان الصفحة */
.page-content h1 {
  font-size: 1.8rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  font-weight: 700;
}

/* منطقة المحتوى المحقونة من الـ DB */
.page-content .content {
  direction: rtl;
  text-align: right;
  font-size: 1rem;
  line-height: 1.9;
}

/* فقرات */
.page-content .content p {
  margin: 0 0 1rem;
}

/* عناوين داخل المحتوى */
.page-content .content h2,
.page-content .content h3,
.page-content .content h4 {
  margin: 1.6rem 0 0.75rem;
  line-height: 1.4;
  font-weight: 700;
}

.page-content .content h2 { font-size: 1.35rem; }
.page-content .content h3 { font-size: 1.15rem; }
.page-content .content h4 { font-size: 1.05rem; }

/* فاصل لطيف تحت h2 (اختياري) */
.page-content .content h2 {
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(255,255,255,0.12); /* للداكن */
  /* للفاتح: rgba(0,0,0,0.08) */
}

/* قوائم */
.page-content .content ul,
.page-content .content ol {
  padding-right: 1.25rem;
  margin: 0.75rem 0 1rem;
}

.page-content .content li {
  margin-bottom: 0.4rem;
}

/* روابط */
.page-content .content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* اقتباس/تنبيه */
.page-content .content blockquote {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-right: 4px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
}

/* جداول داخل المحتوى (لو موجودة) */
.page-content .content table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
}

.page-content .content th,
.page-content .content td {
  padding: .75rem;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  vertical-align: top;
}

.page-content .content th {
  font-weight: 700;
}

/* صور */
.page-content .content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: .75rem 0;
}
