/* =========================================================
   AnsariMath V6 - Visual layout based on the approved reference
========================================================= */

:root{
  --blue:#075be0;
  --blue2:#143ca0;
  --cyan:#15b9ec;
  --yellow:#ffc62e;
  --ink:#0f2b55;
  --muted:#6d7f9a;
  --bg:#f4f8ff;
  --white:#fff;
  --line:#dce7f7;
  --shadow:0 14px 38px rgba(14,59,119,.10);
  --radius:24px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Tahoma,"Segoe UI",Arial,sans-serif;
  line-height:1.8;
}
button,input{font:inherit}
button{cursor:pointer}
a{text-decoration:none;color:inherit}

.container{
  width:min(1450px,calc(100% - 42px));
  margin-inline:auto;
}

.topline{
  min-height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#062d78;
  color:#dfeaff;
  font-size:10px;
}

/* Header */
.header{
  position:sticky;
  top:0;
  z-index:100;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(18px);
  border-bottom:1px solid #e7eef8;
}
.header-inner{
  min-height:76px;
  display:flex;
  align-items:center;
  gap:16px;
}

/* NEW: real AnsariMath logo */
.brand{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-width:205px;
  height:64px;
  flex:0 0 auto;
}
.brand-logo{
  display:block;
  width:auto;
  height:58px;
  max-width:205px;
  object-fit:contain;
  object-position:center;
}

.nav{
  display:flex;
  align-items:center;
  gap:4px;
  flex:1;
  justify-content:center;
}
.nav a{
  padding:9px 12px;
  border-radius:12px;
  font-size:12px;
  font-weight:900;
  color:#2f4a72;
}
.nav a:hover,
.nav a.active{
  color:var(--blue);
  background:#edf4ff;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:9px;
}
.search{
  width:240px;
  height:44px;
  border-radius:14px;
  background:#edf3ff;
  border:1px solid #dfebfb;
  display:flex;
  align-items:center;
  padding:0 11px;
  gap:7px;
}
.search span{font-size:23px;color:var(--blue)}
.search input{
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  color:var(--ink);
  font-size:10px;
}
.login-btn{
  border:0;
  background:var(--blue);
  color:#fff;
  padding:11px 14px;
  border-radius:14px;
  font-size:10px;
  font-weight:900;
  box-shadow:0 9px 20px rgba(21,94,239,.2);
}

/* Hero */
.hero{
  position:relative;
  width:100%;
  background:#0c54d8;
  overflow:hidden;
}
.hero-art{
  width:100%;
  aspect-ratio:1536/398;
  background-image:url("/assets/hero-reference.jpg");
  background-size:cover;
  background-position:center;
}
.hero-hotspot{
  position:absolute;
  left:51%;
  top:63%;
  transform:translate(-50%,-50%);
}
.hero-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:150px;
  padding:11px 22px;
  border-radius:999px;
  background:var(--yellow);
  color:#1f3357;
  font-size:14px;
  font-weight:1000;
  box-shadow:0 10px 24px rgba(255,196,37,.28);
  border:1px solid rgba(255,255,255,.4);
}

/* Section headings */
.section-title span,
.box-heading span{
  color:#0f5fda;
  font-size:12px;
  font-weight:1000;
}
.section-title h2,
.box-heading h2{
  margin:1px 0 3px;
  font-size:29px;
  line-height:1.35;
}
.section-title p{
  margin:0;
  font-size:11px;
  color:var(--muted);
}
.centered{text-align:center}

/* Grades */
.grades-shell{
  background:#fff;
  padding:28px 0 34px;
}
.grades-shell .section-title{margin-bottom:22px}
.grade-grid{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:11px;
}
.grade-card{
  border:1px solid var(--line);
  background:#fff;
  border-radius:18px;
  min-height:115px;
  padding:11px 9px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  box-shadow:0 8px 24px rgba(19,67,126,.05);
  transition:.2s;
  position:relative;
  overflow:hidden;
}
.grade-card:before{
  content:"";
  position:absolute;
  inset:0 auto auto 0;
  height:4px;
  width:100%;
  background:#2b73eb;
}
.grade-card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.grade-icon{
  width:47px;height:47px;border-radius:15px;
  display:grid;place-items:center;
  background:#edf4ff;
  font-size:22px;
  margin-bottom:7px;
}
.grade-card:nth-child(3n) .grade-icon{background:#f0eaff}
.grade-card:nth-child(2n) .grade-icon{background:#fff4cf}
.grade-card:nth-child(5n) .grade-icon{background:#e5f9ef}
.grade-card b{font-size:12px}
.grade-card small{font-size:8px;color:var(--muted)}

/* Stats + popular */
.stats-and-popular{padding:18px 0}
.split-row{
  display:grid;
  grid-template-columns:1.1fr 1.5fr;
  gap:16px;
}
.stats-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:11px;
}
.stat{
  border-radius:20px;
  min-height:104px;
  padding:16px 18px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  box-shadow:var(--shadow);
}
.stat b{font-size:23px}
.stat span{font-size:10px}
.stat.pink{background:#ffd7e5}
.stat.purple{background:#eadfff}
.stat.green{background:#d8f6e7}
.stat.yellow{background:#fff0ae}

.popular-box,
.latest-card,
.about-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:23px;
  padding:17px;
  box-shadow:var(--shadow);
}
.box-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.box-heading a{
  font-size:10px;
  color:var(--blue);
  font-weight:900;
}

.subject-mini-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:11px;
}
.subject-mini{
  min-height:150px;
  border:1px solid #e6edf8;
  border-radius:19px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
  transition:.2s;
}
.subject-mini:hover{transform:translateY(-3px)}
.subject-mini .subject-emoji{
  width:65px;height:65px;
  border-radius:18px;
  display:grid;place-items:center;
  font-size:31px;
  background:#fff4cf;
}
.subject-mini.persian .subject-emoji{background:#ffe0ea}
.subject-mini.science .subject-emoji{background:#daf7e9}
.subject-mini b{font-size:14px}
.subject-mini small{
  padding:3px 11px;
  border-radius:999px;
  background:#fff0bd;
  color:#855e00;
  font-size:9px;
  font-weight:900;
}
.subject-mini.persian small{background:#ffe1ec;color:#b82d5e}
.subject-mini.science small{background:#ddf7e9;color:#16845b}

/* Quick */
.content-section{
  padding:28px 0;
}
.quick-grid{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:12px;
  margin-top:17px;
}
.quick-card{
  min-height:112px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:19px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  box-shadow:0 9px 28px rgba(19,67,126,.05);
}
.quick-card:hover{transform:translateY(-3px)}
.quick-card span{font-size:28px}
.quick-card b{font-size:12px}
.quick-card small{font-size:8px;color:var(--muted)}

/* Latest */
.latest-area{
  padding:0 0 36px;
}
.latest-grid{
  display:grid;
  grid-template-columns:1.1fr 1.4fr 1.1fr;
  gap:15px;
}
.latest-list{
  display:grid;
  gap:8px;
}
.latest-list button{
  border:1px solid #ebf0f7;
  background:#fbfcff;
  border-radius:14px;
  padding:9px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:9px;
  text-align:right;
}
.latest-list b{font-size:10px}
.latest-list small{font-size:8px;color:var(--muted)}
.badge{
  width:34px;height:34px;
  border-radius:10px;
  display:grid;place-items:center;
  font-size:9px;font-weight:1000;
  color:#fff;
}
.badge.pdf{background:#ef3c4f}
.badge.video{background:#166be9}
.badge.word{background:#1b69d8}

.motivation-card{
  border-radius:24px;
  padding:19px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#fff;
  background:linear-gradient(135deg,#0b43a9,#0b76ed 65%,#159fd2);
  box-shadow:0 16px 38px rgba(13,73,165,.18);
}
.motivation-card span{font-size:45px}
.motivation-card small{color:#f5fbff;font-size:10px}
.motivation-card h2{
  margin:0;
  font-size:31px;
  color:#ffd43b;
}
.motivation-card p{margin:1px 0 0;color:#dbeaff;font-size:10px}
.motivation-card > b{font-size:28px;color:#ffd43b}

.about-card span{font-size:12px;color:#0e5ed9;font-weight:1000}
.about-card h2{
  margin:4px 0;
  font-size:21px;
}
.about-card p{font-size:10px;color:var(--muted)}
.about-card button{
  border:0;background:#0d62df;color:#fff;
  border-radius:12px;padding:9px 13px;
  font-size:10px;font-weight:900;
}

/* Dynamic */
.dynamic-panel{
  padding:30px 0 45px;
  background:#fff;
}
.panel-close{
  border:0;
  background:#edf3ff;
  color:#0f5ed8;
  border-radius:11px;
  padding:7px 12px;
  font-size:10px;
  font-weight:900;
  margin-bottom:12px;
}
.dynamic-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:13px;
}
.dynamic-item{
  border:1px solid var(--line);
  background:#fff;
  border-radius:18px;
  padding:15px;
  box-shadow:0 7px 22px rgba(19,67,126,.05);
}
.dynamic-item b{display:block;font-size:12px}
.dynamic-item small{font-size:8px;color:var(--muted)}
.dynamic-item audio,
.dynamic-item video{width:100%;margin-top:10px}
.dynamic-item iframe{width:100%;height:300px;border:0;border-radius:12px;margin-top:10px}

/* Footer */
.footer{
  color:#c8d9f4;
  background:#07295f;
  margin-top:24px;
}
.footer-top{
  display:grid;
  grid-template-columns:1.8fr 1fr 1fr 1.4fr;
  gap:28px;
  padding:34px 0;
}
.footer-brand{
  font-size:26px;
  font-weight:1000;
  color:#fff;
}
.footer-brand span{color:#ffc72c}
.footer h4{color:#fff;margin:0 0 8px;font-size:12px}
.footer a,.footer p{display:block;margin:5px 0;font-size:9px;color:#adc1df}
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.1);
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:9px;
  color:#92aacc;
}
.hidden{display:none !important}

/* Responsive */
@media (max-width:1200px){
  .nav a{padding-inline:8px;font-size:10px}
  .search{width:180px}
  .grade-grid{grid-template-columns:repeat(4,1fr)}
  .quick-grid{grid-template-columns:repeat(3,1fr)}
  .latest-grid{grid-template-columns:1fr}
}
@media (max-width:900px){
  .header-inner{flex-wrap:wrap;padding:9px 0}
  .brand{min-width:auto;height:56px}
  .brand-logo{
    height:52px;
    max-width:185px;
  }
  .nav{
    order:3;
    width:100%;
    overflow:auto;
    justify-content:flex-start;
  }
  .header-actions{margin-right:auto}
  .split-row{grid-template-columns:1fr}
  .quick-grid{grid-template-columns:repeat(2,1fr)}
  .latest-grid{grid-template-columns:1fr}
  .footer-top{grid-template-columns:1fr 1fr}
}
@media (max-width:600px){
  .container{width:calc(100% - 18px)}
  .brand-logo{
    height:48px;
    max-width:170px;
  }
  .header-actions{width:100%}
  .search{flex:1;width:auto}
  .login-btn{white-space:nowrap}
  .grade-grid{grid-template-columns:repeat(3,1fr);gap:7px}
  .grade-card{min-height:100px;padding:7px 4px}
  .grade-icon{width:39px;height:39px;font-size:18px}
  .subject-mini-grid{grid-template-columns:1fr 1fr}
  .subject-mini.science{grid-column:span 2}
  .quick-grid{grid-template-columns:1fr 1fr}
  .section-title h2,.box-heading h2{font-size:23px}
  .motivation-card h2{font-size:25px}
  .footer-top{grid-template-columns:1fr}
  .hero-hotspot{top:67%}
  .hero-cta{min-width:120px;padding:8px 15px;font-size:11px}
}

/* =========================================================
   اهداف یادگیری
========================================================= */

.panel-objectives {
    margin-top: 20px;
    margin-bottom: 22px;
    padding: 18px 20px;
    background:
        linear-gradient(
            135deg,
            #eef5ff,
            #ffffff
        );
    border:
        1px solid #dce8fb;
    border-radius: 20px;
    box-shadow:
        0 10px 28px
        rgba(21, 94, 239, .06);
}

.panel-objectives h3 {
    margin: 0 0 10px;
    color: #155eef;
    font-size: 15px;
}

.panel-objectives ul {
    margin: 0;
    padding-right: 22px;
}

.panel-objectives li {
    margin: 5px 0;
    color: #40536f;
    font-size: 11px;
}

/* =========================================================
   تاریخ شمسی و میلادی
========================================================= */

.site-date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 155px;
  padding: 5px 12px;
  margin-inline: 6px;
  border-radius: 12px;
  background: #f4f8ff;
  border: 1px solid #dce9ff;
  line-height: 1.5;
  white-space: nowrap;
}

.site-date-shamsi {
  font-size: 12px;
  font-weight: 800;
  color: #164fc5;
}

.site-date-miladi {
  font-size: 9px;
  color: #71809a;
  direction: ltr;
}

/* موبایل */
@media (max-width: 900px) {
  .site-date {
    min-width: 140px;
    padding: 4px 9px;
    margin-inline: 3px;
  }

  .site-date-shamsi {
    font-size: 11px;
  }

  .site-date-miladi {
    font-size: 8px;
  }
}

@media (max-width: 600px) {
  .site-date {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    padding: 4px 8px;
  }

  .site-date-shamsi {
    font-size: 10px;
  }

  .site-date-miladi {
    font-size: 7px;
  }
}
