/* ============================================================
   larofit.css — Shared design system for LaroFit v2
   All pages link to this file. One change fixes everything.
   ============================================================ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ── */
:root {
  /* Backgrounds */
  --bg:          #f5f5f0;
  --bg-card:     #ffffff;
  --bg-card2:    #f0f0eb;
  --bg-dark:     #1a1a1a;
  --bg-dark2:    #242424;

  /* Text */
  --text:        #1a1a1a;
  --text-2:      #555555;
  --text-3:      #999999;
  --text-inv:    #ffffff;

  /* Brand */
  --volt:        #c6f135;
  --volt-dark:   #8aaa10;
  --volt-bg:     rgba(198, 241, 53, 0.14);
  --volt-border: rgba(198, 241, 53, 0.35);

  /* Semantic */
  --success:     #22c55e;
  --success-bg:  rgba(34, 197, 94, 0.1);
  --danger:      #ef4444;
  --danger-bg:   rgba(239, 68, 68, 0.1);
  --warning:     #f59e0b;
  --warning-bg:  rgba(245, 158, 11, 0.1);
  --blue:        #3b82f6;
  --blue-bg:     rgba(59, 130, 246, 0.1);

  /* Exercise type colors */
  --type-strength:  #c6f135;
  --type-cardio:    #3b82f6;
  --type-hiit:      #f97316;
  --type-yoga:      #a78bfa;
  --type-stretch:   #22c55e;
  --type-recovery:  #ec4899;

  /* Borders */
  --border:      rgba(0, 0, 0, 0.08);
  --border-md:   rgba(0, 0, 0, 0.14);
  --border-dark: rgba(255, 255, 255, 0.1);

  /* Layout */
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --nav-h:       64px;
  --page-pad:    16px;

  /* Typography */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Shadows */
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);
  --shadow:      0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
}

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: var(--nav-h);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-body);
  color: var(--text);
}

/* ── BOTTOM NAV ── */
.lf-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg-card);
  border-top: 0.5px solid var(--border-md);
  display: flex;
  align-items: stretch;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Hide logo on mobile — only shows on desktop sidebar */
.lf-nav-logo { display: none; }

/* Tabs fill the full nav bar as a row on mobile */
.lf-nav-tabs {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
}

.lf-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: none;
  cursor: pointer;
  transition: opacity 0.15s;
  color: var(--text-3);
  position: relative;
}

.lf-nav-tab:active { opacity: 0.6; }

.lf-nav-tab .lf-nav-icon {
  width: 44px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  transition: background 0.2s;
  font-size: 20px;
}

.lf-nav-tab .lf-nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.lf-nav-tab.active .lf-nav-icon {
  background: var(--volt-bg);
}

.lf-nav-tab.active .lf-nav-label {
  color: var(--volt-dark);
  font-weight: 600;
}

.lf-nav-tab.active i {
  color: var(--volt-dark);
}

/* ── PAGE HEADER ── */
.lf-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  padding: 14px var(--page-pad) 12px;
}

.lf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lf-header-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1;
}

.lf-header-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* ── CARDS ── */
.lf-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  overflow: hidden;
}

.lf-card-dark {
  background: var(--bg-dark);
  border-radius: var(--radius);
  color: var(--text-inv);
}

.lf-card-pad {
  padding: 14px 16px;
}

/* ── SECTION LABEL ── */
.lf-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 var(--page-pad);
  margin-bottom: 8px;
  margin-top: 20px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-volt {
  background: var(--volt);
  color: var(--bg-dark);
}
.btn-volt:hover { background: #b8e020; }

.btn-dark {
  background: var(--bg-dark);
  color: var(--volt);
}
.btn-dark:hover { background: var(--bg-dark2); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-md);
  color: var(--text-2);
}
.btn-outline:hover { border-color: var(--text-3); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 10px 12px;
}
.btn-ghost:hover { color: var(--text); }

.btn-full { width: 100%; }

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
  border-radius: var(--radius);
}

/* ── EXERCISE TYPE BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.badge-strength { background: var(--bg-dark); color: var(--volt); }
.badge-cardio   { background: var(--blue-bg); color: var(--blue); }
.badge-hiit     { background: rgba(249,115,22,0.12); color: #f97316; }
.badge-yoga     { background: rgba(167,139,250,0.12); color: #a78bfa; }
.badge-stretch  { background: var(--success-bg); color: var(--success); }
.badge-recovery { background: rgba(236,72,153,0.12); color: #ec4899; }
.badge-next     { background: var(--bg-card2); color: var(--text-3); }

/* ── STAT CARDS ── */
.lf-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 var(--page-pad);
}

.lf-stat {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  padding: 12px 14px;
}

.lf-stat-label {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 4px;
}

.lf-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.lf-stat-unit {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 3px;
}

/* ── STREAK DOTS ── */
.lf-streak-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.lf-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 7px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card2);
  color: var(--text-3);
  flex-shrink: 0;
}

.lf-dot.done { background: var(--volt); color: var(--bg-dark); }
.lf-dot.today { background: var(--bg-dark); color: var(--text-inv); }
.lf-dot.rest { background: var(--bg-card2); color: var(--text-3); opacity: 0.5; }

/* ── PROGRESS BAR ── */
.lf-prog-bar {
  height: 4px;
  background: var(--bg-card2);
  border-radius: 2px;
  overflow: hidden;
}

.lf-prog-fill {
  height: 100%;
  background: var(--volt);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── LIST ROWS ── */
.lf-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-card);
}

.lf-list-row:last-child { border-bottom: none; }

.lf-list-row-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--text-3);
}

.lf-list-row-body { flex: 1; min-width: 0; }

.lf-list-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lf-list-row-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.lf-list-row-right {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: 12px;
}

/* ── FORM ELEMENTS ── */
.lf-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-card2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.lf-input:focus {
  border-color: var(--volt-dark);
  background: var(--bg-card);
}

.lf-input::placeholder { color: var(--text-3); }

.lf-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lf-num-input {
  width: 100%;
  max-width: 80px;
  padding: 8px 4px;
  background: var(--bg-card2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -moz-appearance: textfield;
}
.lf-num-input::-webkit-inner-spin-button,
.lf-num-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.lf-num-input:focus {
  border-color: var(--volt-dark);
  background: var(--volt-bg);
}

/* ── EMPTY STATE ── */
.lf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.lf-empty-icon {
  font-size: 40px;
  opacity: 0.3;
}

.lf-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
}

.lf-empty-body {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
  max-width: 240px;
}

/* ── AI INSIGHT CARD ── */
.lf-ai-card {
  margin: 0 var(--page-pad);
  background: var(--volt-bg);
  border: 1px solid var(--volt-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.lf-ai-icon {
  font-size: 18px;
  color: var(--volt-dark);
  flex-shrink: 0;
  margin-top: 1px;
}

.lf-ai-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--volt-dark);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 3px;
}

.lf-ai-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── MODAL / SHEET ── */
.lf-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.lf-sheet-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.lf-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 301;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  max-height: 85dvh;
}

.lf-sheet.open {
  transform: translateY(0);
}

.lf-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-md);
  border-radius: 2px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

.lf-sheet-title {
  font-size: 16px;
  font-weight: 700;
  padding: 0 16px 12px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}

.lf-sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ── UTILITY ── */
.lf-page-pad { padding: 0 var(--page-pad); }
.lf-gap-sm   { gap: 8px; }
.lf-gap      { gap: 12px; }
.lf-gap-lg   { gap: 20px; }
.lf-mt-sm    { margin-top: 8px; }
.lf-mt       { margin-top: 14px; }
.lf-mt-lg    { margin-top: 24px; }
.lf-mb-sm    { margin-bottom: 8px; }
.lf-mb       { margin-bottom: 14px; }
.lf-mb-lg    { margin-bottom: 24px; }
.lf-flex     { display: flex; align-items: center; }
.lf-between  { display: flex; align-items: center; justify-content: space-between; }
.lf-col      { display: flex; flex-direction: column; }
.lf-text-sm  { font-size: 12px; }
.lf-text-xs  { font-size: 11px; }
.lf-muted    { color: var(--text-3); }
.lf-mono     { font-family: var(--font-mono); }
.sr-only     { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }

/* ── DESKTOP (768px+) ── */
@media (min-width: 768px) {
  :root {
    --page-pad: 24px;
  }

  body {
    padding-bottom: 0;
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 100vh;
  }

  /* Switch nav to sidebar */
  .lf-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 240px;
    flex-direction: column;
    border-top: none;
    border-right: 0.5px solid var(--border-md);
    padding: 0;
    align-items: stretch;
    overflow-y: auto;
  }

  /* Show logo on desktop */
  .lf-nav-logo {
    display: flex;
    align-items: center;
    padding: 24px 20px 20px;
    border-bottom: 0.5px solid var(--border);
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 2px;
    color: var(--text);
    flex-shrink: 0;
  }

  .lf-nav-logo span { color: var(--volt-dark); }

  /* Switch tabs back to column for sidebar */
  .lf-nav-tabs {
    flex-direction: column;
    padding: 12px 0;
    flex: 1;
  }

  .lf-nav-tab {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    border-left: 3px solid transparent;
    border-radius: 0;
    flex: none;
  }

  .lf-nav-tab .lf-nav-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 17px;
    background: none;
  }

  .lf-nav-tab .lf-nav-label {
    font-size: 13px;
  }

  .lf-nav-tab.active {
    background: var(--volt-bg);
    border-left-color: var(--volt-dark);
  }

  .lf-nav-tab.active .lf-nav-icon { background: none; }

  .lf-main-desktop {
    overflow-y: auto;
    height: 100vh;
  }
}
