/* ==========================================================================
   سره مینو — استایل اصلی سایت
   --------------------------------------------------------------------------
   ۱. فونت‌ها و متغیرها (تم روز / شب)     ۹. جدول زمان‌بندی
   ۲. ریست و پایه                         ۱۰. سربخش‌ها و مقالات
   ۳. ابزارهای کمکی                        ۱۱. فوتر
   ۴. دکمه‌ها                              ۱۲. صفحه جزئیات دوره
   ۵. لودینگ                               ۱۳. فرم‌ها و مودال
   ۶. نوبار و منوها                        ۱۴. صفحه درباره ما
   ۷. پیام‌ها                              ۱۵. ریسپانسیو
   ۸. بنر، جست‌وجو و کارت دوره‌ها

   تم شب فقط با عوض شدن متغیرها روی [data-theme="dark"] کار می‌کند؛
   برای حالت شب رنگ مستقیم ننویسید، متغیر را عوض کنید.
   ========================================================================== */

/* ==========================================
   ۱. فونت‌ها و متغیرها
   ========================================== */
@font-face {
  font-family: "yekan";
  src: url("../fonts/YekanBakh-Medium.f6838a36b2aa.ttf") format("truetype");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "yekan";
  src: url("../fonts/YekanBakh-Boldt.02661e57e717.ttf") format("truetype");
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --font: "yekan", system-ui, -apple-system, sans-serif;

  /* سطوح */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;

  /* متن */
  --text: #1e293b;
  --text-muted: #64748b;

  /* رنگ برند (لوگو، منو، تیترها) */
  --primary: #0d47a1;
  --primary-hover: #1565c0;
  --primary-soft: rgba(13, 71, 161, 0.08);

  /* رنگ‌های عملیاتی */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-text: #2563eb; /* متن آبی روی زمینه کم‌رنگ آبی */
  --success: #22c55e;
  --success-hover: #16a34a;
  --success-soft: rgba(34, 197, 94, 0.15);
  --success-text: #15803d;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --danger-text: #b91c1c;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.08);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --nav-height: 72px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #0b1220;
  --border: #334155;

  --text: #f8fafc;
  --text-muted: #cbd5e1;

  --primary: #22c55e;
  --primary-hover: #16a34a;
  --primary-soft: rgba(34, 197, 94, 0.12);

  --accent-soft: rgba(37, 99, 235, 0.2);
  --accent-text: #93c5fd;
  --success-text: #4ade80;
  --danger-text: #f87171;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.55);
}

/* تعویض تم با موج دایره‌ای (View Transitions؛ زمان‌بندی در main.js) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* شب→روز: تصویر تیره قبلی باید روی صفحه روشن باشد تا در دکمه جمع شود */
.theme-to-light::view-transition-old(root) {
  z-index: 2;
}

/* ترنزیشن‌های رنگ معمولی در حین موج خاموش‌اند تا موج تمیز دیده شود */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* ==========================================
   ۲. ریست و پایه
   ========================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ==========================================
   ۳. ابزارهای کمکی
   ========================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-section {
  padding: 2rem 1.5rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state a {
  color: var(--accent-text);
}

.hidden {
  display: none !important;
}

/* ویژگی hidden همیشه برنده است (حتی روی .btn و فرم‌های flex) */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* فیلد تله ربات‌ها (honeypot) */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
}

.field-error {
  display: block;
  color: var(--danger-text);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ==========================================
   ۴. دکمه‌ها
   .btn + یکی از رنگ‌ها: primary | brand | success | outline | ghost-light
   اندازه‌ها: btn-block (تمام عرض)، btn-lg، btn-center (وسط‌چین با نصف عرض)
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 6px 12px -2px rgba(37, 99, 235, 0.35);
}

.btn-brand {
  background-color: var(--primary);
  color: #fff;
  padding: 0.55rem 1.3rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-brand:hover {
  background-color: var(--primary-hover);
  transform: none;
}

.btn-success {
  background-color: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-outline {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn-outline:hover {
  background-color: var(--accent);
  color: #fff;
}

.btn-dark {
  background-color: #374151;
  color: #fff;
}

.btn-dark:hover {
  background-color: #111827;
}

.btn-ghost-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: transparent;
}

.btn-ghost-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
}

.btn-center {
  display: flex;
  max-width: 50%;
  margin: 1rem auto 0;
}

.btn svg {
  transition: transform 0.2s ease;
}

.btn:hover svg {
  transform: translateX(-3px);
}

/* دکمه تغییر تم */
.theme-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.08);
  border-color: var(--primary);
}

/* ==========================================
   ۵. لودینگ
   ========================================== */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

.tech-loader {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.monitor-icon {
  width: 56px;
  height: 56px;
  color: #06b6d4;
  filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.5));
  animation: pulseMonitor 2s ease-in-out infinite;
}

.code-symbol {
  position: absolute;
  top: 26px;
  font-family: monospace;
  font-weight: 800;
  font-size: 0.85rem;
  color: #a855f7;
  text-shadow: 0 0 8px #a855f7;
  animation: codeBlink 1.2s infinite alternate;
}

.tech-orbit {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  animation: rotateOrbit 4s linear infinite;
}

.tech-node {
  position: absolute;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.node-1 {
  top: -5px;
  background: #6366f1;
  box-shadow:
    0 0 10px #6366f1,
    0 0 20px #6366f1;
}

.node-2 {
  bottom: -5px;
  background: #a855f7;
  box-shadow:
    0 0 10px #a855f7,
    0 0 20px #a855f7;
}

.brand-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.institute-title {
  color: #f8fafc;
  font-size: 1.1rem;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.loading-status {
  color: #94a3b8;
  font-size: 0.85rem;
  animation: fadeText 1.5s infinite alternate;
}

@keyframes rotateOrbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseMonitor {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes codeBlink {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeText {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================
   ۶. نوبار و منوها
   ========================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-menu-list {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav-menu-list li {
  position: relative;
}

.nav-menu-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu-list a:hover,
.nav-menu-list a[aria-current="page"] {
  color: var(--primary);
}

/* زیرمنوی دوره‌ها (دسکتاپ) */
.dropdown .submenu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1100;
  min-width: 220px;
  padding: 0.6rem 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease;
}

.dropdown:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu a {
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.submenu a:hover {
  background-color: var(--surface-2);
}

.arrow-icon {
  transition: transform 0.3s ease;
}

.dropdown.active .arrow-icon {
  transform: rotate(180deg);
}

/* اکشن‌های نوبار */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* منوی پروفایل */
.user-profile-dropdown {
  position: relative;
}

.profile-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.2s ease;
}

.profile-toggle-btn:hover {
  border-color: var(--primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.dropdown-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1200;
  width: 220px;
  padding: 0.75rem;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.dropdown-menu.show {
  display: block;
}

.user-info-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 0.5rem;
}

.user-info-header strong {
  font-size: 0.85rem;
  word-break: break-all;
}

.user-role-badge {
  width: fit-content;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.user-badge {
  color: var(--accent-text);
  background-color: var(--accent-soft);
}

.admin-badge {
  color: var(--success-text);
  background-color: var(--success-soft);
}

.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-list a,
.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}

.menu-list a:hover,
.logout-btn:hover {
  background: var(--surface-2);
}

.admin-link {
  color: var(--success-text);
  font-weight: 600;
}

.logout-btn {
  color: #dc2626;
}

.logout-form {
  margin: 0;
}

/* کشوی موبایل */
.mobile-drawer-header,
.mobile-actions-wrapper,
.close-drawer-btn,
.menu-toggle {
  display: none;
}

.menu-toggle {
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--text);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================
   ۷. پیام‌ها (toast)
   ========================================== */
.site-messages {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: min(560px, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  animation: toastOut 0.5s ease 7s forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.alert {
  padding: 0.85rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.92rem;
  background-color: var(--surface);
  box-shadow: var(--shadow-lg);
}

.alert-success {
  background-image: linear-gradient(var(--success-soft), var(--success-soft));
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--success-text);
}

.alert-error {
  background-image: linear-gradient(var(--danger-soft), var(--danger-soft));
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger-text);
}

.alert-info,
.alert-warning {
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--accent-text);
}

/* ==========================================
   ۸. بنر، جست‌وجو و کارت دوره‌ها
   ========================================== */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin: 3rem 0;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-content h1 {
  font-size: 2rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-image {
  flex: 1;
  max-width: 550px;
  border-radius: var(--radius);
}

/* جست‌وجو */
.search {
  max-width: 600px;
  margin: 16px auto;
  padding: 0 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--success);
  box-shadow: 0 12px 30px -5px rgba(34, 197, 94, 0.15);
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #9ca3af;
  transition: color 0.3s ease;
}

.search-box:focus-within .search-icon {
  color: var(--success);
}

.search-field input {
  width: 100%;
  padding: 10px 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem; /* حداقل 16px تا Safari در iOS زوم نکند */
}

.search-field input::placeholder {
  color: #9ca3af;
  font-size: 0.9rem;
}

.search-box .btn {
  min-height: 44px;
  border-radius: var(--radius);
}

/* کارت دوره (طرح جدید: عکس، توضیح، مدرس، امتیاز، دانشجو و قیمت) */
.course-card {
  position: relative;
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    box-shadow 0.4s ease,
    display 0.4s ease allow-discrete;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* مخفی شدن هنگام فیلتر */
.course-card.hide {
  display: none;
  opacity: 0;
  transform: scale(0.9) translateY(10px);
}

.course-card-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--surface-2);
}

.course-card-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  transition: transform 0.3s ease;
}

.course-soon-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: #713f12;
  background: #fde68a;
}

.course-card:hover .course-card-media img {
  transform: scale(1.05);
}

.course-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.25rem;
}

.course-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
}

/* کل کارت قابل کلیک است */
.course-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.course-card-title a:focus-visible {
  outline: none;
}

.course-card:has(.course-card-title a:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.course-card-desc {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.85rem;
}

.course-card-teacher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-avatar {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--text);
}

[data-theme="dark"] .mini-avatar {
  color: var(--bg);
}

.course-card-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--text-muted);
}

.course-card-rating i {
  color: #f59e0b;
}

.course-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.75rem 0.25rem 0.25rem;
  border-top: 1px solid var(--border);
}

.course-card-students {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.course-card-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.price-old-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-old-row del {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.discount-pill {
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--success);
}

.price-final {
  color: var(--success-text);
}

.price-final strong {
  font-size: 1.2rem;
  font-weight: 800;
}

.price-final small {
  font-size: 0.8rem;
}

/* اسلایدر دوره‌ها در صفحه اصلی */
.course-slider {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.course-track {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0.25rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.course-track::-webkit-scrollbar {
  display: none;
}

.slider-btn {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--surface);
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.slider-btn:hover:not(:disabled) {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.slider-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.slider-btn-prev {
  right: -15px;
}

.slider-btn-next {
  left: -15px;
}

/* شبکه دوره‌ها و فیلتر (صفحه همه دوره‌ها / دوره‌های من) */
.course-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0.25rem;
}

.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 900px;
  margin: 1.5rem auto 2rem;
  padding: 0 0.5rem;
}

.filter-btn {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* وضعیت ثبت‌نام زیر کارت (دوره‌های من) */
.enroll-status {
  display: inline-block;
  margin: 0.75rem 1rem 0;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  background-color: var(--accent-soft);
  color: var(--accent-text);
}

.enroll-status.confirmed {
  background-color: var(--success-soft);
  color: var(--success-text);
}

.enroll-status.canceled {
  background-color: var(--danger-soft);
  color: var(--danger-text);
}

/* ==========================================
   ۹. جدول زمان‌بندی
   ========================================== */

/* ==========================================
   ۱۰. سربخش‌ها و مقالات
   ========================================== */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-text);
  background-color: var(--accent-soft);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
}

.section-subtitle {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.articles {
  padding: 4rem 1rem;
}

.slider-controls {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.control-btn:hover:not(:disabled) {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.control-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.articles-carousel {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 0.25rem 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.articles-carousel::-webkit-scrollbar {
  display: none;
}

.article-card {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-banner {
  position: relative;
  height: 190px;
  overflow: hidden;
  background-color: #e2e8f0; /* ثابت: تصاویر PNG شفاف در حالت شب هم دیده شوند */
}

.card-banner img {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.article-card:hover .card-banner img {
  transform: scale(1.05);
}

.card-category {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  background-color: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(4px);
}

.card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.card-title {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
}

.card-desc {
  display: -webkit-box;
  margin-bottom: 1.25rem;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-meta > div {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-footer {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-text);
}

.card-title a:hover,
.card-footer:hover {
  color: var(--accent-hover);
}

.card-banner {
  display: block;
}

.articles-more {
  margin-top: 0.5rem;
  text-align: center;
}

/* صفحه لیست مقالات */
.articles-intro {
  margin-bottom: 2rem;
  text-align: center;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.articles-grid .empty-state {
  grid-column: 1 / -1;
}

/* صفحه مقاله */
.article-page {
  max-width: 860px;
  padding-bottom: 2rem;
}

.article-related {
  margin-top: 1rem;
}

.article-related .section-title {
  margin-bottom: 1.25rem;
}

/* ==========================================
   ۱۱. فوتر
   ========================================== */
.site-footer {
  padding: 50px 0 20px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

.footer-col:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 197, 94, 0.4);
}

.footer-title {
  position: relative;
  align-self: flex-start;
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 700;
}

/* خط زیر تیتر با هاور تا انتهای متن کش می‌آید */
.footer-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--primary);
  transition: width 0.4s ease;
}

.footer-col:hover .footer-title::after {
  width: 100%;
}

.footer-desc {
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.social-links a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.social-links a:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.footer-links a:hover {
  padding-right: 4px;
  color: var(--primary);
}

.contact-item {
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-word;
}

.contact-item span {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--text);
}

.namad-box {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.namad-card {
  flex: 1;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================
   ۱۲. صفحه جزئیات دوره (و چیدمان دوستونه تماس با ما)
   ========================================== */
.page-header {
  margin-bottom: 25px;
  padding: 15px 0;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--success);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  padding-bottom: 2rem;
}

.card {
  margin-bottom: 25px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--success-text);
  background-color: var(--success-soft);
}

.detail-title {
  margin-bottom: 10px;
  font-size: 1.6rem;
  font-weight: 800;
}

.detail-subtitle {
  margin-bottom: 20px;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.detail-meta dt {
  display: inline;
  margin-left: 5px;
  color: var(--text-muted);
}

.detail-meta dd {
  display: inline;
  font-weight: 700;
}

.detail-media {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.detail-media img {
  width: 100%;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 12px 24px;
  border-radius: 50px;
  background-color: rgba(34, 197, 94, 0.95);
  color: #fff;
  font-weight: 700;
  transform: translate(-50%, -50%);
  transition: background-color 0.2s ease;
}

.play-btn:hover {
  background-color: var(--success-hover);
}

/* متن‌های بلند داخل کارت */
.prose h2,
.prose h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.prose p {
  margin-bottom: 1rem;
  line-height: 1.9;
}

.features-list {
  margin-top: 12px;
}

.features-list li {
  position: relative;
  margin-bottom: 10px;
  padding-right: 25px;
  font-size: 0.95rem;
}

.features-list li::before {
  content: "✓";
  position: absolute;
  right: 0;
  font-weight: 700;
  color: var(--success);
}

/* مدرس */
.teacher-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.teacher-card img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--success-soft);
}

.teacher-card h3 {
  font-size: 1.2rem;
}

.teacher-role {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}

.teacher-bio {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* مدرس در ستون کناری (بعد از خرید) */
.teacher-card-compact {
  flex-direction: column;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* ویدیوی معرفی دوره */
.intro-video video {
  width: 100%;
  height: auto;
  margin-top: 12px;
  border-radius: var(--radius-lg);
  background-color: #000;
}

/* پیام عدم امکان خرید برای مدیر */
.staff-note {
  margin: 0;
  text-align: center;
}

/* سرفصل‌ها و ویدیوهای دوره */
.syllabus-note {
  margin-bottom: 15px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  background-color: var(--accent-soft);
  color: var(--accent-text);
}

.chapter {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.chapter > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
}

.chapter > summary small {
  font-weight: 400;
  color: var(--text-muted);
}

.lesson-list {
  margin: 0;
  padding: 0 16px 10px;
  list-style: none;
}

.lesson {
  padding: 10px 0;
  border-top: 1px dashed var(--border);
  font-size: 0.92rem;
}

.lesson-player summary {
  cursor: pointer;
  color: var(--success);
}

.lesson-player video {
  width: 100%;
  height: auto;
  margin-top: 10px;
  border-radius: var(--radius);
  background-color: #000;
}

.lesson-locked,
.lesson-empty {
  color: var(--text-muted);
}

/* ==========================================
   فروشگاه جزوات و پروژه‌ها
   ========================================== */
.shop-intro {
  margin-bottom: 30px;
  text-align: center;
}

.shop-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.shop-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
  padding: 18px;
}

.shop-sidebar-title {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}

.shop-cat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.shop-cat-link i {
  width: 18px;
  text-align: center;
}

.shop-cat-link small {
  margin-inline-start: auto;
  font-size: 0.75rem;
  opacity: 0.8;
}

.shop-cat-link:hover {
  background-color: var(--surface-2);
  color: var(--text);
}

.shop-cat-link.active {
  border-color: var(--accent-soft);
  font-weight: 700;
  background-color: var(--accent-soft);
  color: var(--accent-text);
}

.shop-kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.shop-kind {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  background-color: var(--surface);
  color: var(--text-muted);
}

.shop-kind.active {
  border-color: var(--accent);
  background-color: var(--accent);
  color: #fff;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.4s ease;
}

.shop-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* انیمیشن ورود: کارت‌ها همیشه دیده می‌شوند و فقط وقتی به دید کاربر می‌رسند یک‌بار نرم ظاهر می‌شوند
   (اگر JS یا مرورگر کار نکند هیچ کارتی پنهان نمی‌ماند) */
.shop-card.reveal {
  animation: shop-reveal 0.5s ease; /* بدون fill تا افکت hover کارت را قفل نکند */
}

@keyframes shop-reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.shop-card-thumb {
  position: relative;
  display: block;
  height: 170px;
  overflow: hidden;
  background-color: var(--surface-2);
}

.shop-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.shop-card:hover .shop-card-thumb img {
  transform: scale(1.05);
}

/* واترمارک روی پیش‌نمایش */
.shop-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(15, 23, 42, 0.28);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  user-select: none;
}

.shop-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background-color: var(--accent);
  color: #fff;
}

.shop-badge.kind-project {
  background-color: #7c3aed;
}

.shop-badge.static {
  position: static;
  display: inline-block;
  width: fit-content;
}

.shop-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  padding: 16px;
}

.shop-card-cat {
  font-size: 0.78rem;
  color: var(--accent-text);
}

.shop-card-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.7;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.shop-card-title a {
  color: var(--text);
}

.shop-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shop-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.shop-price {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  color: var(--success-text);
}

.shop-price del {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shop-price small {
  font-size: 0.72rem;
}

.shop-card-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

/* مودال جزئیات (<dialog> بومی) */
.shop-modal {
  width: min(820px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius-xl);
  background-color: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.shop-modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.shop-modal[open] {
  animation: shop-modal-in 0.25s ease;
}

@keyframes shop-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
}

.shop-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  background-color: var(--surface-2);
  color: var(--text);
}

.shop-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.shop-modal-media {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background-color: #0f172a;
}

.shop-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.shop-modal-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
}

.shop-modal-details h2 {
  font-size: 1.2rem;
  line-height: 1.6;
}

.shop-modal-desc {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.shop-specs {
  padding: 12px 14px;
  border-radius: var(--radius);
  background-color: var(--surface-2);
}

.shop-modal-buy {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.shop-modal-price {
  font-size: 1.15rem;
  color: var(--success-text);
}

.shop-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-detail-media {
  position: relative;
  overflow: hidden;
}

.shop-note {
  margin-top: 10px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

.shop-related-title {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.shop-sandbox {
  max-width: 560px;
  margin: 0 auto;
}

.shop-sandbox-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .shop-sidebar {
    position: static;
    min-width: 0;
  }

  /* دسته‌بندی‌ها در موبایل: یک ردیف افقی قابل اسکرول */
  .shop-cat-list {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .shop-cat-link {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .shop-cat-link small {
    margin-inline-start: 4px;
  }
}

@media (max-width: 700px) {
  .shop-modal-grid {
    grid-template-columns: 1fr;
  }

  .shop-modal-media {
    min-height: 180px;
    max-height: 220px;
  }

  .shop-modal-details {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-card,
  .shop-card-thumb img {
    transition: none;
  }

  .shop-modal[open],
  .shop-card.reveal {
    animation: none;
  }
}

/* تالار گفتگوی دوره */
.forum-link {
  margin-bottom: 18px;
}

.forum-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
}

.forum-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.forum-room {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: min(62vh, 580px);
  margin: 0;
  padding: 6px 6px 6px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

/* هر پیام: آواتار + حباب. پیام‌های من سمت راست، بقیه سمت چپ (در RTL) */
.chat-msg {
  display: flex;
  flex-direction: row-reverse; /* آواتار سمت چپِ حباب */
  align-items: flex-end;
  gap: 8px;
  max-width: min(85%, 580px);
  align-self: flex-end;
  animation: chat-in 0.25s ease;
}

.chat-msg.is-mine {
  flex-direction: row; /* آواتار سمت راستِ حباب */
  align-self: flex-start;
}

@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.chat-avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-msg.is-mine .chat-avatar {
  border-color: transparent;
  background-color: var(--primary);
  color: #fff;
}

.chat-bubble {
  min-width: 140px;
  padding: 10px 14px 8px;
  border: 1px solid var(--border);
  border-radius: 18px 18px 4px 18px; /* دم حباب سمت آواتار */
  background-color: var(--surface-2);
  color: var(--text);
}

.chat-msg.is-mine .chat-bubble {
  border-color: transparent;
  border-radius: 18px 18px 18px 4px;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-hover) 100%
  );
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.55);
}

.chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.chat-author {
  font-size: 0.85rem;
  color: var(--accent-text);
}

.chat-msg.is-mine .chat-author {
  color: #fff;
}

.chat-role {
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
}

.chat-role.is-teacher {
  background-color: var(--success-soft);
  color: var(--success-text);
}

.chat-role.is-staff {
  background-color: var(--danger-soft);
  color: var(--danger-text);
}

.chat-msg.is-mine .chat-role {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.chat-body {
  font-size: 0.93rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.chat-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-msg.is-mine .chat-foot {
  color: rgba(255, 255, 255, 0.8);
}

.chat-delete button {
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  background: none;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.chat-delete button:hover,
.chat-delete button:focus-visible {
  opacity: 1;
}

/* تالار خالی: پیام + دکمه «نوشتن پیام»؛ با کلیک، فرم همین‌جا باز می‌شود */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(100%, 520px);
  margin: auto;
  text-align: center;
  color: var(--text-muted);
}

.chat-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 1.6rem;
  background-color: var(--accent-soft);
  color: var(--accent-text);
}

.chat-empty .chat-form {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  box-shadow: var(--shadow-md);
  animation: chat-in 0.25s ease;
}

.chat-form {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-compose textarea {
  flex: 1;
  min-height: 48px;
  max-height: 160px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  font: inherit;
  text-align: right;
  background-color: var(--surface);
  color: var(--text);
}

.chat-compose textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-status {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--danger-text);
}

.chat-status:empty {
  display: none;
}

@media (max-width: 600px) {
  .chat-msg {
    max-width: 94%;
  }

  .chat-compose {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-msg,
  .chat-empty .chat-form {
    animation: none;
  }
}

.enroll-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.enroll-forum {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-text);
}

/* دکمه‌های پاسخ / حذف زیر دیدگاه */
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 16px;
  margin-top: 10px;
}

.comment-actions .reply-box {
  flex: 1 1 260px;
  margin-top: 0;
}

.comment-delete-btn {
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  background: none;
  color: var(--danger);
}

.comment-delete-btn:hover {
  text-decoration: underline;
}

/* فرم پاسخ مدرس/مدیر زیر هر دیدگاه */
.reply-box {
  margin-top: 12px;
}

.reply-box summary {
  width: fit-content;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}

.reply-box form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.reply-box textarea {
  width: 100%;
}

/* دیدگاه‌ها */
.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.comments-count {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background-color: var(--surface-2);
}

.comment-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.comment-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-avatar {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
}

.comment-avatar.is-teacher {
  background-color: var(--success);
  border-color: var(--success);
  color: #fff;
}

.comment-author {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
}

.comment-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.92rem;
  line-height: 1.7;
}

.comment-reply {
  margin: 12px 20px 0 0;
  padding: 15px;
  border-right: 3px solid var(--success);
  border-radius: 0 var(--radius) var(--radius) 0;
  background-color: var(--success-soft);
}

/* ستون کناری سفارش */
.order-card {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
}

.price-box {
  margin-bottom: 20px;
  text-align: center;
}

.old-price {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.current-price {
  margin: 5px 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--success);
}

.current-price small {
  font-size: 0.9rem;
  font-weight: 400;
}

.discount-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #fff;
  background-color: var(--danger);
}

.info-list {
  margin: 20px 0;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 12px;
  font-size: 0.88rem;
}

.info-list dt {
  color: var(--text-muted);
}

.info-list dd {
  font-weight: 700;
  text-align: left;
}

.info-list a {
  color: var(--accent-text);
}

/* فرم کد تخفیف در باکس سفارش */
.coupon-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.coupon-form input {
  flex: 1;
  min-width: 0;
}

.coupon-form .btn {
  padding: 0.55rem 1rem;
}

.coupon-applied {
  flex: 1;
  font-size: 0.88rem;
  color: var(--success-text);
}

/* ==========================================
   ۱۳. فرم‌ها و مودال
   ========================================== */
.form-box {
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface-2);
}

.form-box h3,
.form-box h2 {
  margin-bottom: 15px;
  font-size: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-field {
  margin-bottom: 12px;
}

.form-field label:not(.sr-only) {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.form input:not([type="checkbox"]):not([type="radio"]),
.form textarea,
.form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  font-size: 0.9rem;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.form input[readonly] {
  opacity: 0.7;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.15rem;
}

.modal-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text);
}

.modal-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  font-size: 0.95rem;
}

.modal-summary strong {
  font-size: 1.1rem;
  color: var(--success);
}

/* ==========================================
   ۱۴. صفحه درباره ما
   ========================================== */
.about-page {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-bottom: 3rem;
}

.about-page .hero {
  margin-bottom: 0;
}

.hero .section-badge {
  margin-bottom: 0.75rem;
}

.highlight {
  color: var(--primary);
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.about-story {
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  border-right: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
}

.about-story p {
  font-size: 1rem;
  line-height: 2.1;
  color: var(--text-muted);
}

.about-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.about-teachers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.about-feature,
.about-teacher {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.about-feature:hover,
.about-teacher:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.about-feature {
  padding: 1.75rem 1.5rem;
}

.about-feature-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 14px;
  font-size: 1.3rem;
  color: var(--accent);
  background-color: var(--accent-soft);
}

[data-theme="dark"] .about-feature-icon {
  color: var(--success-text);
  background-color: var(--success-soft);
}

.about-feature h3,
.about-teacher h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.about-feature p,
.about-teacher p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.about-teacher {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.75rem 1.25rem;
  text-align: center;
}

.about-teacher img {
  width: 96px;
  height: 96px;
  margin-bottom: 1rem;
  border-radius: 50%;
  border: 3px solid var(--success-soft);
  background-color: var(--surface);
}

.about-teacher .teacher-role {
  margin-bottom: 0.5rem;
}

.about-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem 2.25rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
}

.about-cta h2 {
  margin-bottom: 0.4rem;
  font-size: 1.4rem;
}

.about-cta p {
  font-size: 0.95rem;
  opacity: 0.85;
}

.about-cta .about-actions {
  margin-top: 0;
}

/* ==========================================
   ۱۵. ریسپانسیو
   ========================================== */

@media (min-width: 576px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 992px) {
  .detail-layout {
    grid-template-columns: 2.8fr 1.2fr;
  }
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-content,
  .hero-image {
    max-width: 100%;
  }

  .about-actions {
    justify-content: center;
  }

  .about-features {
    grid-template-columns: 1fr;
  }

  

  

  
}

@media (max-width: 768px) {
  /* کارت‌های صفحه دوره‌ها در موبایل وسط‌چین */
  .course-grid {
    justify-content: center;
  }

  /* منو به کشوی سمت راست تبدیل می‌شود */
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -280px;
    z-index: 1001;
    width: 280px;
    height: 100vh;
    height: 100dvh; /* the visible height: with 100vh the bottom (login button) hides behind the mobile browser's bar */
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    background-color: var(--surface);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
  }

  .nav-links.active {
    right: 0;
  }

  .mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
  }

  .drawer-title {
    font-weight: 700;
    color: var(--primary);
  }

  .close-drawer-btn {
    display: block;
    border: none;
    background: transparent;
    font-size: 1.5rem;
  }

  .nav-menu-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-menu-list a {
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
  }

  .dropdown .submenu {
    position: static;
    display: none;
    padding: 0;
    border: 0;
    box-shadow: none;
    background-color: var(--surface-2);
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .dropdown.active .submenu {
    display: block;
  }

  .submenu a {
    padding: 0.8rem 2rem;
  }

  .mobile-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 1.2rem;
    border-bottom: 1px solid var(--border);
  }

  .mobile-actions-wrapper .nav-actions {
    flex-direction: column;
    width: 100%;
  }

  .mobile-actions-wrapper .btn-brand,
  .mobile-actions-wrapper .user-profile-dropdown,
  .mobile-actions-wrapper .profile-toggle-btn {
    width: 100%;
    justify-content: center;
  }

  .mobile-actions-wrapper .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
  }

  /* جدول زمان‌بندی: هر روز یک کارت */

  

  

  

  

  

  

  

  /* ساعت هر کلاس بالای سلولش */
}

@media (max-width: 576px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-card {
    flex-basis: 270px;
  }

  .teacher-card {
    flex-direction: column;
    text-align: center;
  }

  .btn-center {
    max-width: 100%;
  }

  .about-story,
  .about-cta {
    padding: 1.25rem;
  }

  

  .about-cta {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .search-box {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-xl);
  }

  .search-box .btn {
    width: 100%;
  }
}

.articles-carousel .empty-state {
  flex: 1;
}
