/* =========================================================
   استایل اصلی سامانه مشاوره حقوقی آنلاین
   ========================================================= */

:root {
  --primary: #0d3b66;
  --primary-light: #1c5a94;
  --gold: #c9a24b;
  --bg-soft: #f7f9fc;
  --text-dark: #1b2430;
  --text-muted: #6b7685;
  --radius: 16px;
  --shadow-soft: 0 10px 30px rgba(13, 59, 102, 0.08);
  --shadow-hover: 0 16px 40px rgba(13, 59, 102, 0.14);
}

* { box-sizing: border-box; }

/* =========================================================
   فوتر چسبان (Sticky Footer) — نسخه مقاوم
   html اجازه می‌دهد ارتفاع طبیعی بگیرد (height:auto) و فقط از
   min-height برای رساندن body به حداقل ارتفاع صفحه استفاده می‌شود؛
   یعنی هر مقدار محتوا اضافه شود (کم یا خیلی زیاد)، صفحه به‌طور
   طبیعی و کامل اسکرول می‌شود و فوتر هرگز روی محتوا نمی‌افتد یا
   وسط صفحه گیر نمی‌کند. dvh واحد دقیق‌تری روی موبایل است (به‌خاطر
   نوار آدرس مرورگر) و vh به‌عنوان fallback برای مرورگرهای قدیمی‌تر
   نگه داشته شده است. */
html { height: auto; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg-soft);
  color: var(--text-dark);
  line-height: 1.9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
/* همه‌ی محتوای بین هدر و فوتر (main.page-content) فضای باقی‌مانده را پر می‌کند
   تا فوتر همیشه دقیقاً در انتهای واقعی محتوا بنشیند، نه وسط یا روی آن.
   overflow: visible یعنی اگر محتوا بلندتر از صفحه بود، صفحه به‌طور طبیعی
   اسکرول می‌شود؛ هیچ‌وقت محدود/بریده نمی‌شود. */
.page-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  overflow: visible;
}
.page-content > * { min-width: 0; }
.site-footer { flex-shrink: 0; width: 100%; }

a { text-decoration: none; transition: all .2s ease; }

::selection { background: var(--gold); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #eef1f5;
}
.navbar-brand .brand-text {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
}
.nav-link {
  font-weight: 500;
  color: var(--text-dark) !important;
  position: relative;
  padding: .6rem 1rem !important;
}
.nav-link::after {
  content: '';
  position: absolute;
  right: 1rem; left: 1rem; bottom: .3rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .25s ease;
}
.nav-link:hover::after { transform: scaleX(1); }
.breadcrumb-bar { background: #fff; border-bottom: 1px solid #eef1f5; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ---------- Hero / اسلایدر ----------
   ارتفاع اسلایدر با clamp() به‌صورت واکنش‌گرا تنظیم شده: هیچ‌وقت خیلی
   کوتاه (فشرده و بدهیبت) یا خیلی بلند (که کاربر مجبور شود اسکرول کند
   تا محتوای زیرش را ببیند) نمی‌شود. همه‌ی حالت‌های اسلاید (پیش‌فرض،
   سفارشی با تصویر، و HTML آزاد) دقیقاً همین ارتفاع را می‌گیرند تا هنگام
   چرخش کاروسل هیچ پرش/جهش ارتفاعی در صفحه رخ ندهد. */
.hero {
  background: linear-gradient(135deg, #0d3b66 0%, #123f6e 55%, #1c5a94 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(201,162,75,.18), transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(255,255,255,.08), transparent 40%);
  pointer-events: none;
}
#heroCarousel, #heroCarousel .carousel-inner { height: clamp(360px, 52vw, 560px); }
#heroCarousel .carousel-item {
  height: clamp(360px, 52vw, 560px);
  background-color: var(--primary);
}
/* توجه: display را دستکاری نمی‌کنیم تا منطق نمایش/عدم‌نمایش اسلاید بوت‌استرپ
   (که با display:none/block کار می‌کند) خراب نشود؛ فقط اسلاید فعال/در حال
   ترنزیشن را فلکس و وسط‌چین می‌کنیم. */
#heroCarousel .carousel-item.active,
#heroCarousel .carousel-item-next,
#heroCarousel .carousel-item-prev {
  display: flex;
  align-items: center;
}
#heroCarousel .carousel-item > .container { width: 100%; }
.hero h1 { font-weight: 800; font-size: 2.6rem; }
.hero p.lead { color: #dbe6f2; }
.hero .btn-gold {
  background: var(--gold); color: #1b2430; font-weight: 700;
  border: none;
}
.hero .btn-gold:hover { background: #d8b767; transform: translateY(-2px); }
.hero-shape { position: absolute; bottom: -1px; right: 0; left: 0; }

/* اسلاید با کد HTML سفارشی: کل فضای اسلاید (به همان ارتفاع ثابت بالا) در
   اختیار کد ادمین قرار می‌گیرد تا هر طراحی دلخواهی ممکن باشد. */
.slide-html-wrap { position: absolute; inset: 0; overflow: hidden; }
.slide-html-wrap > iframe,
.slide-html-wrap :is(img, video) { width: 100%; height: 100%; object-fit: cover; }

/* ---------- اسلاید سفارشی (فقط تصویر خودم + یک دکمه) ---------- */
.slide-btn-pos { position: absolute; z-index: 2; white-space: nowrap; }
.slide-btn-pos.pos-top-right { top: 24px; right: 24px; }
.slide-btn-pos.pos-top-center { top: 24px; left: 50%; transform: translateX(-50%); }
.slide-btn-pos.pos-top-left { top: 24px; left: 24px; }
.slide-btn-pos.pos-middle-right { top: 50%; right: 24px; transform: translateY(-50%); }
.slide-btn-pos.pos-middle-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.slide-btn-pos.pos-middle-left { top: 50%; left: 24px; transform: translateY(-50%); }
.slide-btn-pos.pos-bottom-right { bottom: 24px; right: 24px; }
.slide-btn-pos.pos-bottom-center { bottom: 24px; left: 50%; transform: translateX(-50%); }
.slide-btn-pos.pos-bottom-left { bottom: 24px; left: 24px; }
.slide-btn-pos.btn-size-sm { padding: .4rem 1rem; font-size: .85rem; }
.slide-btn-pos.btn-size-md { padding: .65rem 1.6rem; font-size: 1rem; }
.slide-btn-pos.btn-size-lg { padding: .9rem 2.2rem; font-size: 1.15rem; }

/* ---------- نوار آمار زیر اسلایدر (وکیل متخصص / سوال پاسخ‌داده‌شده / مقاله) ---------- */
.hero-stats-wrap { position: relative; z-index: 2; margin-top: -34px; }
.hero-stats {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 1.5rem .5rem;
}
.hero-stats .stat-item + .stat-item { border-inline-start: 1px solid #eef1f5; }
.hero-stats .stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-size: 1.2rem; margin: 0 auto .6rem;
}
.hero-stats .stat-num { font-weight: 800; font-size: 1.6rem; color: var(--primary); line-height: 1.3; }
.hero-stats .stat-label { color: var(--text-muted); font-size: .85rem; }
@media (max-width: 576px) {
  .hero-stats .stat-icon { width: 38px; height: 38px; font-size: 1rem; }
  .hero-stats .stat-num { font-size: 1.2rem; }
  .hero-stats .stat-label { font-size: .72rem; }
}

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-title { font-weight: 800; font-size: 1.9rem; color: var(--primary); }
.section-subtitle { color: var(--text-muted); max-width: 640px; margin: 0 auto; }

/* ---------- Cards ---------- */
.card-soft {
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease;
  height: 100%;
}
.card-soft:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.icon-box {
  width: 60px; height: 60px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-size: 1.4rem;
}

.lawyer-card img, .article-card img { border-radius: var(--radius) var(--radius) 0 0; height: 210px; width: 100%; object-fit: cover; }
/* رفع باگ: قبلا این کلاس فقط داخل .lawyer-card استایل داشت و در سایدبار
   داشبورد وکیل و صفحه عمومی پروفایل وکیل بدون رنگ/استایل نمایش داده می‌شد. */
.badge-verified { background: #e8f6ee; color: #1b8a4c; font-weight: 600; font-size: .75rem; display: inline-flex; align-items: center; gap: 4px; padding: .4em .7em; }
.lawyer-card { position: relative; }
.badge-featured {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2;
  background: linear-gradient(135deg, #f6b93b, #e58e26); color: #fff; font-weight: 700; font-size: .72rem;
  padding: .35em .8em; border-radius: 50px; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 3px 8px rgba(229,142,38,.35);
}

/* ---------- کارت وکیل - نسخه بازطراحی‌شده (lawyer-card-v2) ---------- */
.lawyer-card-v2 {
  position: relative;
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lawyer-card-v2:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.lawyer-card-v2-cover {
  height: 92px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  position: relative;
  overflow: hidden;
}
.lawyer-card-v2-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .28; filter: blur(1px) saturate(1.1);
}
.lawyer-card-v2-avatar-wrap {
  position: relative;
  width: 84px; height: 84px;
  margin: -46px auto 0;
  z-index: 2;
}
.lawyer-card-v2-avatar {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(13,59,102,.18);
  display: block;
}
.lawyer-card-v2-avatar-wrap .online-dot {
  position: absolute; bottom: 4px; inset-inline-end: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #c6ccd4; border: 2px solid #fff;
}
.lawyer-card-v2-avatar-wrap .online-dot.is-online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.lawyer-card-v2-body {
  padding: 14px 16px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.lawyer-card-v2-body h6 { font-size: 1rem; }
.lawyer-card-v2-body .d-flex.justify-content-between.align-items-start { justify-content: center !important; gap: 6px; }
.lawyer-card-v2-specialty {
  color: var(--text-muted); font-size: .82rem; margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lawyer-card-v2-meta {
  list-style: none; padding: 0; margin: 0 0 12px;
  display: flex; justify-content: center; gap: 14px;
  font-size: .74rem; color: var(--text-muted);
}
.lawyer-card-v2-meta li { display: flex; align-items: center; gap: 4px; }
.lawyer-card-v2-meta i { color: var(--primary-light); }
.lawyer-card-v2-prices {
  display: flex; gap: 8px; margin-bottom: 4px;
}
.lawyer-card-v2-price {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid #eef1f5;
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lawyer-card-v2-price i { color: var(--gold); font-size: .85rem; margin-bottom: 2px; }
.lawyer-card-v2-price .label { font-size: .68rem; color: var(--text-muted); }
.lawyer-card-v2-price .value { font-size: .78rem; font-weight: 700; color: var(--primary); }
.lawyer-card-v2 .badge-featured { top: 10px; inset-inline-start: 10px; }


.question-item {
  border: 1px solid #eef1f5;
  border-radius: var(--radius);
  background: #fff;
  padding: 1.25rem 1.5rem;
  transition: box-shadow .2s ease, transform .2s ease;
}
.question-item:hover { box-shadow: var(--shadow-soft); transform: translateY(-3px); }

.testimonial-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
}
.testimonial-card .stars { color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer { background: #0b1e33; color: #cfd9e4; margin-top: 60px; }
.footer-brand { color: #fff; font-weight: 800; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .6rem; color: #b7c3d1; }
.footer-links a { color: #b7c3d1; }
.footer-links a:hover { color: var(--gold); }
.text-light-50 { color: #b7c3d1; }
.social-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.social-btn:hover { background: var(--gold); color: #0b1e33; }

/* ---------- Dashboard ---------- */
/* ستون سایدبار و ستون محتوا هرکدام ارتفاع طبیعی خودشان را می‌گیرند و
   یکدیگر را کش نمی‌دهند؛ همین باعث می‌شود در صفحاتی که سایدبار (مثلاً
   سایدبار ادمین با آیتم‌های زیاد) از محتوا بلندتر یا کوتاه‌تر است، چیدمان
   به‌هم نریزد و فوتر همیشه دقیقاً بعد از پایان بلندترین ستون بیاید. */
.row:has(> .dash-sidebar),
.row:has(> * > .dash-sidebar) { align-items: flex-start; }
.dash-sidebar {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #eef1f5;
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
}
.dash-sidebar .nav-link {
  border-radius: 10px;
  padding: .65rem 1rem !important;
  color: var(--text-dark) !important;
  margin-bottom: .25rem;
}
.dash-sidebar .nav-link.active,
.dash-sidebar .nav-link:hover { background: var(--bg-soft); color: var(--primary) !important; }
.stat-card {
  background: #fff; border-radius: var(--radius); border: 1px solid #eef1f5;
  padding: 1.4rem; box-shadow: var(--shadow-soft);
}
.stat-card .num { font-size: 1.8rem; font-weight: 800; color: var(--primary); }

/* ---------- Auth pages ---------- */
.auth-wrapper {
  min-height: 70vh; display: flex; align-items: center; justify-content: center;
  padding: 60px 0;
}
.auth-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 2.5rem; max-width: 480px; width: 100%;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: 10px; padding: .65rem .9rem; border: 1px solid #dde3ea;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 .2rem rgba(28,90,148,.12);
}
label.form-label { font-weight: 600; font-size: .92rem; }

/* ---------- Animations ---------- */
.fade-up { animation: fadeUp .6s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Misc ---------- */
.badge-soft { background: var(--bg-soft); color: var(--primary); font-weight: 600; }
.table-soft th { color: var(--text-muted); font-weight: 600; border-top: none; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; color: #d7e0ea; margin-bottom: 1rem; }

/* ---------- کیف پول ---------- */
.wallet-balance-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  color: #fff;
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
}
.wallet-balance-card .amount { font-size: 2rem; font-weight: 800; }
.wallet-balance-card .label { color: #dbe6f2; font-size: .9rem; }

/* ---------- آنلاین / آخرین بازدید ---------- */
.online-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #c7ccd3; }
.online-dot.is-online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }

/* ---------- چت ---------- */
.chat-shell { background: #fff; border-radius: var(--radius); border: 1px solid #eef1f5; box-shadow: var(--shadow-soft); overflow: hidden; display: flex; flex-direction: column; height: 72vh; min-height: 460px; }
.chat-shell .chat-header { padding: .9rem 1.2rem; border-bottom: 1px solid #eef1f5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fbfcfe; }
.chat-shell .chat-body { flex: 1 1 auto; overflow-y: auto; padding: 1.2rem; background: #f7f9fb; }
.chat-shell .chat-footer { border-top: 1px solid #eef1f5; padding: .8rem 1rem; background: #fff; }
.chat-bubble { max-width: 75%; width: fit-content; padding: .6rem .9rem; border-radius: 14px; margin-bottom: .7rem; line-height: 1.9; font-size: .92rem; overflow-wrap: anywhere; word-break: break-word; }
.chat-bubble .meta { font-size: .7rem; opacity: .65; margin-top: .25rem; }
.chat-bubble.mine { background: var(--primary); color: #fff; margin-inline-start: auto; border-bottom-left-radius: 4px; }
.chat-bubble.theirs { background: #fff; color: var(--text-dark); border: 1px solid #e3e8ee; margin-inline-end: auto; border-bottom-right-radius: 4px; box-shadow: 0 1px 3px rgba(20,30,50,.04); }
.chat-bubble .attach-link { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); border-radius: 8px; padding: 6px 10px; margin-top: 4px; color: inherit; }
.chat-bubble.theirs .attach-link { background: var(--bg-soft); color: var(--primary); }
.chat-list-item { display: flex; align-items: center; gap: .8rem; padding: .9rem; border-radius: 12px; border: 1px solid #eef1f5; margin-bottom: .6rem; transition: background .15s ease; }
.chat-list-item:hover { background: var(--bg-soft); }
.chat-list-item .unread-badge { background: #e63946; color: #fff; border-radius: 50px; font-size: .7rem; padding: 2px 8px; }

@media (max-width: 768px) {
  .hero h1 { font-size: 1.9rem; }
  .section { padding: 45px 0; }
  .chat-shell { height: 78vh; }
  .chat-bubble { max-width: 88%; }
}

/* ---------- چاپ صورت‌حساب ---------- */
@media print {
  .site-header, .site-footer, .dash-sidebar, .no-print, .btn, form, .breadcrumb-bar { display: none !important; }
  body { background: #fff !important; }
  .col-lg-9 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .card-soft { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .section { padding: 0 !important; }
  .table-soft th, .table-soft td { color: #000 !important; }
  a[href]:after { content: none !important; }
  .print-header { display: block !important; margin-bottom: 20px; border-bottom: 2px solid #0d3b66; padding-bottom: 12px; }
}
.print-header { display: none; }
