/* ============================================================
   IDCF — استایل عمومی سایت (public pages)
   ============================================================ */

/* ── هدر ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; gap: 16px;
}

/* لوگو */
.site-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.logo-icon {
  width: 42px; height: 42px;
  background: var(--primary);
  color: #fff; font-weight: 800; font-size: .8rem;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.5px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-main { font-weight: 800; font-size: 1rem; color: var(--text); }
.logo-sub  { font-size: .62rem; color: var(--text-muted); }

/* ناوبری */
.main-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1;
}
.nav-item {
  padding: 6px 12px; border-radius: 8px;
  font-size: .875rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { color: var(--primary); font-weight: 700; }

/* جستجو */
.header-search { flex: 0 0 220px; }
.search-wrap { position: relative; }
.search-icon {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: 8px 34px 8px 12px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface2); color: var(--text);
  font-family: inherit; font-size: .85rem;
  transition: border-color .2s, box-shadow .2s;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }

/* منوی کاربر */
.header-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.theme-btn {
  width: 36px; height: 36px; border: none;
  background: var(--surface2); border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background .15s, color .15s;
}
.theme-btn:hover { background: var(--border); color: var(--text); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* آواتار کاربر */
.user-menu-wrap { position: relative; }
.user-avatar-btn {
  position: relative; border: none; background: none;
  cursor: pointer; padding: 0;
}
.avatar-img, .avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; display: block;
}
.avatar-placeholder {
  background: var(--primary-bg); color: var(--primary);
  font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.user-level-dot {
  position: absolute; bottom: 0; left: 0;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--surface);
}

/* دراپ‌داون */
.user-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 210px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s, transform .15s;
  z-index: 200;
}
.user-dropdown.open { opacity: 1; pointer-events: auto; transform: none; }
.dropdown-header { padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.dh-name { font-weight: 700; font-size: .9rem; }
.dh-level { font-size: .78rem; margin-top: 2px; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; font-size: .875rem; color: var(--text);
  text-decoration: none; transition: background .12s;
}
.dropdown-item:hover { background: var(--surface2); }
.dropdown-item--danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* دکمه‌ها */
.btn-sm { padding: 7px 16px; font-size: .82rem; }
.btn-ghost {
  background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  font-family: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--surface2); }

/* همبرگر موبایل */
.hamburger { display: none; flex-direction: column; gap: 5px; border: none; background: none; cursor: pointer; padding: 6px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; display: block; }

/* ── متن اصلی ────────────────────────────────────────────── */
.site-main { min-height: calc(100vh - 64px - 200px); }

/* ── کانتینر ─────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ── کارت IDCF Score ──────────────────────────────────────── */
.idcf-score-badge {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; flex-shrink: 0;
}
.idcf-score-badge.excellent { background: #dcfce7; color: #166534; }
.idcf-score-badge.good      { background: #dbeafe; color: #1e40af; }
.idcf-score-badge.average   { background: #fef3c7; color: #92400e; }
.idcf-score-badge.poor      { background: #fee2e2; color: #991b1b; }

/* ── ستاره‌ها ─────────────────────────────────────────────── */
.star-row { color: var(--warning); letter-spacing: 2px; font-size: 1rem; }

/* ── کارت نظر ────────────────────────────────────────────── */
.review-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 12px;
}
.review-user { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.review-avatar-placeholder {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.review-user-info { flex: 1; min-width: 0; }
.review-username { font-weight: 700; color: var(--primary); text-decoration: none; font-size: .9rem; }
.review-username:hover { text-decoration: underline; }
.review-level { font-size: .75rem; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.review-badge { font-size: .7rem; background: var(--surface); border: 1px solid var(--border); padding: 1px 7px; border-radius: 20px; }
.verified-badge { background: #dcfce7; color: #166534; font-size: .72rem; padding: 2px 8px; border-radius: 20px; }
.helpful-btn { background: none; border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: .78rem; color: var(--text-muted); cursor: pointer; transition: all .15s; font-family: inherit; }
.helpful-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── بخش امتیاز فروشگاه ──────────────────────────────────── */
.rating-overview {
  background: var(--surface2); border-radius: 16px;
  padding: 24px; display: grid;
  grid-template-columns: auto 1fr; gap: 24px; align-items: center;
}
.rating-big { text-align: center; }
.rating-big-num { font-size: 3rem; font-weight: 800; line-height: 1; color: var(--text); }
.rating-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: .8rem; }
.rating-bar-bg { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.rating-bar-fill { height: 100%; background: var(--warning); border-radius: 4px; }
.cat-rating-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.cat-rating-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.cat-rating-val { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.cat-rating-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.level-dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: .82rem; }
.level-dist-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.level-dist-fill { height: 100%; border-radius: 3px; background: var(--primary); }

/* ── فوتر ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  margin-top: 60px; padding: 48px 0 24px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-title { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .85rem; color: var(--text-muted); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; align-items: center; justify-content: space-between; }
.footer-socials { display: flex; gap: 8px; }
.social-link { font-size: 1.2rem; text-decoration: none; opacity: .7; transition: opacity .15s; }
.social-link:hover { opacity: 1; }

/* ── ریسپانسیو ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-search { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; gap: 10px; }
  .logo-sub { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .rating-overview { grid-template-columns: 1fr; }
}
