/* ── Atlas Sections — Airtable-powered panels ────── */

/* Section nav */
.section-nav {
  display: flex;
  gap: 2px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.section-nav::-webkit-scrollbar { display: none; }

.section-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 56px;
  font-family: inherit;
}
.section-btn:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.05); }
.section-btn.active { color: #fff; background: rgba(255,255,255,0.1); }
.section-icon { font-size: 16px; line-height: 1; }
.section-label { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; }

/* Atlas section container */
.atlas-section {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.atlas-section-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.atlas-sub-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin: 20px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.atlas-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card base */
.atlas-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.15s;
}
.atlas-card:hover { transform: translateY(-1px); }

.atlas-card-header {
  padding: 14px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.atlas-card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}
.atlas-card-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.atlas-card-body {
  padding: 0 16px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

/* Tags & badges */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tag-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
}
.tag-sm { font-size: 10px; padding: 1px 6px; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

/* Goals */
.goal-title-row { display: flex; align-items: flex-start; gap: 8px; }
.goal-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.goal-target, .goal-baseline { margin-bottom: 6px; }
.goal-dates { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: rgba(255,255,255,0.4); }
.goal-notes { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); font-style: italic; }

/* Progress bar */
.progress-bar {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin: 10px 0 4px;
  overflow: visible;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #00c853, #69f0ae);
  transition: width 0.6s ease;
}
.progress-label {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 11px;
  font-weight: 700;
  color: #69f0ae;
}

/* Supplements */
.supp-row { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.supp-row:last-child { border-bottom: none; }
.supp-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.supp-name { font-weight: 600; color: #fff; font-size: 14px; }
.supp-details { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.5); }
.supp-purpose { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.4); font-style: italic; }

/* Training */
.training-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.training-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.training-stats .stat { font-size: 12px; }
.training-exercises pre,
.training-cardio pre {
  font-family: inherit;
  white-space: pre-wrap;
  font-size: 12px;
  margin: 4px 0;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
}
.training-notes { margin-top: 8px; font-style: italic; }

/* Routines */
.routine-duration { margin-bottom: 8px; }
.routine-steps pre {
  font-family: inherit;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  margin: 4px 0;
  padding: 10px 14px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
}
.routine-notes { margin-top: 8px; font-style: italic; font-size: 12px; }

/* Check-ins */
.checkin-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.checkin-score {
  display: flex;
  align-items: center;
  gap: 8px;
}
.score-label {
  width: 72px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.score-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.score-val {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}
.checkin-text { margin-top: 8px; font-size: 13px; }
.coach-response {
  background: rgba(0,200,83,0.08);
  border-left: 3px solid #00c853;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin-top: 10px;
}

/* Journal */
.journal-meta { display: flex; align-items: center; gap: 8px; }
.journal-body { line-height: 1.6; }
.journal-tags { margin-top: 10px; display: flex; gap: 4px; flex-wrap: wrap; }

/* Biomarkers */
.bio-summary { font-size: 13px; color: rgba(255,255,255,0.5); }

/* Loading & empty states */
.atlas-loading {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #69f0ae;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.atlas-empty {
  text-align: center;
  color: rgba(255,255,255,0.3);
  padding: 60px 20px;
  font-size: 14px;
}

/* ── Session Exercises ─────────────────────────────── */
.ex-card { cursor: default; }
.ex-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.ex-order {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(105,240,174,0.15);
  color: #69f0ae;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.ex-info { flex: 1; min-width: 0; }
.ex-info h3 { margin: 0; font-size: 15px; font-weight: 600; color: #fff; }
.ex-prescription {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  flex-wrap: wrap;
}
.ex-sep { color: rgba(255,255,255,0.25); }
.ex-chevron {
  color: rgba(255,255,255,0.3);
  font-size: 16px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.ex-card.expanded .ex-chevron { transform: rotate(180deg); }

.ex-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s;
  padding: 0 16px;
}
.ex-card.expanded .ex-card-detail {
  max-height: 800px;
  padding: 0 16px 16px;
}

.ex-video-link {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(41,121,255,0.15);
  color: #64b5f6;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 12px;
  transition: background 0.2s;
}
.ex-video-link:hover { background: rgba(41,121,255,0.25); }

.ex-details { margin-top: 8px; }
.ex-detail-row {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  gap: 10px;
}
.ex-detail-row:last-child { border-bottom: none; }
.ex-detail-label {
  width: 110px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.4);
  padding-top: 1px;
}
.ex-detail-val {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

.ex-coach-note {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(0,200,83,0.08);
  border-left: 3px solid #00c853;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}

/* ── Rest Timer ───────────────────────────────────── */
.ex-rest-timer {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rest-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.rest-btn:hover { background: rgba(255,255,255,0.14); }
.rest-btn.rest-done {
  background: rgba(0,200,83,0.15);
  border-color: rgba(0,200,83,0.3);
  color: #69f0ae;
}
.rest-icon { font-size: 15px; }

.rest-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
}
.rest-ring {
  position: relative;
  width: 56px;
  height: 56px;
}
.rest-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.rest-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 3;
}
.rest-ring-fill {
  fill: none;
  stroke: #69f0ae;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s linear;
}
.rest-time {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

/* ── Meal Plan ────────────────────────────────────── */
.meal-day-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.meal-day-tabs::-webkit-scrollbar { display: none; }
.meal-day-tab {
  padding: 6px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
}
.meal-day-tab:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }
.meal-day-tab.active { background: rgba(105,240,174,0.15); color: #69f0ae; border-color: rgba(105,240,174,0.3); }

.meal-day-panel { display: none; }
.meal-day-panel.active { display: block; }

.meal-slot { margin-bottom: 20px; }
.meal-slot-header {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.meal-slot-icon { font-size: 16px; }
.meal-slot-cards { display: flex; flex-direction: column; gap: 10px; }

.meal-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
}
.meal-img {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.meal-card-body { padding: 14px 16px; }
.meal-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px;
}
.meal-prep-time {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-left: 6px;
}

.meal-macros {
  display: flex;
  gap: 2px;
  margin: 10px 0;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 8px 4px;
  justify-content: space-around;
}
.macro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 48px;
}
.macro-val {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.macro-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.35);
}
.macro-p .macro-val { color: #64b5f6; }
.macro-c .macro-val { color: #ffb74d; }
.macro-f .macro-val { color: #ef5350; }
.macro-fb .macro-val { color: #81c784; }

.meal-prep {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 8px;
  max-height: 40px;
  overflow: hidden;
  cursor: pointer;
  transition: max-height 0.3s;
}
.meal-prep.expanded { max-height: 600px; }
.meal-notes {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-style: italic;
}

.meal-alts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meal-alts-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.3px;
}
.meal-alt-chip {
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 480px) {
  .section-nav { padding: 6px 8px; }
  .section-btn { min-width: 48px; padding: 4px 6px; }
  .section-label { font-size: 9px; }
  .atlas-section { padding: 12px; }
  .atlas-card-header { padding: 12px 14px 6px; }
  .atlas-card-body { padding: 0 14px 12px; }
  .training-stats { flex-direction: column; gap: 4px; }
  .ex-detail-row { flex-direction: column; gap: 2px; }
  .ex-detail-label { width: auto; }
  .meal-macros { gap: 0; padding: 6px 2px; }
  .macro { min-width: 40px; }
  .macro-val { font-size: 13px; }
  .meal-img { height: 110px; }
}
