:root {
  /* ألوان النظام الأساسية (Design System) — استخدم هذه المتغيرات في أي CSS جديد
     بدل كتابة قيم Hex مباشرة، عشان لو غيّرنا الهوية البصرية نغيرها من مكان واحد */
  --primary: #6D28D9;        /* اللون الأساسي — أزرار، روابط، عناصر تفاعلية */
  --primary-dark: #2E1065;   /* للعناوين الكبيرة والفوتر */
  --primary-light: #7C3AED;
  --secondary: #F5A623;      /* اللون الثانوي (لون إبرة البوصلة) — تمييز واهتمام */
  --secondary-light: #F7D9A0;
  --success: #1B8A4C;
  --success-bg: #E5F7EC;
  --error: #B3261E;
  --error-bg: #FBE3E3;

  /* الأسماء القديمة لسه شغالة (alias) عشان مايحصلش كسر في أي كود مكتوب بيها قبل كده */
  --purple-900: var(--primary-dark);
  --purple-700: #5B21B6;
  --purple-600: var(--primary);
  --purple-500: var(--primary-light);
  --purple-100: #EDE4FB;
  --purple-50: #F7F3FE;

  --ink: #1E1B29;
  --gray: #6B6577;
  --line: #E7E1F2;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(91, 33, 182, 0.10);
  --shadow-lg: 0 16px 40px rgba(46, 16, 101, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Cairo', 'Tahoma', sans-serif;
  background: var(--white);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  overflow-x: hidden; /* حماية إضافية: أي عنصر أعرض من الشاشة ميكسرش عرض الصفحة كلها */
  overflow-wrap: anywhere; /* نصوص طويلة من غير مسافات (زي روابط الميتينج) تنزل سطر جديد بدل ما توسع الصفحة */
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Header ===== */
#bosla-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap; /* لو مساحة الشاشة مش كافية، الشعار وأزرار الحساب ينزلوا صف تاني بدل ما نصهم يتقطع */
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 24px;
  color: var(--purple-700);
  letter-spacing: -0.5px;
  white-space: nowrap; /* اسم BOSLA يفضل في سطر واحد، مش بيتقطع نص كلمة */
}
.logo span { color: var(--purple-500); }
.logo img { width: 34px; height: 34px; display: block; }
.nav-links { display: flex; gap: 28px; font-weight: 600; color: var(--gray); }
.nav-links a:hover { color: var(--purple-700); }
.nav-auth { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  white-space: nowrap; /* نص الزرار (زي "لوحتي") يفضل سطر واحد */
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--purple-700); color: var(--white); }
.btn-primary:hover { background: var(--purple-900); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--purple-700); border: 1.5px solid var(--purple-600); }
.btn-ghost:hover { background: var(--purple-50); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ===== Layout helpers ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }
.center { text-align: center; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(180deg, var(--purple-50) 0%, var(--white) 100%);
  padding: clamp(32px, 7vh, 64px) 0 clamp(28px, 6vh, 48px);
}
.hero .container {
  display: grid;
  grid-template-columns: 0.95fr 1.2fr;
  align-items: center;
  gap: 32px;
  text-align: right;
}
.hero-image { width: 100%; height: auto; max-width: 560px; display: block; margin: 0 0 0 auto; }
.eyebrow {
  display: inline-block;
  background: var(--purple-100);
  color: var(--purple-700);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: clamp(10px, 2vh, 20px);
}
.hero h1 {
  font-size: clamp(28px, 3.6vw + 1.6vh, 46px);
  font-weight: 800;
  margin: 0 0 clamp(10px, 2vh, 18px);
  color: var(--purple-900);
  line-height: 1.3;
}
.hero p { font-size: clamp(15px, 1.6vw + 0.8vh, 18px); font-weight: 500; line-height: 1.7; letter-spacing: 0.1px; color: var(--gray); max-width: 520px; margin: 0 0 clamp(16px, 3vh, 32px); }
.hero-actions { display: flex; gap: 14px; justify-content: flex-start; flex-wrap: wrap; }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin: 0 auto clamp(16px, 3vh, 32px); }
  .hero-actions { justify-content: center; }
  .hero-image { max-width: 420px; margin: 0 auto; }
}

/* شاشات قصيرة (لابتوب بشريط أدوات، موبايل بشريط عنوان ظاهر) — نضمن ظهور الأزرار من غير سكرول */
@media (max-height: 700px) {
  .hero { padding: 20px 0 18px; }
  .eyebrow { margin-bottom: 8px; }
  .hero h1 { margin-bottom: 8px; }
  .hero p { margin-bottom: 14px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-image { max-height: 20vh; }
}

@media (max-height: 700px) and (max-width: 900px) {
  .hero-image { display: none; }
}

.field-card {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.field-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--purple-100);
  color: var(--purple-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.field-card strong { font-size: 15px; }

/* ===== Cards / Grid ===== */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--purple-100);
  transform: translateY(-2px);
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--purple-700);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  margin-bottom: 14px;
}
h2.section-title { font-size: 32px; font-weight: 800; color: var(--purple-900); margin-bottom: 8px; }
.section-sub { color: var(--gray); margin-bottom: 40px; }

/* ===== Mentor cards ===== */
.mentor-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.mentor-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--purple-100);
  transform: translateY(-2px);
}
.mentor-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--purple-100); color: var(--purple-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px;
  overflow: hidden; flex-shrink: 0;
}
.mentor-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mentor-avatar-lg { width: 84px; height: 84px; font-size: 30px; }
.mentor-meta-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray); }
.mentor-header-flex { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--purple-100);
  color: var(--purple-700);
  width: fit-content;
}
.badge-free { background: var(--success-bg); color: var(--success); }
.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #0a66c2;
  width: fit-content;
  text-decoration: none;
}
.linkedin-link:hover { background: #d7e6fd; }
.price-tag { font-weight: 800; color: var(--purple-700); font-size: 18px; }

/* ===== Forms ===== */
.form-card {
  max-width: 520px;
  margin: 60px auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}
.form-title { font-size: 26px; font-weight: 800; color: var(--purple-900); margin-bottom: 6px; }
.form-sub { color: var(--gray); margin-bottom: 28px; font-size: 14px; }
label { display: block; font-weight: 700; font-size: 14px; margin: 16px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  background: var(--white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple-600); }
.field-hint { font-size: 12px; color: var(--gray); margin-top: 4px; }
.form-row { display: flex; gap: 14px; }
.form-row > div { flex: 1; }
.radio-group { display: flex; gap: 16px; margin-top: 8px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-weight: 600; margin: 0; }
.radio-group input { width: auto; }

/* ===== Filters bar ===== */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.filters select { width: auto; min-width: 160px; }

/* ===== Table (admin/dashboard) ===== */
/* الجدول ممكن يبقى عريض (6-7 أعمدة)، فبنخلي السكرول الأفقي يحصل جوه الحاوية دي بس
   بدل ما الصفحة كلها توسع وتبين ناقصة على الموبايل */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
@media (max-width: 768px) {
  table { font-size: 13px; }
  th, td { padding: 8px; }
}
th, td { padding: 12px; text-align: right; border-bottom: 1px solid var(--line); }
th { color: var(--gray); font-weight: 700; background: var(--purple-50); }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-pending_payment { background: #FFF3CD; color: #92700A; }
.status-pending_confirmation { background: #FDE8CC; color: #9A4B00; }
.status-confirmed { background: var(--success-bg); color: var(--success); }
.status-completed { background: var(--purple-100); color: var(--purple-700); }
.status-cancelled { background: var(--error-bg); color: var(--error); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tab-btn {
  padding: 12px 18px;
  font-weight: 700;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none; border: none; font-family: inherit; font-size: 15px;
}
.tab-btn.active { color: var(--purple-700); border-bottom-color: var(--purple-700); }

/* ===== Footer ===== */
#bosla-footer { background: var(--purple-900); color: #DCD1F5; padding: 40px 0; margin-top: 60px; }
#bosla-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
#bosla-footer a { color: white; }

/* ===== Toast ===== */
#bosla-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: white; padding: 14px 24px; border-radius: 10px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s ease;
  z-index: 999; max-width: 90%; text-align: center;
}
#bosla-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: var(--error); }
.toast-success { background: var(--purple-700); }

/* ===== Ratings / Reviews ===== */
.rating-line { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.stars { color: var(--secondary); letter-spacing: 2px; font-size: 15px; }

#review-overlay {
  position: fixed; inset: 0; background: rgba(30, 27, 41, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.review-modal {
  background: var(--white); border-radius: var(--radius);
  padding: 30px; max-width: 420px; width: 100%;
  box-shadow: var(--shadow);
}
.star-picker { display: flex; gap: 8px; justify-content: center; font-size: 34px; color: var(--secondary); margin: 18px 0 6px; cursor: pointer; user-select: none; }
.star-picker .star { transition: transform .1s ease; }
.star-picker .star:hover { transform: scale(1.15); }

/* ===== Chatbot ===== */
.chatbot-fab {
  position: fixed; bottom: 22px; left: 22px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--purple-700); color: var(--white); font-size: 22px;
  box-shadow: var(--shadow-lg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.chatbot-fab:hover { transform: scale(1.06); background: var(--purple-900); }
.chatbot-panel {
  position: fixed; bottom: 90px; left: 22px; z-index: 900;
  width: 320px; max-width: calc(100vw - 32px); max-height: 70vh;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.chatbot-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.chatbot-header {
  background: var(--purple-700); color: var(--white); padding: 14px 18px;
  border-radius: var(--radius) var(--radius) 0 0; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
}
.chatbot-close { background: none; border: none; color: var(--white); font-size: 20px; cursor: pointer; line-height: 1; }
.chatbot-body { padding: 16px; overflow-y: auto; }
.chatbot-intro { margin: 0 0 10px; font-size: 13px; color: var(--gray); font-weight: 600; }
.chatbot-option-btn {
  display: block; width: 100%; text-align: right; background: var(--purple-50);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  margin-bottom: 8px; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer; transition: background .15s ease;
}
.chatbot-option-btn:hover { background: var(--purple-100); }
.chatbot-back-btn { color: var(--purple-700); background: var(--white); }
.chatbot-answer p { font-size: 14px; color: var(--gray); margin: 8px 0 16px; line-height: 1.7; }
.chatbot-contact-form { display: flex; flex-direction: column; gap: 10px; }
.chatbot-contact-form input, .chatbot-contact-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  font-family: inherit; font-size: 14px; resize: vertical;
}

@media (max-width: 480px) {
  .chatbot-fab { bottom: 16px; left: 16px; width: 50px; height: 50px; }
  .chatbot-panel { bottom: 78px; left: 12px; }
}

/* ===== Utility ===== */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.spinner { text-align: center; padding: 40px; color: var(--gray); }

/* ===== Wizard (multi-step forms) ===== */
.wizard-progress { display: flex; align-items: center; margin-bottom: 30px; }
.wizard-step-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.wizard-dot {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--purple-50); border: 1.5px solid var(--line);
  color: var(--gray); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.wizard-dot.active { background: var(--purple-700); border-color: var(--purple-700); color: white; }
.wizard-dot.done { background: var(--success); border-color: var(--success); color: white; }
.wizard-step-label { font-size: 11px; font-weight: 700; color: var(--gray); white-space: nowrap; }
.wizard-step-label.active { color: var(--purple-700); }
.wizard-line { flex: 1; height: 2px; background: var(--line); margin: 0 8px 22px; border-radius: 2px; overflow: hidden; }
.wizard-line .fill { height: 100%; width: 0%; background: var(--purple-700); transition: width .3s ease; }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: wizardIn .25s ease; }
@keyframes wizardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.wizard-nav .btn { flex: 1; }

/* Password strength meter */
.pw-meter-track { height: 6px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.pw-meter-fill { height: 100%; width: 0%; background: var(--error); border-radius: 4px; transition: width .25s ease, background .25s ease; }
.pw-meter-label { font-size: 12px; font-weight: 700; margin-top: 6px; color: var(--gray); min-height: 16px; }

/* Circular profile photo upload */
.photo-upload { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 22px; }
.photo-circle {
  position: relative; width: 104px; height: 104px; border-radius: 50%;
  background: var(--purple-50); border: 2px dashed var(--purple-100);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer; color: var(--purple-700);
  font-size: 12px; font-weight: 700; text-align: center; padding: 8px;
  transition: border-color .2s ease;
}
.photo-circle:hover { border-color: var(--purple-600); }
.photo-circle img { width: 100%; height: 100%; object-fit: cover; }
.photo-circle input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-upload-hint { font-size: 12px; color: var(--gray); }

.step-review { background: var(--purple-50); border-radius: 10px; padding: 14px 16px; font-size: 13px; color: var(--gray); margin-bottom: 18px; }
.step-review b { color: var(--ink); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 32px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .wizard-step-label { display: none; }
  .nav-wrap { padding: 12px 16px; gap: 10px; }
  .logo { font-size: 19px; }
  .logo img { width: 28px; height: 28px; }
  .nav-auth { gap: 8px; }
  .nav-auth .btn { padding: 8px 14px; font-size: 13px; }
}

/* تلميح إن الجدول بيتمرر أفقيًا على الشاشات المتوسطة (تابلت) حيث الكارت لسه مش مفعّل */
.table-scroll-hint { display: none; }

/* على الموبايل: الجدول يتحول لكارت لكل صف بدل ما يتمرر أفقيًا، عشان كل البيانات تبان
   من غير سحب. كل <td> بياخد تسمية (data-label) بتبان جنبها كعنوان */
@media (max-width: 768px) {
  .table-scroll { overflow-x: visible; }
  .table-scroll table { min-width: 0; }
  .table-scroll thead { display: none; }
  .table-scroll table, .table-scroll tbody, .table-scroll tr, .table-scroll td { display: block; width: 100%; }
  .table-scroll tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 6px 14px; margin-bottom: 14px; background: var(--white);
  }
  .table-scroll td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line);
  }
  .table-scroll td:last-child { border-bottom: none; }
  .table-scroll td::before {
    content: attr(data-label); font-weight: 700; color: var(--gray);
    text-align: right; flex-shrink: 0;
  }
}
