/* ═══════════════════════════════════════════
   GymBuddy Pro — main.css
   Variables · Reset · Layout · Topbar · Nav · Drawer · Toast
   ═══════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  --primary:       #FF6B35;
  --primary-dark:  #E55A26;
  --primary-light: #FFF3EE;
  --green:         #4CAF50;
  --green-light:   #F0FFF4;
  --blue:          #2196F3;
  --blue-light:    #EBF8FF;
  --red:           #E53E3E;
  --yellow:        #F6AD55;
  --purple:        #9C27B0;
  --bg:            #F5F7FA;
  --card:          #FFFFFF;
  --text:          #2D3748;
  --muted:         #718096;
  --border:        #E2E8F0;
  --shadow:        rgba(0,0,0,0.07);
  --nav:           65px;
  --top:           56px;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-xs:     8px;
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  max-width: 430px;
  margin: 0 auto;
  height: var(--top);
  background: linear-gradient(135deg, var(--primary), #FF9800);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(255,107,53,.3);
}
.topbar-info { display: flex; flex-direction: column; }
.topbar-title {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.2;
}
.topbar-sub {
  color: rgba(255,255,255,.85);
  font-size: 11px;
  font-weight: 500;
  margin-top: 1px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 2px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 700;
  cursor: pointer;
}
.hamburger {
  background: none; border: none;
  padding: 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ── MAIN CONTENT ── */
.content {
  padding-top: calc(var(--top) + 14px);
  padding-bottom: calc(var(--nav) + 16px);
  padding-left: 12px;
  padding-right: 12px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 430px;
  margin: 0 auto;
  height: var(--nav);
  background: #fff;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 14px var(--shadow);
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  border: none; background: none;
  padding: 8px 4px;
  position: relative;
  transition: opacity .15s;
}
.nav-btn:active { opacity: .7; }
.nav-icon { font-size: 22px; line-height: 1; transition: transform .2s; }
.nav-label { font-size: 10px; font-weight: 600; color: var(--muted); transition: color .2s; }
.nav-btn.active .nav-label { color: var(--primary); }
.nav-btn.active .nav-icon { transform: scale(1.12); }
.nav-btn.active::before {
  content: '';
  position: absolute; top: 0;
  left: 20%; right: 20%;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* ── DRAWER ── */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
}
.overlay.open { display: block; }
.drawer {
  position: fixed;
  top: 0; right: -100%;
  width: 78%; max-width: 300px;
  height: 100%;
  background: #fff;
  z-index: 201;
  transition: right .28s ease;
  padding: 0;
  box-shadow: -6px 0 28px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer.open { right: 0; }
.drawer-head {
  background: linear-gradient(135deg, var(--primary), #FF9800);
  padding: 24px 20px 20px;
  color: #fff;
}
.drawer-head-title { font-size: 18px; font-weight: 800; }
.drawer-head-sub { font-size: 12px; opacity: .85; margin-top: 3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 0; }
.d-item {
  padding: 14px 20px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  color: var(--text);
  transition: background .15s;
  border-bottom: 1px solid #F7F7F7;
}
.d-item:active { background: var(--primary-light); }
.d-item-icon { font-size: 18px; width: 24px; text-align: center; }
.d-item-text { flex: 1; font-weight: 500; }
.d-item-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.drawer-footer {
  padding: 16px 20px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  line-height: 1.8;
}
.d-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,.2);
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav) + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #2D3748;
  color: #fff;
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 13px; font-weight: 600;
  opacity: 0;
  transition: all .3s;
  z-index: 400;
  white-space: nowrap;
  pointer-events: none;
  max-width: 90%;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── SECTION TITLE ── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 18px 0 10px;
}

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.empty-icon { font-size: 36px; display: block; margin-bottom: 8px; }
