/* =========================================================
   IRANICAI - Design Tokens & Global Styles
   ========================================================= */

:root {
  /* رنگ‌های برند */
  --navy: #0a1128;
  --navy-light: #0f1c3f;
  --dark-blue: #101935;
  --electric-blue: #0b5fff;
  --electric-blue-light: #4a8bff;
  --violet: #0b5fff;
  --violet-light: #4a8bff;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;

  --gradient-main: linear-gradient(135deg, var(--navy) 0%, #102452 50%, #0d3a7a 100%);
  --gradient-accent: linear-gradient(135deg, #0b5fff 0%, #0a3fc4 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 8px rgba(10, 17, 40, .06);
  --shadow-md: 0 8px 24px rgba(10, 17, 40, .10);
  --shadow-lg: 0 20px 50px rgba(10, 17, 40, .16);

  --font-main: 'Vazirmatn', Tahoma, sans-serif;

  --transition: all .25s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  direction: rtl;
  text-align: right;
  margin: 0;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.9;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 { font-weight: 800; margin: 0 0 .5em; color: var(--navy); line-height: 1.5; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
p { margin: 0 0 1em; color: var(--gray-600);}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { padding: 0; margin: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-header { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.card-body small { font-weight: 700; color: var(--gray-600) !important; }
.section-header .eyebrow {
  display: inline-block; color: var(--electric-blue); font-weight: 800;
  font-size: .88rem; letter-spacing: .5px; margin-bottom: 10px;
  background: rgba(11,95,255,.1); padding: 7px 20px; border-radius: var(--radius-full);
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 30px; border-radius: var(--radius-full); font-weight: 700; font-size: .95rem;
  transition: var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--gradient-accent); color: #fff; box-shadow: 0 8px 20px rgba(124,58,237,.3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(124,58,237,.4); }
.btn-outline { border: 2px solid var(--gray-200); color: var(--navy); background: #fff; }
.btn-outline:hover { border-color: var(--electric-blue); color: var(--electric-blue); }
.btn-ghost-light { border: 2px solid rgba(255,255,255,.3); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 9px 18px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===================== Header ===================== */
.site-header {
  position: sticky; top: 0; z-index: 999; background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--gray-200);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 14px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.2rem; color: var(--navy); flex-shrink: 0; }
.logo img { height: 40px; max-width: 170px; object-fit: contain; display: block; }
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; min-width: 0; }
.main-nav > ul { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  padding: 9px 12px; border-radius: var(--radius-full); font-weight: 600; font-size: .85rem;
  color: var(--gray-800); transition: var(--transition); display: inline-block; white-space: nowrap;
}
.main-nav > ul > li > a:hover, .main-nav > ul > li.active > a { background: var(--gray-100); color: var(--electric-blue); }
.header-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hamburger { display: none; font-size: 1.6rem; color: var(--navy); }

/* Mega منو */
.has-mega { position: relative; }
.mega-menu {
  position: absolute; top: 100%; right: 50%; transform: translateX(50%); min-width: 640px; max-width: 920px;
  background: #ffffff; box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 30px; margin-top: 10px; display: none; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px; z-index: 50;
}
/* نمایش دراپ‌داون با کلاس mega-open که با جاوااسکریپت (همراه با تاخیر کوتاه ضدِ-لغزش موس) کنترل می‌شود؛
   :focus-within هم برای ناوبری با کیبورد (بدون جاوااسکریپت) نگه داشته شده */
.has-mega.mega-open .mega-menu, .has-mega:focus-within .mega-menu { display: grid; }
.mega-col h4 { font-size: .95rem; color: var(--electric-blue); margin-bottom: 14px; }
.mega-col ul li a { display: block; padding: 6px 0; font-size: .88rem; color: var(--gray-600); }
.mega-col ul li a:hover { color: var(--violet); padding-right: 4px; }

/* ===================== Hero ===================== */
.hero {
  position: relative; background: var(--gradient-main); color: #fff; overflow: hidden;
  padding: 100px 0 120px;
}
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(circle at 20% 30%, rgba(59,130,246,.25), transparent 40%),
                     radial-gradient(circle at 80% 70%, rgba(124,58,237,.3), transparent 40%);
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.hero h1 { color: #fff; }
.hero p.lead { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-visual { position: relative; }
.ai-orb {
  width: 100%; aspect-ratio: 1/1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(96,165,250,.5), rgba(124,58,237,.15) 60%, transparent 70%);
  position: relative; animation: float 6s ease-in-out infinite;
}
.ai-orb::before, .ai-orb::after {
  content: ''; position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%;
}
.ai-orb::before { inset: 8%; animation: spin 20s linear infinite; }
.ai-orb::after { inset: 20%; animation: spin 30s linear infinite reverse; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ===================== Stats ===================== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: -60px; position: relative; z-index: 5; }
.stat-card {
  background: #fff; border-radius: var(--radius-lg); padding: 30px 20px; text-align: center; box-shadow: var(--shadow-md);
}
.stat-card .num { font-size: 2.5rem; font-weight: 900; background: var(--gradient-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .label { color: var(--gray-600); font-size: .9rem; margin-top: 6px; font-weight: 600; }

/* ===================== Trust ===================== */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.trust-item { text-align: center; padding: 30px 16px; }
.trust-item .icon-wrap {
  width: 70px; height: 70px; border-radius: var(--radius-lg); background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: #fff; font-size: 1.6rem;
}

/* ===================== Cards ===================== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: var(--transition); border: 1px solid var(--gray-200); display: flex; flex-direction: column; height: 100%;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-img { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--gray-100); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.card:hover .card-img img { transform: scale(1.06); }
.card-badge {
  position: absolute; top: 12px; right: 12px; background: rgba(10,17,40,.75); color: #fff; font-size: .75rem;
  padding: 5px 12px; border-radius: var(--radius-full); backdrop-filter: blur(6px);
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--gray-400); flex-wrap: wrap; }
.card-title { font-size: 1.05rem; font-weight: 800; color: var(--navy); }
.card-price { font-weight: 800; color: var(--electric-blue); }
.card-price .old { text-decoration: line-through; color: var(--gray-400); font-weight: 500; font-size: .85rem; margin-left: 6px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-top: 1px solid var(--gray-100); margin-top: auto; }
.progress-bar { height: 6px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--gradient-accent); }

/* Instructor card */
.instructor-card { text-align: center; padding: 30px 20px; }
.instructor-card .avatar { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 16px; overflow: hidden; border: 4px solid var(--gray-100); }
.instructor-card .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===================== Testimonials ===================== */
.testimonial-card { background: #fff; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.testimonial-card .rating { color: #f59e0b; margin-bottom: 10px; }
.testimonial-user { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.testimonial-user img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }

/* ===================== CTA Band ===================== */
.cta-band {
  background: var(--gradient-main); border-radius: var(--radius-lg); padding: 60px 40px; text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }

/* ===================== Footer ===================== */
.site-footer { background: var(--navy); color: rgba(255,255,255,.7); padding: 70px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; }
.footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid ul li a:hover { color: var(--electric-blue-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 50px; padding-top: 24px; text-align: center; font-size: .85rem; }
.social-icons { display: flex; gap: 10px; margin-top: 16px; }
.social-icons a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.social-icons a:hover { background: var(--gradient-accent); }

/* ===================== Breadcrumb ===================== */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--gray-400); margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--electric-blue); }

/* ===================== Filters / Search ===================== */
.filters-bar { background: #fff; border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 30px; }
.filters-row { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 12px; align-items: center; }
.filters-row-articles { grid-template-columns: 2fr 1fr auto; }
@media (max-width: 768px) { .filters-row-articles { grid-template-columns: 1fr; } }
.form-control {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; transition: var(--transition); background: #fff;
}
.form-control:focus { outline: none; border-color: var(--electric-blue); }
.search-box { position: relative; }
.search-box input { padding-right: 44px; }
.search-box .icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }

/* ===================== Tabs / Accordion ===================== */
.tabs-nav { display: flex; gap: 6px; border-bottom: 2px solid var(--gray-200); overflow-x: auto; margin-bottom: 30px; }
.tabs-nav button { padding: 14px 20px; font-weight: 700; color: var(--gray-400); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs-nav button.active { color: var(--electric-blue); border-color: var(--electric-blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }

.accordion-item { border: 1px solid var(--gray-200); border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden; }
.accordion-header { padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; background: #fff; }
.accordion-header .arrow { transition: var(--transition); }
.accordion-item.open .accordion-header .arrow { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; padding: 0 22px; color: var(--gray-600); }
.accordion-item.open .accordion-body { padding: 0 22px 18px; }

/* ===================== Badges / Alerts ===================== */
.badge { display: inline-block; padding: 5px 14px; border-radius: var(--radius-full); font-size: .78rem; font-weight: 700; }
.badge-blue { background: rgba(59,130,246,.12); color: var(--electric-blue); }
.badge-green { background: rgba(16,185,129,.12); color: #059669; }
.badge-amber { background: rgba(245,158,11,.12); color: #b45309; }
.badge-red { background: rgba(239,68,68,.12); color: #dc2626; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-indigo { background: rgba(99,102,241,.12); color: #4f46e5; }
.badge-emerald { background: rgba(5,150,105,.12); color: #047857; }

.alert { padding: 16px 20px; border-radius: var(--radius-md); margin-bottom: 20px; font-size: .9rem; }
.alert-success { background: rgba(16,185,129,.1); color: #047857; border: 1px solid rgba(16,185,129,.25); }
.alert-error { background: rgba(239,68,68,.1); color: #b91c1c; border: 1px solid rgba(239,68,68,.25); }
.alert-info { background: rgba(59,130,246,.1); color: #1d4ed8; border: 1px solid rgba(59,130,246,.25); }

/* ===================== Pagination ===================== */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.page-link { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: #fff; border: 1.5px solid var(--gray-200); font-weight: 700; }
.page-link.active { background: var(--gradient-accent); color: #fff; border-color: transparent; }

/* ===================== Empty / Loading ===================== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }

/* ===================== Detail pages ===================== */
.detail-hero { background: var(--gradient-main); color: #fff; padding: 60px 0; }
.detail-hero-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.sticky-card { background: #fff; border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-lg); position: sticky; top: 100px; color: var(--gray-800); }
.sticky-card .price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.info-list li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--gray-200); font-size: .9rem; }
.info-list li:last-child { border: none; }

.rich-content { line-height: 2; }
.rich-content h2, .rich-content h3 { margin-top: 1.5em; }

/* Bottom mobile CTA */
.mobile-sticky-cta {
  display: none; position: fixed; bottom: 0; right: 0; left: 0; background: #fff; z-index: 900;
  padding: 14px 18px; box-shadow: 0 -6px 20px rgba(0,0,0,.08); align-items: center; justify-content: space-between; gap: 14px;
}

/* ===================== Owl Carousel Customization ===================== */
.owl-carousel-section { position: relative; }
.owl-carousel .item { padding: 6px; }
.owl-carousel .owl-stage-outer { padding: 6px 0 16px; }
.owl-nav { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.owl-nav button.owl-prev, .owl-nav button.owl-next {
  width: 42px; height: 42px; border-radius: 50%; background: #fff !important; border: 1.5px solid var(--gray-200) !important;
  color: var(--navy) !important; font-size: 1.3rem !important; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.owl-nav button.owl-prev:hover, .owl-nav button.owl-next:hover { background: var(--gradient-accent) !important; color: #fff !important; border-color: transparent !important; }
.owl-dots { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.owl-dot span { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-200); display: block; transition: var(--transition); }
.owl-dot.active span { background: var(--electric-blue); width: 22px; border-radius: 5px; }

/* ===================== Neuron / Brain Hero Animation ===================== */
.brain-visual { width: 100%; max-width: 480px; margin: 0 auto; }
.brain-visual svg { width: 100%; height: auto; overflow: visible; }
.neuron-dot { fill: #4a8bff; filter: drop-shadow(0 0 6px rgba(74,139,255,.9)); animation: neuronPulse 2.4s ease-in-out infinite; }
.neuron-dot.d2 { animation-delay: .3s; }
.neuron-dot.d3 { animation-delay: .6s; }
.neuron-dot.d4 { animation-delay: .9s; }
.neuron-dot.d5 { animation-delay: 1.2s; }
.neuron-dot.d6 { animation-delay: 1.5s; }
@keyframes neuronPulse {
  0%, 100% { opacity: .55; r: 3.2; }
  50% { opacity: 1; r: 5; }
}
.neuron-line { stroke: rgba(74,139,255,.35); stroke-width: 1.2; fill: none; }
.neuron-signal { stroke: #7ec1ff; stroke-width: 2; fill: none; stroke-dasharray: 10 400; stroke-dashoffset: 0; animation: signalTravel 3s linear infinite; }
.neuron-signal.s2 { animation-delay: .7s; }
.neuron-signal.s3 { animation-delay: 1.4s; }
.neuron-signal.s4 { animation-delay: 2.1s; }
@keyframes signalTravel { from { stroke-dashoffset: 410; } to { stroke-dashoffset: 0; } }
.brain-outline { stroke: rgba(255,255,255,.25); stroke-width: 1.5; fill: rgba(255,255,255,.02); }
@keyframes brainFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.brain-visual svg { animation: brainFloat 6s ease-in-out infinite; }

/* ===================== Team Section ===================== */
.team-card { text-align: center; padding: 26px 18px; }
.team-card .avatar { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 14px; overflow: hidden; border: 3px solid var(--gray-100); }
.team-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-card .role { color: var(--electric-blue); font-size: .82rem; font-weight: 700; margin-bottom: 6px; }
[data-aos] { will-change: transform, opacity; }

/* ===================== Responsive Grid Utilities ===================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-380 { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 1024px) { .grid-380 { grid-template-columns: 1fr; } }

/* ===================== Utilities ===================== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ===================== Responsive ===================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-row { grid-template-columns: 1fr 1fr; }
  .detail-hero-grid { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}
@media (max-width: 768px) {
  .main-nav, .header-cta .btn-outline { display: none; }
  .hamburger { display: block; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 240px; margin: 0 auto; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); margin-top: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .filters-row { grid-template-columns: 1fr; }
  .mobile-sticky-cta.show-on-mobile { display: flex; }
  .section { padding: 50px 0; }
}

/* Mobile drawer menu */
.mobile-drawer {
  position: fixed; inset: 0; background: rgba(10,17,40,.6); z-index: 1000; display: none;
}
.mobile-drawer.open { display: block; }
.mobile-drawer-panel {
  position: absolute; top: 0; right: 0; width: 82%; max-width: 340px; height: 100%; background: #fff;
  padding: 24px; overflow-y: auto; animation: slideIn .3s ease;
}
@keyframes slideIn { from { transform: translateX(100%);} to { transform: translateX(0);} }
.mobile-drawer-panel ul li a { display: block; padding: 14px 6px; font-weight: 700; border-bottom: 1px solid var(--gray-100); }
.close-drawer { font-size: 1.6rem; margin-bottom: 20px; }
