/* فونت وزیرمتن به‌صورت محلی (self-hosted) — قبلاً از گوگل‌فونتز لود می‌شد که برای بعضی کاربرها
   (بسته به مسیر شبکه‌شون) قابل‌دسترس نبود و فونت اصلی سایت لود نمی‌شد؛ الان کاملاً محلیه */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/vazirmatn-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/vazirmatn-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/vazirmatn-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ========== متغیرهای رنگ ========== */
/* تم تیره ~۱۲٪ روشن‌تر شده (آزمایشی) — مقادیر اصلی قبلی برای بازگشت آسون:
   --bg-primary:#0a0e1f  --bg-secondary:#10152a  --bg-card:#131a2e
   --bg-input:#0a0e1f    --purple-glow:#1a2147 */
:root {
  --bg-primary: #272b3a;
  --bg-secondary: #2d3144;
  --bg-card: #2f3547;
  --bg-input: #272b3a;
  --border-color: #7c3aed2e;
  --border-hover: #a855f7;
  --text-primary: #eef2ff;
  --text-secondary: #9099c4;
  --text-muted: #5c6699;
  --purple-main: #7c3aed;
  --purple-light: #a855f7;
  --purple-glow: #353c5d;
}

/* حالت روشن */
body.light-mode {
  --bg-primary: #f5f0ff;
  --bg-secondary: #ede5ff;
  --bg-card: #ffffff;
  --bg-input: #f5f0ff;
  --border-color: #7c3aed22;
  --border-hover: #7c3aed;
  --text-primary: #1a0a2e;
  --text-secondary: #4a2080;
  --text-muted: #7c5ab8;
  --purple-main: #7c3aed;
  --purple-light: #6d28d9;
  --purple-glow: #ede5ff;
}

/* همون مقادیر روی <html> — چون body موقع پارس‌شدنِ <head> هنوز وجود نداره، theme-sync.js
   کلاس رو اول روی html می‌ذاره تا رنگ درست از همون فریم اول پینت بشه (بدون فلش تیره/روشن)،
   بعد که body آماده شد همونجا هم اضافه می‌شه — این قانون دقیقاً کپی همون بالاست */
html.light-mode {
  --bg-primary: #f5f0ff;
  --bg-secondary: #ede5ff;
  --bg-card: #ffffff;
  --bg-input: #f5f0ff;
  --border-color: #7c3aed22;
  --border-hover: #7c3aed;
  --text-primary: #1a0a2e;
  --text-secondary: #4a2080;
  --text-muted: #7c5ab8;
  --purple-main: #7c3aed;
  --purple-light: #6d28d9;
  --purple-glow: #ede5ff;
}

html { height: 100%; }
body {
  font-family: 'Vazirmatn', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  transition: background-color 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== دکمه شب/روز ========== */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--purple-main);
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 20px #7c3aed55;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--purple-light);
  transform: scale(1.1);
}

/* ========== هدر ========== */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 0 2rem;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--purple-light);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav ul a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}

nav ul a:hover { color: var(--purple-light); }

.btn-register {
  background: var(--purple-main);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.3s;
}

.btn-register:hover { background: var(--purple-light); }

/* ========== هیرو ========== */
.hero {
  min-height: 100vh;
  padding-top: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at center, var(--purple-glow) 0%, var(--bg-primary) 70%);
  padding: 2rem;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-primary {
  background: var(--purple-main);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-family: 'Vazirmatn', sans-serif;
}

.btn-primary:hover {
  background: var(--purple-light);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 2px solid var(--purple-main);
  color: var(--purple-light);
  padding: 0.8rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
  background: transparent;
  cursor: pointer;
  font-family: 'Vazirmatn', sans-serif;
}

.btn-secondary:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

/* ========== آمار ========== */
.stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 4rem 2rem;
  background: var(--bg-secondary);
  flex-wrap: wrap;
}

.stat-card {
  text-align: center;
  padding: 2rem 3rem;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-card);
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--purple-light);
  transform: translateY(-3px);
}

.stat-card h2 {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--purple-light);
}

.stat-card p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ========== خدمات ========== */
.services {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.services h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 3rem;
  color: var(--purple-light);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 700px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.2rem;
  transition: all 0.3s;
}

@media (min-width: 700px) {
  .service-card { padding: 2rem; }
}

.service-card:hover {
  border-color: var(--purple-light);
  transform: translateY(-5px);
}

.service-card span { font-size: 1.8rem; }

@media (min-width: 700px) {
  .service-card span { font-size: 2.5rem; }
}

.service-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.8rem 0 0.4rem;
  color: var(--text-primary);
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

@media (min-width: 700px) {
  .service-card h3 { font-size: 1.2rem; margin: 1rem 0 0.5rem; }
  .service-card p { font-size: 0.9rem; }
}

/* ========== سایدبار ========== */
.sidebar {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 250px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--purple-light);
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

/* استایل‌های زیر قبلاً فقط از طریق JS (responsive-sidebar.js) تزریق می‌شدن؛ چون CSS خارجی
   render-blocking هست ولی اجرای اسکریپت بعد از پارس‌شدنِ body اتفاق می‌افته، یه لحظه لوگو با
   اندازه‌ی خام (بدون این استایل‌ها) پینت می‌شد و بعد ناگهان جمع می‌شد — همون فلش گزارش‌شده.
   با آوردنش به همینجا، از همون فریم اول اندازه‌ی درست اعمال می‌شه. */
.sidebar-logo { display: flex !important; align-items: center; justify-content: center; gap: 10px; background: none; }
.sidebar-logo .sidebar-logo-icon { width: 75px; height: 75px; flex-shrink: 0; overflow: hidden; pointer-events: none; }
.sidebar-logo .sidebar-logo-icon img { width: 100%; height: 100%; max-width: none; object-fit: contain; animation: sidebar-logo-spin 12s linear infinite; pointer-events: none; }
.sidebar-logo .sidebar-logo-text { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sidebar-logo .sidebar-logo-word, .sidebar-logo .sidebar-logo-tagline { position: relative; width: 118px; overflow: hidden; }
.sidebar-logo .sidebar-logo-word img, .sidebar-logo .sidebar-logo-tagline img { width: 100%; max-width: none; height: auto; display: block; }
.sidebar-logo .sidebar-logo-shine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; -webkit-mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-size: 100% 100%; mask-repeat: no-repeat; }
.sidebar-logo .sidebar-logo-shine-bar { position: absolute; top: -25%; left: -10%; width: 32%; height: 150%; background: linear-gradient(100deg, transparent 0%, transparent 30%, rgba(255,255,255,0.95) 50%, transparent 70%, transparent 100%); animation: sidebar-logo-shine 3.5s ease-in-out infinite; }
.sidebar-logo .sidebar-logo-tagline .sidebar-logo-shine-bar { animation-delay: 0.9s; }
@keyframes sidebar-logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes sidebar-logo-shine { 0% { transform: translateX(-400%); } 35% { transform: translateX(-400%); } 65% { transform: translateX(400%); } 100% { transform: translateX(400%); } }
.theme-dark-only { display: block; }
.theme-light-only { display: none; }
body.light-mode .theme-dark-only, html.light-mode .theme-dark-only { display: none; }
body.light-mode .theme-light-only, html.light-mode .theme-light-only { display: block; }

.sidebar-menu { list-style: none; flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--purple-main) transparent; }
.sidebar-menu li { margin-bottom: 0.5rem; }
.sidebar-menu::-webkit-scrollbar { width: 6px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background: var(--purple-main); border-radius: 10px; }
.sidebar-menu::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: var(--border-color);
  color: var(--purple-light);
}

.btn-logout {
  display: block;
  padding: 0.8rem;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border: 1px solid #dc2626;
  color: #fff;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(220,38,38,0.35);
  transition: all 0.3s;
}

.btn-logout:hover {
  background: linear-gradient(135deg, #ef4444, #f87171);
  box-shadow: 0 4px 16px rgba(220,38,38,0.5);
}

/* ========== کارت‌های عمومی ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

/* ========== فرم‌ها ========== */
.form-group label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.95rem;
  transition: border 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--purple-light);
}

.form-group select option { background: var(--bg-card); }

/* ========== بج‌ها ========== */
.badge { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }
.badge-purple { background: var(--purple-glow); color: var(--purple-light); }
.badge-blue { background: #1e3a5f; color: #60a5fa; }
.badge-green { background: #14532d; color: #4ade80; }

/* ========== فوتر ========== */
footer {
  text-align: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  margin-top: auto;
}
.footer-columns {
  display: flex; justify-content: center; align-items: flex-start;
  gap: 4rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--purple-light); }
.footer-social h3 {
  font-size: 0.9rem; font-weight: 700; color: var(--text-secondary);
  margin: 0 0 0.8rem;
}
.footer-social-links { display: flex; justify-content: center; gap: 0.7rem; }
.footer-social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--border-color); color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.footer-social-icon:hover { background: var(--purple-main); color: #fff; }
.footer-social-icon svg { width: 19px; height: 19px; }
.footer-enamad { display: flex; flex-direction: column; align-items: center; }
.footer-enamad h3 {
  font-size: 0.9rem; font-weight: 700; color: var(--text-secondary);
  margin: 0 0 0.8rem;
}
.footer-enamad img { width: 90px; height: auto; display: block; }
/* دکمه شب/روز توی هدر */
.theme-toggle-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  color: var(--purple-light);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-nav:hover {
  background: var(--purple-main);
  color: white;
}

/* ========== رفع کنتراست بج‌ها/دکمه‌های وضعیت در حالت روشن ==========
   این کلاس‌ها (status-active/inactive، btn-success/warning/danger/info، badge-*) توی
   ده‌ها صفحه‌ی پنل ادمین/مشاور/دانش‌آموز تکرار شدن، همیشه با رنگ‌های محو-مخصوصِ حالت
   تیره (پس‌زمینه‌ی تیره با آلفای کم + متن روشن) که روی کارتِ سفیدِ حالت روشن تقریباً
   نامرئی می‌شن. چون این سلکتورها (body.light-mode .xxx) از نسخه‌ی محلیِ تعریف‌شده‌ی
   هر صفحه (.xxx بدون قید) اختصاصی‌تر هستن، صرف‌نظر از ترتیب لود، همیشه برنده می‌شن —
   یعنی این یک بلاک، بدون دست‌زدن به تک‌تک فایل‌ها، مشکل رو همه‌جا حل می‌کنه. */
body.light-mode .btn-success,
body.light-mode .badge-active,
body.light-mode .status-active,
body.light-mode .success,
body.light-mode .ok,
body.light-mode .btn-sm-green,
body.light-mode .hbadge-green,
body.light-mode .dl,
body.light-mode .approved,
body.light-mode .completed,
body.light-mode .day-25,
body.light-mode .badge-sent,
body.light-mode .correct,
body.light-mode .saved {
  background: #dcfce7; border-color: #16a34a; color: #15803d;
}
body.light-mode .btn-warning,
body.light-mode .status-warning,
body.light-mode .pending,
body.light-mode .day-7,
body.light-mode .badge-simulated,
body.light-mode .badge-yellow {
  background: #fef3c7; border-color: #f59e0b; color: #92400e;
}
body.light-mode .btn-danger,
body.light-mode .badge-red,
body.light-mode .btn-logout,
body.light-mode .btn-logout-top,
body.light-mode .btn-delete,
body.light-mode .error,
body.light-mode .err,
body.light-mode .btn-danger-sm,
body.light-mode .btn-sm-red,
body.light-mode .hbadge-red,
body.light-mode .btn-reject,
body.light-mode .del,
body.light-mode .btn-remove-img,
body.light-mode .btn-sm-delete,
body.light-mode .rejected,
body.light-mode .new-badge,
body.light-mode .badge-failed,
body.light-mode .voice {
  background: #fee2e2; border-color: #dc2626; color: #b91c1c;
}
body.light-mode .btn-info,
body.light-mode .badge-blue {
  background: #dbeafe; border-color: #93c5fd; color: #1e40af;
}
body.light-mode .status-inactive,
body.light-mode .badge-inactive {
  background: #f1f5f9; border-color: #cbd5e1; color: #475569;
}
body.light-mode .badge-green {
  background: #dcfce7; color: #15803d;
}
body.light-mode .status-super {
  background: #ede9fe; border-color: #a78bfa; color: #6d28d9;
}
body.light-mode .btn-logout:hover {
  background: #fecaca;
}