/* ============================================================
   بدنساز هوشمند — Round 3 Styling Upgrade
   Blog, favorites, notifications, calendar view, polish
   ============================================================ */

/* ============================================================
   BLOG / ARTICLES
   ============================================================ */
.blog-hero {
  padding: 50px 0 40px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212,168,67,.08), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.blog-hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 900; margin-bottom: 14px; }
.blog-hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.blog-hero p { color: var(--text-2); font-size: 16px; max-width: 600px; margin: 0 auto; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding: 40px 0;
}
.article-card {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .3s;
  display: flex; flex-direction: column; position: relative;
}
.article-card:hover { transform: translateY(-5px); border-color: rgba(212,168,67,.3); box-shadow: var(--shadow); }
.article-cover {
  height: 160px; display: flex; align-items: center; justify-content: center;
  font-size: 64px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--surf2), var(--surf3));
}
.article-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(212,168,67,.12), transparent 60%);
}
.article-cover span { position: relative; z-index: 1; filter: drop-shadow(0 4px 12px rgba(0,0,0,.3)); }
.article-cat {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: rgba(9,9,15,.7); backdrop-filter: blur(8px);
  color: var(--gold); font-size: 11px; font-weight: 700; padding: 4px 11px;
  border-radius: 6px; border: 1px solid rgba(212,168,67,.3); letter-spacing: .03em;
}
.article-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.article-body h3 { font-size: 17px; font-weight: 800; line-height: 1.5; margin-bottom: 10px; transition: color .2s; }
.article-card:hover .article-body h3 { color: var(--gold); }
.article-excerpt { color: var(--text-2); font-size: 13.5px; line-height: 1.8; flex: 1; margin-bottom: 16px; }
.article-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--border); }
.article-meta .views { display: flex; align-items: center; gap: 4px; }

.article-detail { max-width: 760px; margin: 0 auto; padding: 40px 20px 60px; }
.article-detail .ad-cover {
  height: 220px; border-radius: var(--r); display: flex; align-items: center; justify-content: center;
  font-size: 88px; margin-bottom: 28px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--surf2), var(--surf3));
}
.article-detail h1 { font-size: clamp(24px, 4.5vw, 36px); font-weight: 900; line-height: 1.3; margin-bottom: 14px; }
.article-detail .ad-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-detail .ad-body { font-size: 16px; line-height: 2; color: var(--text-2); }
.article-detail .ad-body h2 { font-size: 22px; font-weight: 800; color: var(--text); margin: 28px 0 14px; }
.article-detail .ad-body h3 { font-size: 18px; font-weight: 700; color: var(--gold); margin: 22px 0 10px; }
.article-detail .ad-body p { margin-bottom: 16px; }
.article-detail .ad-body ul { padding-right: 24px; margin-bottom: 16px; }
.article-detail .ad-body li { line-height: 2; }
.article-detail .ad-body strong { color: var(--text); font-weight: 700; }
.article-detail .ad-body blockquote {
  border-right: 3px solid var(--gold); padding: 12px 18px; margin: 18px 0;
  background: var(--gold-dim); border-radius: 0 9px 9px 0; font-style: italic; color: var(--text);
}

.blog-filter {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px;
}
.blog-filter a, .blog-filter button {
  padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--surf2); border: 1px solid var(--border); color: var(--text-2);
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.blog-filter a:hover, .blog-filter button:hover { border-color: var(--gold); color: var(--gold); }
.blog-filter a.active, .blog-filter button.active { background: var(--gold); color: #1a1208; border-color: var(--gold); }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notif-bell { position: relative; }
.notif-bell .bell-count {
  position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px;
  background: var(--danger); color: #fff; border-radius: 9px;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--bg);
  animation: pulseGold 2s infinite;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; width: 340px; max-width: 90vw;
  background: var(--surf1); border: 1px solid var(--border2); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 8px; z-index: 1100; max-height: 440px; overflow-y: auto;
  display: none;
}
.notif-dropdown.open { display: block; animation: fadeIn .2s; }
.notif-item {
  display: flex; gap: 12px; padding: 12px; border-radius: 10px; transition: background .15s;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surf2); }
.notif-item.unread { background: var(--gold-dim); }
.notif-item .ni-ic {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--surf3); display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.notif-item.unread .ni-ic { background: rgba(212,168,67,.2); }
.notif-item .ni-tx { flex: 1; min-width: 0; }
.notif-item .ni-t { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.notif-item .ni-b { font-size: 12px; color: var(--muted); line-height: 1.6; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-item .ni-d { font-size: 11px; color: var(--dim); margin-top: 4px; }
.notif-empty { text-align: center; padding: 30px 16px; color: var(--muted); font-size: 13px; }
.notif-empty .ic { font-size: 32px; margin-bottom: 8px; opacity: .5; }
.notif-foot { padding: 10px 12px; border-top: 1px solid var(--border); text-align: center; }
.notif-foot a { font-size: 12px; color: var(--gold); font-weight: 600; }

/* notification toast variants */
.toast.streak { border-right-color: var(--push); }
.toast.reward { border-right-color: var(--core); }

/* ============================================================
   EXERCISE FAVORITES
   ============================================================ */
.fav-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--border2); color: var(--muted);
  padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.fav-btn:hover { border-color: var(--gold); color: var(--gold); }
.fav-btn.active { background: rgba(224,92,74,.13); border-color: var(--push); color: var(--push); }
.fav-btn.active .ic { animation: pulseGold 1.5s infinite; }

.fav-card {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; transition: var(--transition); position: relative;
}
.fav-card:hover { border-color: rgba(212,168,67,.3); transform: translateY(-2px); }
.fav-card h4 { font-size: 15px; font-weight: 800; margin-bottom: 4px; color: var(--gold); }
.fav-card .en { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-family: monospace; }
.fav-card .note { font-size: 13px; color: var(--text-2); margin-bottom: 14px; font-style: italic; }
.fav-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   WEEKLY CALENDAR VIEW (program)
   ============================================================ */
.cal-wrap {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  margin-bottom: 24px;
}
@media (max-width: 760px) {
  .cal-wrap { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .cal-wrap { grid-template-columns: 1fr; }
}
.cal-day {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; min-height: 120px; display: flex; flex-direction: column; gap: 8px;
  transition: var(--transition); cursor: pointer; position: relative; overflow: hidden;
}
.cal-day:hover { border-color: var(--gold); transform: translateY(-2px); }
.cal-day.today { border-color: var(--gold); background: var(--gold-dim); }
.cal-day.rest { opacity: .6; }
.cal-day.done::after {
  content: '✓'; position: absolute; top: 8px; left: 8px;
  width: 22px; height: 22px; background: var(--success); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
}
.cal-day .cd-name { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.cal-day .cd-type {
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 5px;
  align-self: flex-start; white-space: nowrap;
}
.cal-day .cd-label { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-day .cd-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }
.cal-day .cd-dot { width: 8px; height: 8px; border-radius: 50%; position: absolute; top: 14px; right: 14px; }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.cal-legend .li { display: flex; align-items: center; gap: 6px; }
.cal-legend .sw { width: 12px; height: 12px; border-radius: 3px; }

/* ============================================================
   VIEW TOGGLE (tabs vs calendar)
   ============================================================ */
.view-toggle {
  display: inline-flex; background: var(--surf2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; gap: 2px;
}
.view-toggle button {
  padding: 8px 16px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  background: none; border: none; color: var(--muted); cursor: pointer;
  transition: var(--transition); font-family: inherit; display: flex; align-items: center; gap: 6px;
}
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: var(--gold); color: #1a1208; }

/* ============================================================
   IMPROVED EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center; padding: 60px 20px;
}
.empty-state .es-illust {
  width: 140px; height: 140px; margin: 0 auto 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 56px; position: relative;
  background: radial-gradient(circle, var(--gold-dim) 0%, transparent 70%);
}
.empty-state .es-illust::before {
  content: ''; position: absolute; inset: -10px; border: 2px dashed var(--border2);
  border-radius: 50%; animation: spin 20s linear infinite;
}
.empty-state h3 { font-size: 19px; font-weight: 800; margin-bottom: 10px; }
.empty-state p { color: var(--text-2); font-size: 14px; max-width: 400px; margin: 0 auto 22px; line-height: 1.8; }

/* ============================================================
   STICKY TABLE HEADERS
   ============================================================ */
.tbl-sticky thead th {
  position: sticky; top: 0; z-index: 10; background: var(--surf3);
}
.tbl-wrap.tbl-sticky-wrap { max-height: 440px; overflow-y: auto; }

/* ============================================================
   LOADING SKELETON (actual usage)
   ============================================================ */
.skeleton-card {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r);
  padding: 0; overflow: hidden;
}
.skeleton-card .sk-cover { height: 160px; }
.skeleton-card .sk-body { padding: 22px; }
.skeleton-line { height: 12px; border-radius: 6px; margin-bottom: 10px; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-100 { width: 100%; }

/* ============================================================
   BADGE: live status indicator
   ============================================================ */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  background: var(--surf3); color: var(--text-2); border: 1px solid var(--border);
}
.status-pill .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: pulseGold 1.5s infinite;
}
.status-pill.online { color: var(--success); border-color: rgba(62,188,120,.3); background: rgba(62,188,120,.1); }
.status-pill.offline { color: var(--muted); }
.status-pill.warning { color: var(--warn); border-color: rgba(224,148,74,.3); background: rgba(224,148,74,.1); }

/* ============================================================
   IMPROVED FORM FOCUS
   ============================================================ */
.form-control:focus { transform: translateY(-1px); }
.form-group:focus-within .form-label { color: var(--gold); transition: color .2s; }

/* ============================================================
   ARTICLE PAGINATION (reusing .pagination)
   ============================================================ */

/* ============================================================
   ADMIN ARTICLE EDITOR
   ============================================================ */
.editor-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap; padding: 8px;
  background: var(--surf3); border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0;
}
.editor-toolbar button {
  background: var(--surf2); border: 1px solid var(--border); color: var(--text-2);
  padding: 5px 11px; border-radius: 6px; font-size: 12px; cursor: pointer;
  font-family: inherit; transition: var(--transition); min-width: 32px;
}
.editor-toolbar button:hover { background: var(--gold-dim); color: var(--gold); border-color: var(--gold); }
.editor-toolbar .sep { width: 1px; background: var(--border); margin: 2px 4px; }
.editor-textarea {
  border-radius: 0 0 10px 10px; border-top: none;
  font-family: 'Vazirmatn', monospace; min-height: 320px; line-height: 1.8;
}
.editor-preview {
  background: var(--surf2); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; min-height: 320px; font-size: 14px; line-height: 1.9; color: var(--text-2);
}
.editor-preview h2 { color: var(--gold); font-size: 18px; margin: 16px 0 8px; }
.editor-preview h3 { color: var(--text); font-size: 15px; margin: 12px 0 6px; }
.editor-preview ul { padding-right: 20px; }
.editor-preview strong { color: var(--text); }

/* ============================================================
   SHARE BUTTONS
   ============================================================ */
.share-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.share-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surf2); border: 1px solid var(--border); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: var(--transition); font-size: 16px;
}
.share-btn:hover { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.share-btn svg { width: 18px; height: 18px; }

/* ============================================================
   READING PROGRESS BAR (article detail)
   ============================================================ */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold2));
  z-index: 9999; transition: width .1s; width: 0;
}

/* ============================================================
   IMPROVED FEATURE CARD (round 3 polish)
   ============================================================ */
.feature-card .feature-num {
  position: absolute; top: 18px; left: 18px;
  font-size: 56px; font-weight: 900; color: var(--surf3); line-height: 1;
  z-index: 0; transition: color .3s;
}
.feature-card:hover .feature-num { color: var(--gold-dim); }

/* ============================================================
   RELATED ARTICLES
   ============================================================ */
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--border);
}
.related-card {
  background: var(--surf2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; transition: var(--transition); display: flex; gap: 12px; align-items: center;
}
.related-card:hover { border-color: var(--gold); transform: translateX(-3px); }
.related-card .rc-ic { font-size: 28px; flex-shrink: 0; }
.related-card .rc-tx h5 { font-size: 13px; font-weight: 700; line-height: 1.5; margin-bottom: 4px; }
.related-card .rc-tx .rc-meta { font-size: 11px; color: var(--muted); }
