/* ============================================================
   GYM TRACKER – style.css
   Dark mode, mobile-first, minimalistický
   ============================================================ */

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

/* ---- CSS premenné ---- */
:root {
  --bg:          #0d1117;
  --card:        #161b22;
  --card2:       #21262d;
  --border:      #30363d;
  --accent:      #3fb950;    /* zelená */
  --accent-dim:  #1a4a27;
  --accent2:     #26a641;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --danger:      #f85149;
  --warn:        #d29922;
  --radius:      12px;
  --nav-h:       62px;
}

/* ---- Base ---- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 8px);
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   NAVIGÁCIA (spodná lišta)
   ============================================================ */
#main-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  cursor: pointer;
  padding: 6px 2px;
  transition: color 0.15s;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

/* ============================================================
   HLAVNÝ OBSAH
   ============================================================ */
main {
  max-width: 500px;
  margin: 0 auto;
  padding: 14px 14px 0;
}

/* ---- Tabs ---- */
.tab {
  display: none;
}
.tab.active {
  display: block;
}

/* ---- Headings ---- */
h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 14px;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* ============================================================
   KARTY
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

/* ============================================================
   DASHBOARD – Váha & progress bar
   ============================================================ */
.weight-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.weight-display span:first-child {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.kg {
  font-size: 20px;
  color: var(--text);
}

.goal-label {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}

.progress-bar-wrap {
  background: var(--card2);
  border-radius: 8px;
  height: 14px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 8px;
  width: 0%;
  transition: width 0.6s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   CHECKLIST
   ============================================================ */
.checklist {
  display: flex;
  flex-direction: column;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.check-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.check-item:first-child {
  padding-top: 0;
}

.check-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.check-label {
  font-size: 15px;
}

/* ============================================================
   JEDÁLNIČEK – Summary
   ============================================================ */
.summary-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-section {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.muted-text {
  color: var(--muted);
  font-size: 14px;
}

/* ============================================================
   TRAVEL MODE TOGGLE
   ============================================================ */
.travel-card {
  margin-bottom: 14px;
}

.travel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 50px;
  height: 28px;
  display: inline-block;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.25s;
}

.slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}

.toggle input:checked + .slider {
  background: var(--accent);
}

.toggle input:checked + .slider::before {
  transform: translateX(22px);
}

/* Travel panel */
.travel-list {
  list-style: none;
}

.travel-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.travel-list li:last-child {
  border-bottom: none;
}

/* ============================================================
   JEDÁLNIČEK – Výber jedla
   ============================================================ */
.meal-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card2);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

.meal-option:active {
  transform: scale(0.98);
}

.meal-option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

.meal-option .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.meal-option.selected .dot {
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   TRÉNING
   ============================================================ */
.training-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.training-header h2 {
  margin-bottom: 0;
}

.ab-toggle {
  display: flex;
  gap: 6px;
}

.ab-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ab-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Cviky */
.exercise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.exercise-item:last-of-type {
  border-bottom: none;
}

.exercise-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.exercise-name {
  flex: 1;
  font-size: 14px;
  transition: color 0.15s;
}

.exercise-sets {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  background: var(--card2);
  padding: 3px 8px;
  border-radius: 6px;
}

.exercise-item.done .exercise-name {
  text-decoration: line-through;
  color: var(--muted);
}

/* História tréningov */
.training-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.training-entry:last-child {
  border-bottom: none;
}

.badge {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
   SPÁNOK
   ============================================================ */
.input-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  font-size: 18px;
  text-align: center;
}

.input-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hodnotenie spánku */
#sleep-rating {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  display: none;
}

#sleep-rating.good  { background: var(--accent-dim); color: var(--accent); display: block; }
#sleep-rating.ok    { background: #3d3300; color: var(--warn); display: block; }
#sleep-rating.bad   { background: #3d0f0f; color: var(--danger); display: block; }

/* História spánku */
.sleep-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.sleep-entry:last-child {
  border-bottom: none;
}

.sleep-val {
  font-weight: 600;
}

/* ============================================================
   PROGRES – Váha
   ============================================================ */
#weight-chart {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.weight-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.weight-entry:last-child {
  border-bottom: none;
}

.weight-val {
  font-weight: 700;
  color: var(--accent);
}

/* ============================================================
   UTILITY TRIEDY
   ============================================================ */
.hidden {
  display: none !important;
}

.full-width {
  width: 100%;
}

.mt {
  margin-top: 14px;
}

/* ============================================================
   TLAČIDLÁ
   ============================================================ */
.btn-primary {
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:active {
  background: var(--accent2);
  transform: scale(0.97);
}

/* ============================================================
   TOAST NOTIFIKÁCIA
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
  animation: toastIn 0.2s ease;
}

.toast.success { background: var(--accent); color: #0d1117; }
.toast.error   { background: var(--danger); color: #fff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--card); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
