/* ═══════════════════════════════════════════════════════════════
   ForeverFitWithAsh — Portal Stats / Performance Hub CSS
   Wearable · Strength · Achievements · Leaderboard · Videos
═══════════════════════════════════════════════════════════════ */

/* ── Hub Nav ──────────────────────────────────────────────── */
.hub-section-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 28px 0 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 10px;
}
.hub-nav-btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
}
.hub-nav-btn:hover {
  background: rgba(233,30,140,0.1);
  color: #fff;
  border-color: rgba(233,30,140,0.3);
}
.hub-nav-btn.active {
  background: linear-gradient(135deg,#e91e8c,#c2185b);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(233,30,140,0.35);
}

/* ── KPI Cards ───────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media(max-width:680px) { .kpi-row { grid-template-columns: 1fr 1fr; } }
@media(max-width:380px) { .kpi-row { grid-template-columns: 1fr; } }

.kpi-card {
  background: rgba(18,18,30,0.85);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color .22s ease, transform .22s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,#e91e8c,#ff2da0);
  border-radius: 3px 3px 0 0;
}
.kpi-card:hover {
  border-color: rgba(233,30,140,0.35);
  transform: translateY(-2px);
}
.kpi-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.kpi-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: #fff;
  letter-spacing: .03em;
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-lbl {
  font-size: .75rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.kpi-trend {
  font-size: .72rem;
  font-weight: 700;
  margin-top: 6px;
}
.kpi-trend.trend-good { color: #00e676; }
.kpi-trend.trend-bad  { color: #ff5252; }

/* ── Device Connect ──────────────────────────────────────── */
.device-connect-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.device-connect-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all .22s ease;
}
.device-connect-btn:hover {
  background: rgba(233,30,140,0.15);
  border-color: rgba(233,30,140,0.4);
  color: #fff;
}
.device-connect-btn.connected {
  background: rgba(0,230,118,0.12);
  border-color: rgba(0,230,118,0.5);
  color: #00e676;
  box-shadow: 0 0 12px rgba(0,230,118,0.15);
}
.device-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(233,30,140,0.15);
  color: #e91e8c;
  border: 1px solid rgba(233,30,140,0.3);
}

/* ── PR Cards ────────────────────────────────────────────── */
.pr-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.pr-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  transition: all .22s ease;
}
.pr-card:hover {
  border-color: rgba(233,30,140,0.35);
  background: rgba(233,30,140,0.06);
}
.pr-exercise {
  font-size: .78rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.pr-rm {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: #e91e8c;
  line-height: 1;
}
.pr-unit {
  font-family: 'Inter', sans-serif;
  font-size: .65rem;
  color: rgba(255,255,255,0.4);
  display: block;
}
.pr-detail {
  font-size: .78rem;
  color: rgba(255,255,255,0.5);
  margin: 4px 0;
}
.pr-date {
  font-size: .72rem;
  color: rgba(255,255,255,0.3);
}

/* ── Badges Grid ─────────────────────────────────────────── */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.badge-card {
  border-radius: 16px;
  padding: 20px 12px;
  text-align: center;
  transition: all .25s ease;
  cursor: default;
}
.badge-card.earned {
  background: rgba(255,214,0,0.08);
  border: 1.5px solid rgba(255,214,0,0.35);
  box-shadow: 0 4px 20px rgba(255,214,0,0.1);
}
.badge-card.earned:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(255,214,0,0.2);
}
.badge-card.locked {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.07);
  opacity: .55;
}
.badge-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  line-height: 1;
}
.badge-name {
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.badge-date {
  font-size: .7rem;
  color: rgba(255,214,0,0.7);
  margin-bottom: 4px;
}
.badge-desc {
  font-size: .72rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}

/* ── Leaderboard ─────────────────────────────────────────── */
.lb-tab {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.lb-tab.active {
  background: linear-gradient(135deg,#e91e8c,#c2185b);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(233,30,140,0.3);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: all .2s ease;
  position: relative;
}
.lb-row:hover { background: rgba(255,255,255,0.07); }
.lb-row-me {
  background: rgba(233,30,140,0.1) !important;
  border-color: rgba(233,30,140,0.35) !important;
  box-shadow: 0 0 20px rgba(233,30,140,0.12);
}
.lb-rank {
  width: 36px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.lb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg,#e91e8c,#c2185b);
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lb-name {
  flex: 1;
  font-size: .88rem;
  color: rgba(255,255,255,0.85);
}
.lb-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: #e91e8c;
  letter-spacing: .03em;
}
.lb-unit {
  font-family: 'Inter', sans-serif;
  font-size: .7rem;
  color: rgba(255,255,255,0.4);
}
.lb-me-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(233,30,140,0.25);
  color: #e91e8c;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
}

/* ── Video Library ───────────────────────────────────────── */
.video-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.video-card {
  background: rgba(18,18,30,0.9);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  overflow: hidden;
  transition: all .22s ease;
  position: relative;
}
.video-card:hover {
  border-color: rgba(233,30,140,0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.video-info {
  padding: 14px;
}
.video-cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  border: 1px solid;
  margin-bottom: 8px;
}
.video-title {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.video-duration {
  font-size: .75rem;
  color: rgba(255,255,255,0.4);
}
.video-desc {
  font-size: .78rem;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  line-height: 1.4;
}
.delete-video-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255,82,82,0.85);
  color: #fff;
  cursor: pointer;
  font-size: .78rem;
  opacity: 0;
  transition: opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-card:hover .delete-video-btn { opacity: 1; }

/* ── Form helpers shared ─────────────────────────────────── */
.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  display: block;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-row {
  display: flex;
  flex-direction: column;
}
.icon-btn-sm {
  background: rgba(255,82,82,0.1);
  border: 1px solid rgba(255,82,82,0.3);
  color: #ff5252;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .78rem;
  transition: background .2s;
}
.icon-btn-sm:hover { background: rgba(255,82,82,0.25); }

/* ── Shared form classes (portal doesn't include style.css) ─ */
.form-input,
.form-select {
  width: 100%;
  padding: 9px 13px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: .86rem;
  transition: border-color .22s ease;
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus {
  border-color: #e91e8c;
  background: rgba(233,30,140,0.06);
}
.form-input::placeholder { color: rgba(255,255,255,0.3); }
.form-select option { background: #1a1a2e; color: #fff; }

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: linear-gradient(135deg, #e91e8c, #c2185b);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(233,30,140,0.4); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.card-sub-title {
  font-size: .9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Hub Section (hide by default) ──────────────────────── */
.hub-section { display: none; }
.hub-section:first-of-type { display: block; }
#hub-wearable { display: block; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .pr-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .badges-grid   { grid-template-columns: repeat(2, 1fr); }
  .video-library-grid { grid-template-columns: 1fr; }
  .hub-section-nav { gap: 6px; padding: 8px; }
  .hub-nav-btn { font-size: .75rem; padding: 8px 10px; min-width: 90px; }
}
@media (max-width: 480px) {
  .badges-grid { grid-template-columns: repeat(2, 1fr); }
  .pr-cards-grid { grid-template-columns: 1fr; }
}
