:root{
  --green:#00B353;
  --green-light:#3FE38A;
  --blue:#0C4779;
  --blue-light:#1C74C4;
  --bg:#060B12;
  --bg-2:#0A1420;
  --panel:rgba(255,255,255,0.035);
  --panel-solid:#0B1A26;
  --line:rgba(63,227,138,0.18);
  --line-blue:rgba(28,116,196,0.28);
  --text:#E7F1EC;
  --text-dim:#8CA3A8;
  --radius:18px;
  --font: 'Vazirmatn', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}
*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  overflow-x:hidden;
  position:relative;
}
::selection{ background:var(--green); color:#03130a; }

body::before{
  content:""; position:fixed; inset:0; z-index:-3;
  background:
    radial-gradient(1100px 650px at 90% -10%, rgba(0,179,83,0.14), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(12,71,121,0.35), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(0,179,83,0.08), transparent 60%),
    linear-gradient(180deg, var(--bg), #050a10 50%, var(--bg));
}
body::after{
  content:""; position:fixed; inset:0; z-index:-2; pointer-events:none; opacity:.5;
  background-image:
    linear-gradient(rgba(63,227,138,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63,227,138,0.035) 1px, transparent 1px);
  background-size:44px 44px;
  mask-image:radial-gradient(circle at 50% 0%, black, transparent 75%);
}
#netbg{ position:fixed; inset:0; z-index:-1; pointer-events:none; }

::-webkit-scrollbar{ width:9px; }
::-webkit-scrollbar-track{ background:var(--bg); }
::-webkit-scrollbar-thumb{ background:linear-gradient(var(--green),var(--blue)); border-radius:8px; }

.section{ max-width:1180px; margin:0 auto; padding:90px 24px; }
.section-head{ text-align:center; max-width:640px; margin:0 auto 44px; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px; font-size:12px; letter-spacing:.15em;
  color:var(--green-light); font-weight:600; text-transform:uppercase;
}
.eyebrow::before,.eyebrow::after{ content:""; width:22px; height:1px; background:var(--green); opacity:.7; }
.section-head h2{ font-size:clamp(24px,3.6vw,36px); margin:12px 0 10px; font-weight:800;
  background:linear-gradient(90deg,var(--green-light),var(--blue-light));
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.section-head .sub{ color:var(--text-dim); font-size:14.5px; line-height:1.9; }

/* ================ NAV ================ */
#nav{
  position:sticky; top:0; z-index:600;
  background:rgba(6,11,18,0.75); backdrop-filter:blur(16px);
  border-bottom:1px solid var(--line);
}
.nav-inner{ max-width:1180px; margin:0 auto; padding:14px 24px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{ width:34px; height:34px; border-radius:10px; background:linear-gradient(135deg,var(--green),var(--blue));
  display:flex; align-items:center; justify-content:center; gap:2px; box-shadow:0 0 20px rgba(0,179,83,0.4); }
.brand-mark span{ width:4px; height:14px; background:#fff; border-radius:2px; opacity:.9; animation:eq 1.2s ease-in-out infinite; }
.brand-mark span:nth-child(2){ animation-delay:.2s; height:20px; }
.brand-mark span:nth-child(3){ animation-delay:.4s; height:10px; }
@keyframes eq{ 0%,100%{ transform:scaleY(.5);} 50%{ transform:scaleY(1);} }
.brand-text{ font-size:13.5px; color:var(--text-dim); display:flex; flex-direction:column; line-height:1.4; }
.brand-text b{ color:var(--text); font-size:15px; font-weight:800; }
.nav-links{ display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; }
.nav-links::-webkit-scrollbar{ display:none; }
.nav-links button{
  background:transparent; border:1px solid transparent; color:var(--text-dim); font-family:var(--font);
  font-size:13px; padding:8px 14px; border-radius:999px; cursor:pointer; white-space:nowrap; transition:.25s;
}
.nav-links button:hover,.nav-links button.active{ color:var(--green-light); border-color:var(--line); background:rgba(0,179,83,0.08); }
.nav-status{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-dim); flex-shrink:0; }
.status-dot{ width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 10px var(--green); animation:blink 2s ease-in-out infinite; }
@keyframes blink{ 0%,100%{ opacity:1;} 50%{ opacity:.4;} }

/* ================ HERO ================ */
.hero{ max-width:1180px; margin:0 auto; padding:70px 24px 40px; }
.hero-inner{ display:grid; grid-template-columns:1.1fr .9fr; gap:50px; align-items:center; }
@media(max-width:940px){ .hero-inner{ grid-template-columns:1fr; } }
.tag-pill{
  display:inline-flex; align-items:center; gap:8px; font-size:12.5px; color:var(--green-light);
  border:1px solid var(--line); background:rgba(0,179,83,0.07); padding:7px 14px; border-radius:999px; margin-bottom:20px;
}
.tag-pill .dot{ width:6px; height:6px; border-radius:50%; background:var(--green); box-shadow:0 0 8px var(--green); }
.hero-text h1{ font-size:clamp(28px,4.2vw,46px); line-height:1.45; font-weight:800; margin-bottom:18px; }
.hero-text h1 span{ background:linear-gradient(90deg,var(--green-light),var(--blue-light));
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.hero-text p{ color:var(--text-dim); font-size:15px; line-height:2; max-width:540px; margin-bottom:28px; }
.hero-actions{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom:36px; }
.btn-primary{
  background:linear-gradient(90deg,var(--green),var(--blue)); color:#fff; border:none; font-family:var(--font);
  font-size:14.5px; font-weight:700; padding:14px 26px; border-radius:12px; cursor:pointer;
  box-shadow:0 14px 30px -10px rgba(0,179,83,.5); transition:.3s;
}
.btn-primary:hover{ transform:translateY(-3px); box-shadow:0 20px 36px -10px rgba(0,179,83,.65); }
.btn-primary:disabled{ opacity:.4; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-ghost{
  background:transparent; border:1px solid var(--line-blue); color:var(--text); font-family:var(--font);
  font-size:14.5px; font-weight:600; padding:14px 26px; border-radius:12px; cursor:pointer; transition:.3s;
}
.btn-ghost:hover{ border-color:var(--blue-light); background:rgba(28,116,196,0.1); }
.btn-big{ padding:16px 34px; font-size:15.5px; }

.hero-stats{ display:flex; gap:30px; flex-wrap:wrap; }
.hstat{ display:flex; flex-direction:column; }
.hstat b{ font-family:var(--mono); font-size:26px; color:var(--green-light); font-weight:700; }
.hstat span{ font-size:11.5px; color:var(--text-dim); margin-top:2px; }

.hero-visual{ position:relative; display:flex; align-items:center; justify-content:center; height:380px; }
.scan-core{ position:relative; width:230px; height:230px; display:flex; align-items:center; justify-content:center; }
.ring{ position:absolute; border-radius:50%; border:1px solid var(--line); }
.ring.r1{ width:100%; height:100%; animation:spin 14s linear infinite; border-color:rgba(0,179,83,0.35); border-style:dashed; }
.ring.r2{ width:74%; height:74%; animation:spin 10s linear infinite reverse; border-color:rgba(28,116,196,0.4); }
.ring.r3{ width:48%; height:48%; animation:pulse 2.4s ease-in-out infinite; border-color:var(--green-light); }
@keyframes spin{ to{ transform:rotate(360deg);} }
@keyframes pulse{ 0%,100%{ opacity:.5; transform:scale(1);} 50%{ opacity:1; transform:scale(1.08);} }
.core-icon{
  width:82px; height:82px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 30% 30%,#0f2a1e,#081119);
  border:1px solid var(--green-light); box-shadow:0 0 40px rgba(0,179,83,.35); z-index:2;
}
.core-icon svg{ width:38px; height:38px; stroke:var(--green-light); }
.scan-line{
  position:absolute; width:100%; height:2px; left:0; top:50%;
  background:linear-gradient(90deg,transparent,var(--green-light),transparent);
  animation:scan 2.6s ease-in-out infinite; box-shadow:0 0 12px var(--green-light);
}
@keyframes scan{ 0%{ top:8%; opacity:0;} 15%{ opacity:1;} 85%{ opacity:1;} 100%{ top:92%; opacity:0;} }
.floating-chip{
  position:absolute; font-size:11.5px; padding:8px 14px; border-radius:10px; white-space:nowrap;
  background:var(--panel-solid); border:1px solid var(--line); color:var(--text); backdrop-filter:blur(6px);
  box-shadow:0 12px 24px -10px rgba(0,0,0,.5); animation:float 4s ease-in-out infinite;
}
.chip1{ top:6%; right:-6%; animation-delay:0s; }
.chip2{ bottom:20%; left:-10%; animation-delay:1s; color:var(--green-light); font-family:var(--mono); }
.chip3{ bottom:2%; right:2%; animation-delay:2s; }
@keyframes float{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-10px);} }
@media(max-width:940px){ .floating-chip{ display:none; } }

/* ================ UPLOAD ================ */
.step-track{ position:relative; height:2px; background:rgba(255,255,255,.06); margin:0 0 42px; border-radius:2px; overflow:hidden; }
.step-track-fill{ height:100%; width:0%; background:linear-gradient(90deg,var(--green),var(--blue)); transition:width .6s ease; box-shadow:0 0 10px var(--green); }

.upload-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
@media(max-width:980px){ .upload-grid{ grid-template-columns:1fr 1fr; } }
@media(max-width:600px){ .upload-grid{ grid-template-columns:1fr; } }

.upload-card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:22px;
  backdrop-filter:blur(10px); transition:.3s; position:relative; display:flex; flex-direction:column;
}
.upload-card.done{ border-color:var(--green); box-shadow:0 16px 34px -18px rgba(0,179,83,.5); }
.uc-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.uc-icon{ font-size:22px; }
.uc-num{
  width:26px; height:26px; border-radius:50%; border:1px solid var(--line-blue); color:var(--blue-light);
  font-family:var(--mono); font-size:12px; display:flex; align-items:center; justify-content:center;
}
.upload-card h3{ font-size:15.5px; margin-bottom:4px; }
.upload-card p{ font-size:12px; color:var(--text-dim); margin-bottom:14px; line-height:1.7; min-height:34px; }

.dropzone{
  position:relative; border:1.5px dashed var(--line-blue); border-radius:14px; padding:20px 10px;
  text-align:center; cursor:pointer; transition:.25s; background:rgba(255,255,255,.015);
}
.dropzone.dragover{ border-color:var(--green); background:rgba(0,179,83,0.08); }
.dropzone .file-input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.dz-inner{ display:flex; flex-direction:column; align-items:center; gap:6px; pointer-events:none; }
.dz-inner svg{ width:26px; height:26px; stroke:var(--blue-light); }
.dz-inner span{ font-size:12.5px; color:var(--text); }
.dz-inner em{ font-size:10.5px; color:var(--text-dim); font-style:normal; }

.file-chips{ display:flex; flex-direction:column; gap:6px; margin-top:12px; }
.file-chip{
  display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:11.5px;
  background:rgba(0,179,83,0.07); border:1px solid var(--line); color:var(--text); padding:7px 10px; border-radius:8px;
}
.file-chip .fname{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-chip button{ background:none; border:none; color:var(--text-dim); cursor:pointer; font-size:13px; flex-shrink:0; }
.file-chip button:hover{ color:#ff6b6b; }

.uc-status{ margin-top:14px; font-size:11.5px; color:var(--text-dim); display:flex; align-items:center; gap:6px; }
.uc-status::before{ content:"○"; color:var(--text-dim); }
.upload-card.done .uc-status{ color:var(--green-light); }
.upload-card.done .uc-status::before{ content:"●"; color:var(--green-light); }

.start-bar{ display:flex; align-items:center; justify-content:center; flex-direction:column; gap:16px; margin-top:44px; }
.start-info{ font-size:13px; color:var(--text-dim); font-family:var(--mono); }

/* ================ PROCESSING ================ */
.process-panel{ display:grid; grid-template-columns:260px 1fr; gap:36px; align-items:center; }
@media(max-width:800px){ .process-panel{ grid-template-columns:1fr; justify-items:center; } }
.radial-progress{ position:relative; width:220px; height:220px; }
.radial-progress svg{ width:100%; height:100%; transform:rotate(-90deg); }
.rp-bg{ fill:none; stroke:rgba(255,255,255,.06); stroke-width:10; }
.rp-fg{ fill:none; stroke:url(#none); stroke:var(--green-light); stroke-width:10; stroke-linecap:round;
  stroke-dasharray:553; stroke-dashoffset:553; transition:stroke-dashoffset .3s linear;
  filter:drop-shadow(0 0 8px rgba(63,227,138,.6)); }
.rp-center{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; gap:2px; font-family:var(--mono); }
.rp-center span{ font-size:42px; color:var(--green-light); font-weight:700; }
.rp-center small{ font-size:16px; color:var(--text-dim); margin-top:12px; }

.console{
  background:#04080D; border:1px solid var(--line-blue); border-radius:14px; overflow:hidden; width:100%;
  box-shadow:0 20px 50px -20px rgba(0,0,0,.6);
}
.console-head{
  background:#081018; padding:10px 14px; display:flex; align-items:center; gap:7px; font-size:11px; color:var(--text-dim);
  font-family:var(--mono); border-bottom:1px solid var(--line-blue);
}
.console-head span{ width:9px; height:9px; border-radius:50%; background:#3a4550; }
.console-head span:nth-child(1){ background:#ff5f57; }
.console-head span:nth-child(2){ background:#febc2e; }
.console-head span:nth-child(3){ background:#28c840; }
.console-body{ padding:16px; font-family:var(--mono); font-size:12.5px; line-height:2; min-height:220px; max-height:260px; overflow-y:auto; }
.console-line{ color:var(--text-dim); display:flex; gap:8px; opacity:0; animation:cline .4s ease forwards; }
.console-line .t{ color:var(--green-light); flex-shrink:0; }
.console-line.ok .t{ color:var(--green-light); }
@keyframes cline{ from{ opacity:0; transform:translateY(4px);} to{ opacity:1; transform:translateY(0);} }

/* ================ RESULTS ================ */
.summary-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:36px; }
@media(max-width:700px){ .summary-grid{ grid-template-columns:1fr 1fr; } }
.sum-card{
  background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:22px; text-align:center;
  backdrop-filter:blur(10px); transition:.3s;
}
.sum-card:hover{ transform:translateY(-4px); border-color:var(--green); }
.sum-num{ font-family:var(--mono); font-size:30px; color:var(--green-light); font-weight:700; }
.sum-label{ font-size:12px; color:var(--text-dim); margin-top:6px; }

.chart-card{
  background:var(--panel); border:1px solid var(--line-blue); border-radius:18px; padding:26px; margin-bottom:36px;
  backdrop-filter:blur(10px);
}
.chart-card h3{ font-size:15px; margin-bottom:18px; color:var(--text); }

.results-toolbar{ display:flex; gap:14px; flex-wrap:wrap; align-items:center; justify-content:space-between; margin-bottom:24px; }
#searchInput{
  flex:1; min-width:220px; background:var(--panel); border:1px solid var(--line-blue); color:var(--text);
  padding:12px 16px; border-radius:12px; font-family:var(--font); font-size:13.5px; outline:none;
}
#searchInput:focus{ border-color:var(--green); }
.sort-group{ display:flex; gap:6px; }
.sort-btn{
  background:transparent; border:1px solid var(--line-blue); color:var(--text-dim); padding:9px 14px; border-radius:10px;
  font-family:var(--font); font-size:12.5px; cursor:pointer; transition:.25s;
}
.sort-btn.active,.sort-btn:hover{ color:var(--green-light); border-color:var(--green); background:rgba(0,179,83,.08); }

.student-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
@media(max-width:900px){ .student-grid{ grid-template-columns:1fr 1fr; } }
@media(max-width:600px){ .student-grid{ grid-template-columns:1fr; } }

.student-card{
  background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:20px; cursor:pointer;
  backdrop-filter:blur(10px); transition:.3s; opacity:0; transform:translateY(20px);
}
.student-card:hover{ transform:translateY(-5px); border-color:var(--green); box-shadow:0 18px 34px -18px rgba(0,179,83,.4); }
.sc-top{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.sc-avatar{
  width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--green),var(--blue)); font-weight:700; color:#fff; font-size:15px; flex-shrink:0;
}
.sc-name{ font-size:14.5px; font-weight:700; }
.sc-class{ font-size:11.5px; color:var(--text-dim); }
.sc-bar-wrap{ height:6px; background:rgba(255,255,255,.06); border-radius:4px; overflow:hidden; margin-bottom:10px; }
.sc-bar{ height:100%; background:linear-gradient(90deg,var(--green),var(--green-light)); border-radius:4px; }
.sc-bottom{ display:flex; justify-content:space-between; align-items:center; font-size:12px; color:var(--text-dim); }
.sc-score{ font-family:var(--mono); color:var(--green-light); font-weight:700; font-size:16px; }
.sc-rank{ font-family:var(--mono); }

/* ================ MODAL ================ */
.modal-overlay{
  position:fixed; inset:0; z-index:1000; background:rgba(3,7,11,0.82); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; padding:20px;
  opacity:0; visibility:hidden; transition:.3s;
}
.modal-overlay.open{ opacity:1; visibility:visible; }
.modal-card{
  background:var(--panel-solid); border:1px solid var(--line); border-radius:22px; max-width:640px; width:100%;
  max-height:88vh; overflow-y:auto; padding:34px; position:relative; transform:scale(.92); transition:.3s;
  box-shadow:0 40px 90px -30px rgba(0,0,0,.8);
}
.modal-overlay.open .modal-card{ transform:scale(1); }
.modal-close{
  position:absolute; top:18px; left:18px; background:rgba(255,255,255,.06); border:1px solid var(--line);
  color:var(--text); width:34px; height:34px; border-radius:50%; cursor:pointer; font-size:14px;
}
.modal-close:hover{ background:rgba(255,80,80,.15); border-color:rgba(255,80,80,.4); }

.mh-top{ display:flex; align-items:center; gap:16px; margin-bottom:22px; }
.mh-avatar{
  width:64px; height:64px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--green),var(--blue)); font-weight:700; color:#fff; font-size:22px; flex-shrink:0;
}
.mh-name{ font-size:19px; font-weight:800; }
.mh-meta{ font-size:12.5px; color:var(--text-dim); margin-top:3px; }
.mh-score-badge{
  margin-right:auto; text-align:center; font-family:var(--mono); background:rgba(0,179,83,.1);
  border:1px solid var(--green); border-radius:14px; padding:10px 16px;
}
.mh-score-badge b{ display:block; font-size:22px; color:var(--green-light); }
.mh-score-badge small{ font-size:10px; color:var(--text-dim); }

.modal-content canvas{ max-height:220px; margin:18px 0; }
.ai-feedback{
  background:rgba(28,116,196,.08); border:1px solid var(--line-blue); border-radius:14px; padding:16px 18px;
  font-size:13px; line-height:2; color:var(--text); margin-top:16px; position:relative;
}
.ai-feedback::before{ content:"🤖 تحلیل هوش مصنوعی"; display:block; font-size:11.5px; color:var(--blue-light); margin-bottom:8px; font-weight:700; }
.subject-rows{ display:flex; flex-direction:column; gap:10px; margin-top:14px; }
.subject-row{ display:flex; align-items:center; gap:12px; }
.subject-row .sname{ font-size:12.5px; width:90px; flex-shrink:0; color:var(--text-dim); }
.subject-row .sbar{ flex:1; height:8px; background:rgba(255,255,255,.06); border-radius:4px; overflow:hidden; }
.subject-row .sbar span{ display:block; height:100%; border-radius:4px; background:linear-gradient(90deg,var(--blue),var(--green)); }
.subject-row .sval{ font-family:var(--mono); font-size:12px; color:var(--green-light); width:36px; text-align:left; }
.modal-actions{ display:flex; gap:10px; margin-top:22px; }
.modal-actions button{ flex:1; }

/* ================ FOOTER ================ */
.footer{ text-align:center; padding:40px 20px; color:var(--text-dim); font-size:12.5px; border-top:1px solid var(--line); }

/* ================ PRINT ================ */
@media print{
  @page{ size:A4; margin:14mm; }
  #nav,#netbg,.hero,.section:not(#results),footer,.results-toolbar,#distChart,.summary-grid,.chart-card,.student-grid,.modal-close{ display:none !important; }
  body{ background:#fff !important; color:#111 !important; }
  body::before,body::after{ display:none !important; }
  .modal-overlay{ position:static !important; background:#fff !important; opacity:1 !important; visibility:visible !important; backdrop-filter:none !important; }
  .modal-card{ box-shadow:none !important; border:1px solid #0C4779 !important; max-height:none !important; transform:none !important; }
  .mh-name,.sum-num{ color:#0C4779 !important; }
}
