/* ============================================================
   بدنساز هوشمند — Round 11 Styling Upgrade
   Admin moderation, activity calendar, quick-log, polish
   ============================================================ */

/* ============================================================
   ADMIN COMMENTS MODERATION
   ============================================================ */
.mod-filter-bar {
  display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; align-items: center;
}
.mod-filter-bar .filter-pill {
  padding: 8px 16px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  background: var(--surf2); border: 1px solid var(--border); color: var(--text-2);
  cursor: pointer; transition: var(--transition); font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.mod-filter-bar .filter-pill:hover { border-color: var(--gold); color: var(--gold); }
.mod-filter-bar .filter-pill.active { background: var(--gold); color: #1a1208; border-color: var(--gold); }
.mod-filter-bar .filter-pill .count {
  background: rgba(0,0,0,.15); padding: 1px 7px; border-radius: 8px; font-size: 11px;
}
.mod-filter-bar .filter-pill.active .count { background: rgba(0,0,0,.2); }

.mod-comment-card {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; margin-bottom: 12px; transition: var(--transition);
}
.mod-comment-card.pending { border-color: rgba(224,148,74,.3); background: rgba(224,148,74,.03); }
.mod-comment-card.rejected { border-color: rgba(224,92,74,.2); opacity: .6; }

.mod-comment-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.mod-comment-head .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--core));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #1a1208; font-size: 14px;
}
.mod-comment-head .info { flex: 1; min-width: 0; }
.mod-comment-head .author { font-size: 13px; font-weight: 700; }
.mod-comment-head .meta { font-size: 11px; color: var(--muted); }
.mod-comment-head .status-badge {
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .04em;
}
.mod-comment-head .status-badge.approved { background: rgba(62,188,120,.13); color: var(--success); }
.mod-comment-head .status-badge.pending { background: rgba(224,148,74,.13); color: var(--warn); }
.mod-comment-head .status-badge.rejected { background: rgba(224,92,74,.13); color: var(--push); }

.mod-comment-article {
  font-size: 11px; color: var(--muted); margin-bottom: 8px;
}
.mod-comment-article a { color: var(--gold); }

.mod-comment-body {
  font-size: 14px; line-height: 1.8; color: var(--text-2); padding: 10px 14px;
  background: var(--surf2); border-radius: 9px; margin-bottom: 12px;
  border-right: 3px solid var(--border2);
}

.mod-comment-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   ACTIVITY CALENDAR
   ============================================================ */
.act-cal-wrap {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r);
  padding: 24px; margin-bottom: 22px;
}
.act-cal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.act-cal-header h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.act-cal-nav { display: flex; gap: 8px; align-items: center; }
.act-cal-nav button {
  background: var(--surf2); border: 1px solid var(--border2); color: var(--text-2);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 16px;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.act-cal-nav button:hover { border-color: var(--gold); color: var(--gold); }
.act-cal-nav .month-label { font-size: 15px; font-weight: 800; min-width: 140px; text-align: center; }

.act-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.act-cal-dow {
  text-align: center; font-size: 11px; font-weight: 800; color: var(--muted);
  padding: 8px 4px; text-transform: uppercase; letter-spacing: .04em;
}
.act-cal-day {
  min-height: 80px; background: var(--surf2); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 6px; display: flex; flex-direction: column; gap: 4px;
  transition: var(--transition); position: relative;
}
.act-cal-day:hover { border-color: var(--border2); }
.act-cal-day.empty { background: transparent; border: none; }
.act-cal-day.today { border-color: var(--gold); background: var(--gold-dim); }
.act-cal-day.has-activity { border-color: rgba(212,168,67,.25); }
.act-cal-day .day-num {
  font-size: 12px; font-weight: 700; color: var(--text-2); text-align: center;
}
.act-cal-day.today .day-num { color: var(--gold); font-weight: 900; }
.act-cal-day .day-icons {
  display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; flex: 1; align-items: center;
}
.act-cal-day .day-icon {
  font-size: 14px; opacity: .7;
}
.act-cal-day .day-icon.workout { opacity: 1; }
.act-cal-day .day-stats {
  font-size: 9px; color: var(--muted); text-align: center;
}
.act-cal-day .day-water-bar {
  height: 3px; background: var(--surf3); border-radius: 2px; overflow: hidden; margin-top: auto;
}
.act-cal-day .day-water-fill { height: 100%; background: var(--pull); border-radius: 2px; }

.act-cal-legend {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.act-cal-legend .li { display: flex; align-items: center; gap: 6px; }
.act-cal-legend .sw { width: 14px; height: 14px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; }

.act-cal-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px;
}
.act-cal-stat {
  background: var(--surf1); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; text-align: center;
}
.act-cal-stat .ic { font-size: 20px; margin-bottom: 8px; }
.act-cal-stat .v { font-size: 22px; font-weight: 900; color: var(--gold); }
.act-cal-stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   QUICK-LOG MODAL (in program view)
   ============================================================ */
.quicklog-modal {
  position: fixed; inset: 0; z-index: 3200;
  background: rgba(9,9,15,.85); backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.quicklog-modal.open { display: flex; animation: fadeIn .25s; }
.quicklog-card {
  background: var(--surf1); border: 1px solid var(--border2); border-radius: 20px;
  padding: 32px 28px; max-width: 460px; width: 100%; position: relative;
  box-shadow: var(--shadow-gold);
}
.quicklog-card .ql-close {
  position: absolute; top: 16px; left: 16px; width: 34px; height: 34px;
  background: var(--surf2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 9px; font-size: 16px; cursor: pointer; transition: var(--transition);
}
.quicklog-card .ql-close:hover { color: var(--danger); border-color: var(--danger); }
.quicklog-card .ql-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.quicklog-card .ql-ex-name { font-size: 18px; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.quicklog-card .ql-ex-en { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.quicklog-card .ql-sets-mini {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px;
}
.quicklog-card .ql-set-row {
  display: grid; grid-template-columns: 30px 1fr 1fr 1fr; gap: 8px; align-items: center;
}
.quicklog-card .ql-set-num {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--gold-dim);
  color: var(--gold); font-size: 12px; font-weight: 800;
}
.quicklog-card .ql-set-input {
  padding: 8px; background: var(--surf2); border: 1px solid var(--border2);
  border-radius: 7px; color: var(--text); font-size: 13px; text-align: center;
  font-family: inherit; font-weight: 700;
}
.quicklog-card .ql-set-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }
.quicklog-card .ql-set-label { font-size: 10px; color: var(--muted); text-align: center; }
.quicklog-card .ql-actions { display: flex; gap: 10px; margin-top: 18px; }
.quicklog-card .ql-add-set {
  background: var(--surf2); border: 1px dashed var(--border2); color: var(--text-2);
  padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition); font-family: inherit; width: 100%;
}
.quicklog-card .ql-add-set:hover { border-color: var(--gold); color: var(--gold); border-style: solid; }

.ql-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--gold-dim); border: 1px solid rgba(212,168,67,.2);
  color: var(--gold); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 7px; cursor: pointer;
  transition: var(--transition); vertical-align: middle; margin-right: 4px;
}
.ql-btn:hover { background: var(--gold); color: #1a1208; border-color: var(--gold); }

/* ============================================================
   POLISH (round 11)
   ============================================================ */
/* Improved card header */
.card-head { 
  position: relative;
}
.card-head::after {
  content: ''; position: absolute; bottom: 0; right: 0; left: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Improved stat card hover */
.stat-card:hover .num {
  text-shadow: 0 0 20px var(--gold-glow);
}

/* Improved nav item transition */
.side-nav a { position: relative; overflow: hidden; }
.side-nav a::before {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 0;
  background: var(--gold-dim); transition: width .25s; z-index: -1;
}
.side-nav a:hover::before { width: 100%; }
.side-nav a.active::before { width: 3px; background: var(--gold); }

/* Improved button shimmer */
.btn-gold { position: relative; overflow: hidden; }
.btn-gold::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transition: left .6s;
}
.btn-gold:hover::after { left: 100%; }

/* Improved table row hover */
table.tbl tbody tr { transition: background .15s, transform .15s; }
table.tbl tbody tr:hover { transform: translateX(-2px); }

/* ============================================================
   MOBILE POLISH
   ============================================================ */
@media (max-width: 760px) {
  .act-cal-grid { gap: 3px; }
  .act-cal-day { min-height: 60px; padding: 4px 2px; }
  .act-cal-day .day-num { font-size: 10px; }
  .act-cal-day .day-icon { font-size: 11px; }
  .act-cal-day .day-stats { display: none; }
  .act-cal-dow { font-size: 9px; padding: 4px 2px; }
  .mod-comment-actions { flex-direction: column; }
  .mod-comment-actions .btn { width: 100%; }
  .quicklog-card .ql-set-row { grid-template-columns: 26px 1fr 1fr; }
  .quicklog-card .ql-set-row .ql-set-input:nth-child(4) { display: none; }
  .quicklog-card .ql-set-row .ql-set-label:nth-child(5) { display: none; }
}
@media (max-width: 480px) {
  .act-cal-grid { grid-template-columns: repeat(7, 1fr); }
  .act-cal-day .day-icons { display: none; }
}

/* ============================================================
   ASYNC PROGRAM GENERATION — Dashboard + Waiting page
   ============================================================ */
@keyframes progressShimmer {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,168,67,.4); }
  50% { box-shadow: 0 0 0 8px rgba(212,168,67,0); }
}

/* Dashboard queued program banner */
.queued-banner {
  background: linear-gradient(135deg, var(--gold-dim), var(--surf1));
  border: 1px solid rgba(212,168,67,.3);
  border-radius: var(--r); padding: 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.queued-banner .qb-ic {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--gold); display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0; animation: pulseGold 2s infinite;
}
.queued-banner .qb-text { flex: 1; min-width: 200px; }
.queued-banner .qb-title { font-size: 15px; font-weight: 800; color: var(--gold); }
.queued-banner .qb-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.queued-banner .qb-bar {
  margin-top: 12px; height: 4px; background: var(--surf3); border-radius: 3px; overflow: hidden;
}
.queued-banner .qb-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 3px; animation: progressShimmer 1.5s ease-in-out infinite;
}
