/* ============================================
   Leo Fit PWA — Global Style Sheet
   Design tokens from mockupy_ui analysis
   ============================================ */

:root {
  /* Kolory wg Księgi Znaku Leon */
  --green: #88b828;              /* Pantone 154-7 (C45 M0 Y94 K3) */
  --green-glow: rgba(136, 184, 40, 0.35);
  --green-dim: rgba(136, 184, 40, 0.12);
  --bg: #2b3e34;                 /* Pantone 176-14 przyciemniony */
  --surface: #375546;            /* Pantone 176-14 (C64 M42 Y54 K40) */
  --surface-2: #436652;          /* Pantone 176-14 rozjaśniony */
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.50);
  --border: rgba(255, 255, 255, 0.12);
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;
  --font: 'Poppins', sans-serif;
  --nav-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* ---- Screen ---- */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  will-change: transform, opacity;
}
.screen.active { display: flex; }
.screen.fade-in    { animation: fadeIn    0.2s ease-out; }
.screen.slide-left  { animation: slideLeft  0.2s ease-out; }
.screen.slide-right { animation: slideRight 0.2s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translate3d(40px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translate3d(-40px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 398px;
  background: rgba(30, 42, 36, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.nav-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.nav-btn.active {
  background: var(--green);
  color: #121815;
  box-shadow: 0 0 16px var(--green-glow);
}
.nav-btn:not(.active):hover { color: var(--green); }

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* ---- Progress Ring ---- */
.ring-wrap { position: relative; display: inline-flex; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

/* ---- Progress Bar ---- */
.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--green-glow);
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

/* ---- Inputs ---- */
.input-field {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus { border-color: var(--green); }

/* ---- Buttons ---- */
.btn-primary {
  width: 100%;
  background: var(--green);
  color: #121815;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 15px 24px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px var(--green-glow);
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }

/* ---- PIN inputs ---- */
.pin-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.pin-digit {
  width: 48px; height: 60px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
  caret-color: var(--green);
}
.pin-digit:focus { border-color: var(--green); }

/* ---- Leaderboard rows ---- */
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background 0.15s;
  cursor: pointer;
}
.lb-row:hover { background: rgba(255,255,255,0.04); }
.lb-row.lb-me { background: var(--green-dim); border: 1px solid rgba(153,204,51,0.25); }
.lb-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
  flex-shrink: 0;
}

/* ---- Reward item ---- */
.reward-item {
  display: flex; align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.reward-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  background: var(--green-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}

/* ---- Tab switcher ---- */
.tab-bar {
  display: flex;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none; border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--green);
  color: #121815;
  box-shadow: 0 2px 12px var(--green-glow);
}

/* ---- Utility ---- */
.material-symbols-outlined { font-size: 24px; user-select: none; }
.icon-fill { font-variation-settings: 'FILL' 1; }
section { padding: 0 16px; }
h2 { font-size: 1.25rem; font-weight: 700; }
.muted { color: var(--text-muted); font-size: 0.8rem; }
.green { color: var(--green); }
.scroll-area { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.scroll-area::-webkit-scrollbar { width: 0; }

/* ---- Calendar ---- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-header {
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 0;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  transition: background 0.15s;
}
.cal-empty { visibility: hidden; }
.cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}
.cal-has-activity {
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}
.cal-has-activity .cal-day-num { color: var(--text); }
.cal-has-activity:hover { background: var(--surface-2); }
.cal-has-activity.cal-selected {
  border-color: var(--green);
  background: var(--green-dim);
  box-shadow: 0 0 8px var(--green-glow);
}
.cal-today {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.cal-km {
  font-size: 0.5rem;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
}
.cal-dots {
  display: flex;
  gap: 3px;
  min-height: 6px;
}
.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.cal-dot-cycling { background: var(--green); }
.cal-dot-running { background: #5bb8f5; }
.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--green-dim); color: var(--green); }
.cal-nav-btn:disabled { cursor: default; }
.cal-nav-btn:disabled:hover { background: var(--surface-2); color: var(--text); }

/* Day detail */
.day-activity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.day-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.day-activity-icon.cycling { background: var(--green); }
.day-activity-icon.cycling .material-symbols-outlined { color: #121815; font-size: 18px; }
.day-activity-icon.running { background: #5bb8f5; }
.day-activity-icon.running .material-symbols-outlined { color: #121815; font-size: 18px; }

/* ---- Splash (V2) ---- */
