/* ==========================================================================
   باگ باز | بخش «نمونه‌کارها» صفحه اصلی
   تمام کلاس‌ها با پیشوند bhw- (BugBaz Home Works) نام‌گذاری شده‌اند تا با
   بقیه‌ی استایل‌های سایت (Tailwind و سایر فایل‌های اختصاصی) تداخل نداشته باشند.
   این فایل فقط در صفحه اصلی لود می‌شود (block extra_link).
   ========================================================================== */

/* ---------- 1) پوسته‌ی سکشن ---------- */
.bhw-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 84px 0 76px;
  color: #111928;
  background:
    radial-gradient(1100px 480px at 50% -160px, rgba(55, 88, 249, 0.12), transparent 68%),
    linear-gradient(180deg, #ffffff 0%, #f9fafb 52%, #ffffff 100%);
}

.dark .bhw-section {
  color: #ffffff;
  background:
    radial-gradient(1100px 480px at 50% -160px, rgba(55, 88, 249, 0.24), transparent 68%),
    linear-gradient(180deg, #111928 0%, #1f2a37 52%, #111928 100%);
}

/* شبکه‌ی نقطه‌ای دو بعدی در پس‌زمینه */
.bhw-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(rgba(17, 25, 40, 0.11) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(72% 58% at 50% 32%, #000 0%, transparent 78%);
  mask-image: radial-gradient(72% 58% at 50% 32%, #000 0%, transparent 78%);
}

.dark .bhw-section::before {
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
}

/* لکه‌های نرم رنگی (۲D + شناور) */
.bhw-orb {
  position: absolute;
  z-index: -3;
  border-radius: 50%;
  filter: blur(38px);
  opacity: 0.5;
  pointer-events: none;
  animation: bhw-float 14s ease-in-out infinite;
}

.bhw-orb--1 {
  width: 300px;
  height: 300px;
  inset-inline-start: -110px;
  top: 40px;
  background: rgba(55, 88, 249, 0.5);
}

.bhw-orb--2 {
  width: 260px;
  height: 260px;
  inset-inline-end: -90px;
  top: 150px;
  background: rgba(19, 194, 150, 0.42);
  animation-delay: -4s;
}

.bhw-orb--3 {
  width: 280px;
  height: 280px;
  inset-inline-end: 34%;
  bottom: -140px;
  background: rgba(147, 51, 234, 0.32);
  animation-delay: -8s;
}

.dark .bhw-orb {
  opacity: 0.34;
}

/* شکل‌های تزئینی خطی (طراحی دو بعدی) */
.bhw-shape {
  position: absolute;
  z-index: -2;
  pointer-events: none;
  opacity: 0.45;
  animation: bhw-spin 26s linear infinite;
}

.bhw-shape--cube {
  width: 62px;
  height: 62px;
  inset-inline-start: 6%;
  top: 128px;
  border: 2px solid rgba(55, 88, 249, 0.5);
  border-radius: 16px;
  animation: bhw-float 11s ease-in-out infinite;
}

.bhw-shape--ring {
  width: 74px;
  height: 74px;
  inset-inline-end: 8%;
  bottom: 90px;
  border: 2px dashed rgba(19, 194, 150, 0.55);
  border-radius: 50%;
}

.bhw-shape--tri {
  width: 0;
  height: 0;
  inset-inline-start: 12%;
  bottom: 120px;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 36px solid rgba(234, 88, 12, 0.28);
  animation: bhw-float 9s ease-in-out infinite;
  animation-delay: -3s;
}

@keyframes bhw-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -22px, 0); }
}

@keyframes bhw-spin {
  to { transform: rotate(360deg); }
}

/* ---------- 2) کانتینر و سرتیتر ---------- */
.bhw-container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 16px;
}

.bhw-head {
  max-width: 720px;
  margin: 0 auto 34px;
  text-align: center;
}

.bhw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  margin-bottom: 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #3758f9;
  background: rgba(55, 88, 249, 0.08);
  border: 1px solid rgba(55, 88, 249, 0.2);
}

.dark .bhw-eyebrow {
  color: #93a8ff;
  background: rgba(55, 88, 249, 0.16);
  border-color: rgba(147, 168, 255, 0.28);
}

.bhw-eyebrow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #13c296;
  box-shadow: 0 0 0 0 rgba(19, 194, 150, 0.6);
  animation: bhw-ping 2s ease-out infinite;
}

@keyframes bhw-ping {
  0% { box-shadow: 0 0 0 0 rgba(19, 194, 150, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(19, 194, 150, 0); }
  100% { box-shadow: 0 0 0 0 rgba(19, 194, 150, 0); }
}

.bhw-title {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.35;
  color: #111928;
}

.dark .bhw-title {
  color: #ffffff;
}

.bhw-title em {
  font-style: normal;
  background: linear-gradient(96deg, #3758f9, #13c296);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bhw-subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 2;
  color: #637381;
}

.dark .bhw-subtitle {
  color: #cbd5e1;
}

/* ---------- 3) تب‌های حوزه تخصصی ---------- */
.bhw-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 34px;
}

.bhw-tab {
  --acc: #3758f9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  color: #4b5563;
  background: #ffffff;
  border: 1px solid #dfe4ea;
  box-shadow: 0 10px 26px -22px rgba(17, 25, 40, 0.65);
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease,
    transform 0.25s ease, box-shadow 0.25s ease;
}

.dark .bhw-tab {
  color: #cbd5e1;
  background: #1f2a37;
  border-color: #374151;
}

.bhw-tab:hover {
  color: #3758f9;
  border-color: rgba(55, 88, 249, 0.45);
  transform: translateY(-2px);
}

.dark .bhw-tab:hover {
  color: #ffffff;
  border-color: #4b5563;
}

.bhw-tab.is-active {
  color: #ffffff;
  background: var(--acc);
  border-color: var(--acc);
  box-shadow: 0 16px 30px -16px var(--acc);
  transform: translateY(-2px);
}

.bhw-tab:focus-visible {
  outline: 2px solid #3758f9;
  outline-offset: 3px;
}

.bhw-tab__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: currentColor;
  opacity: 0.9;
}

.bhw-tab__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------- 4) پنل‌ها و گرید کارت‌ها ---------- */
.bhw-panel {
  display: none;
}

.bhw-panel.is-active {
  display: block;
  animation: bhw-panel-in 0.45s ease both;
}

@keyframes bhw-panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.bhw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* پنل‌هایی که تعداد کارت‌هایشان چهارتاست، در دو ستون متعادل نمایش داده می‌شوند
   (عرض هر کارت نزدیک به حالت سه‌ستونی می‌ماند تا هماهنگی ظاهری حفظ شود) */
@media (min-width: 1024px) {
  .bhw-grid--duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 900px;
    margin-inline: auto;
  }
}

/* ---------- 5) کارت نمونه‌کار ---------- */
.bhw-card {
  --acc: #3758f9;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e6eaf0;
  box-shadow: 0 22px 50px -40px rgba(17, 25, 40, 0.55);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.dark .bhw-card {
  background: #1f2a37;
  border-color: #374151;
  box-shadow: 0 22px 50px -40px rgba(0, 0, 0, 0.9);
}

/* نوار رنگی بالای کارت که هنگام هاور رشد می‌کند */
.bhw-card::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  z-index: 3;
  background: linear-gradient(90deg, var(--acc), rgba(19, 194, 150, 0.9));
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bhw-card:hover {
  transform: translateY(-8px);
  border-color: var(--acc);
  box-shadow: 0 30px 60px -34px rgba(17, 25, 40, 0.45);
}

.bhw-card:hover::after,
.bhw-card:focus-within::after {
  transform: scaleX(1);
}

.bhw-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f3f4f6;
}

.dark .bhw-card__media {
  background: #111928;
}

.bhw-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.bhw-card__img--ph {
  background: linear-gradient(135deg, #e5e7eb, #f9fafb);
}

.dark .bhw-card__img--ph {
  background: linear-gradient(135deg, #374151, #1f2a37);
}

.bhw-card:hover .bhw-card__img {
  transform: scale(1.07);
}

/* سایه‌ی گرادیانی روی تصویر */
.bhw-card__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(17, 25, 40, 0.42) 0%, rgba(17, 25, 40, 0) 42%, rgba(17, 25, 40, 0.72) 100%);
  opacity: 0.85;
  transition: opacity 0.4s ease;
}

.bhw-card:hover .bhw-card__shade {
  opacity: 1;
}

/* درخشش حرکتی هنگام هاور */
.bhw-card__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 55%;
  z-index: 2;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.42) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-160%) skewX(-14deg);
  pointer-events: none;
}

.bhw-card:hover .bhw-card__shine {
  animation: bhw-shine 0.95s ease-out;
}

@keyframes bhw-shine {
  to { transform: translateX(240%) skewX(-14deg); }
}

/* برچسب حوزه */
.bhw-card__badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--acc);
  box-shadow: 0 10px 22px -14px rgba(17, 25, 40, 0.9);
}

/* پیل آمار (رشد ترافیک و ...) */
.bhw-card__pill {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  color: #e5e7eb;
  background: rgba(17, 25, 40, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.bhw-card__pill strong {
  font-size: 1rem;
  color: #ffffff;
}

/* دکمه‌ی گرد «مشاهده» که با هاور بالا می‌آید */
.bhw-card__peek {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #111928;
  background: #ffffff;
  opacity: 0;
  transform: translateY(14px) scale(0.85);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
}

.bhw-card:hover .bhw-card__peek,
.bhw-card:focus-within .bhw-card__peek {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.bhw-card__peek:hover {
  background: var(--acc);
  color: #ffffff;
}

.bhw-card__peek svg {
  width: 18px;
  height: 18px;
}

/* آیکون پخش برای نمونه‌کارهای موشن */
.bhw-card__play {
  position: absolute;
  top: 50%;
  inset-inline-start: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-top: -27px;
  margin-inline-start: -27px;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(17, 25, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(4px);
  transition: transform 0.4s ease, background-color 0.3s ease;
}

.bhw-card:hover .bhw-card__play {
  transform: scale(1.12);
  background: var(--acc);
}

/* بدنه‌ی کارت */
.bhw-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 18px 18px 20px;
}

.bhw-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.7;
  color: #111928;
}

.dark .bhw-card__title {
  color: #ffffff;
}

.bhw-card__domain {
  margin: 0;
  font-size: 0.8rem;
  color: #3758f9;
  direction: ltr;
  text-align: right;
}

.dark .bhw-card__domain {
  color: #93a8ff;
}

.bhw-card__desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.95;
  color: #637381;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .bhw-card__desc {
  color: #cbd5e1;
}

.bhw-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.bhw-chip {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e6eaf0;
}

.dark .bhw-chip {
  color: #cbd5e1;
  background: #111928;
  border-color: #374151;
}

.bhw-chip--acc {
  color: var(--acc);
  /* فالبک برای مرورگرهای قدیمی‌تر که color-mix را پشتیبانی نمی‌کنند */
  background: rgba(55, 88, 249, 0.1);
  border-color: rgba(55, 88, 249, 0.3);
  background: color-mix(in srgb, var(--acc) 10%, transparent);
  border-color: color-mix(in srgb, var(--acc) 30%, transparent);
}

.bhw-chip--up {
  color: #0f9f7a;
  background: rgba(19, 194, 150, 0.1);
  border-color: rgba(19, 194, 150, 0.3);
}

.dark .bhw-chip--up {
  color: #5ee0bb;
}

/* لینک داخل کارت */
.bhw-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--acc);
  text-decoration: none;
}

.bhw-card__cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.bhw-card__cta:hover svg {
  transform: translateX(-4px);
}

/* ---------- 6) فوتر پنل و CTA پایانی ---------- */
.bhw-panel__foot {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.bhw-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3758f9;
  background: transparent;
  border: 1px dashed rgba(55, 88, 249, 0.5);
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease,
    transform 0.3s ease;
}

.dark .bhw-more {
  color: #93a8ff;
  border-color: rgba(147, 168, 255, 0.45);
}

.bhw-more:hover {
  color: #ffffff;
  background: #3758f9;
  border-color: #3758f9;
  border-style: solid;
  transform: translateY(-2px);
}

.bhw-more svg,
.bhw-cta__btn svg {
  width: 16px;
  height: 16px;
}

.bhw-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 44px;
}

.bhw-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease,
    color 0.3s ease;
}

.bhw-cta__btn--solid {
  color: #ffffff;
  background: linear-gradient(120deg, #3758f9, #1b44c8);
  box-shadow: 0 18px 34px -20px rgba(55, 88, 249, 0.95);
}

.bhw-cta__btn--solid:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px -18px rgba(55, 88, 249, 0.95);
}

.bhw-cta__btn--ghost {
  color: #111928;
  background: #ffffff;
  border: 1px solid #dfe4ea;
}

.dark .bhw-cta__btn--ghost {
  color: #ffffff;
  background: #1f2a37;
  border-color: #374151;
}

.bhw-cta__btn--ghost:hover {
  transform: translateY(-3px);
  border-color: var(--acc, #13c296);
  color: var(--acc, #13c296);
}

/* لینک «همه نمونه‌کارهای این زمینه» برای هر تب جداگانه است و تنها لینک تب
   فعال (is-shown) دیده می‌شود؛ رنگ تاکید هرکدام از --acc خودش می‌آید. */
.bhw-seeall {
  display: none;
}

.bhw-seeall.is-shown {
  display: inline-flex;
}

/* ---------- 7) انیمیشن ورود با اسکرول (فقط وقتی JS فعال است) ---------- */
.bhw-js .bhw-reveal {
  opacity: 0;
}

.bhw-js .bhw-reveal.is-in {
  animation: bhw-reveal-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes bhw-reveal-in {
  from { opacity: 0; translate: 0 28px; }
  to { opacity: 1; translate: 0 0; }
}

/* ---------- 8) ریسپانسیو ---------- */
@media (max-width: 1023.98px) {
  .bhw-section {
    padding: 66px 0 60px;
  }

  .bhw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 719.98px) {
  .bhw-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    /* نوار اسکرول مخفی می‌شود تا ردیف تب‌ها تمیز بماند (سوایپ و درگ کار می‌کند) */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .bhw-tabs::-webkit-scrollbar {
    display: none;
  }

  .bhw-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 9px 15px;
    font-size: 0.88rem;
  }

  .bhw-shape--cube,
  .bhw-shape--tri {
    display: none;
  }
}

@media (max-width: 539.98px) {
  .bhw-section {
    padding: 54px 0 50px;
  }

  .bhw-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bhw-card__body {
    padding: 16px 15px 18px;
  }

  .bhw-cta__btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- 9) احترام به تنظیم کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
  .bhw-orb,
  .bhw-shape,
  .bhw-eyebrow__dot,
  .bhw-panel.is-active {
    animation: none !important;
  }

  .bhw-js .bhw-reveal {
    opacity: 1;
  }

  .bhw-js .bhw-reveal.is-in {
    animation: none !important;
  }

  .bhw-card,
  .bhw-card__img {
    transition: none !important;
  }
}
