/* ============================================================
   GYM TRACKER – Dark Fitness Theme
   ============================================================ */

:root {
  --bg-primary:   #0d1117;
  --bg-card:      #161b22;
  --bg-card-2:    #1c2128;
  --border:       #30363d;
  --text-primary: #e6edf3;
  --text-muted:   #8b949e;
  --accent:       #ff6b35;
  --accent-glow:  rgba(255, 107, 53, 0.25);
  --blue:         #4361ee;
  --green:        #3fb950;
  --red:          #f85149;
  --yellow:       #e3b341;
  --purple:       #bc8cff;
  --cyan:         #4cc9f0;
  --navbar-h:     64px;
}

/* ─── Base ─────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ff8c5a; text-decoration: underline; }

/* ─── Navbar ────────────────────────────────────────────── */
.gym-navbar {
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-h);
}

.brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
}

.brand-text {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.brand-accent { color: var(--accent); }

.gym-navbar .nav-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.gym-navbar .nav-link:hover,
.gym-navbar .nav-link.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.gym-dropdown {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  padding: 0.5rem;
}

.gym-dropdown .dropdown-item {
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
}

.gym-dropdown .dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.gym-dropdown .dropdown-divider { border-color: var(--border); }

.user-avatar-sm {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}

/* ─── Main Content ──────────────────────────────────────── */
.gym-main {
  margin-top: var(--navbar-h);
  padding: 2rem 0;
  min-height: calc(100vh - var(--navbar-h));
}

.gym-main-public {
  margin-top: 0;
  padding: 0;
}

/* ─── Page Header ───────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ─── Cards ─────────────────────────────────────────────── */
.gym-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}

.gym-card:hover { border-color: rgba(255,255,255,0.15); }

.gym-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.gym-card-body { padding: 1rem; }

/* ─── Buttons ───────────────────────────────────────────── */
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #e85d04);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #ff8c5a, var(--accent));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* ─── Forms ─────────────────────────────────────────────── */
.gym-input, .form-control, .form-select {
  background: var(--bg-card-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 8px;
}

.gym-input:focus, .form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  background: var(--bg-card) !important;
}

.gym-input-sm {
  background: var(--bg-card-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 6px;
  max-width: 100px;
}

/* ─── Tables ────────────────────────────────────────────── */
.gym-table {
  color: var(--text-primary);
}

.gym-table thead th {
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
}

.gym-table tbody td {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

.gym-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ─── Alerts ────────────────────────────────────────────── */
.gym-alert {
  border-radius: 10px;
  border: none;
  font-size: 0.875rem;
}

.messages-container { margin-bottom: 1.5rem; }

/* ─── Auth Pages ────────────────────────────────────────── */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 2rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin: 0 auto 1rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ─── Dashboard Stats ───────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: rgba(255,255,255,0.2); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-card-calories .stat-icon { background: rgba(255,107,53,0.15); color: var(--accent); }
.stat-card-protein .stat-icon  { background: rgba(67,97,238,0.15);  color: var(--blue); }
.stat-card-weight .stat-icon   { background: rgba(63,185,80,0.15);  color: var(--green); }
.stat-card-alert .stat-icon    { background: rgba(248,81,73,0.15);  color: var(--red); }
.stat-card-ok .stat-icon       { background: rgba(63,185,80,0.15);  color: var(--green); }

.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.stat-progress { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; }

.bg-orange { background-color: var(--accent) !important; }

/* ─── Suggestions ───────────────────────────────────────── */
.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.suggestion-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.suggestion-meal       { background: rgba(63,185,80,0.15);  color: var(--green); }
.suggestion-supplement { background: rgba(227,179,65,0.15); color: var(--yellow); }
.suggestion-medication { background: rgba(248,81,73,0.15);  color: var(--red); }
.suggestion-training   { background: rgba(67,97,238,0.15);  color: var(--blue); }

.suggestion-badge  { font-size: 0.65rem; display: block; margin-bottom: 0.2rem; }
.suggestion-title  { font-size: 0.875rem; font-weight: 600; }
.suggestion-msg    { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Nutrition ─────────────────────────────────────────── */
.macro-pill {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 2px;
}

.macro-cal { background: rgba(255,107,53,0.15); color: var(--accent); }
.macro-p   { background: rgba(67,97,238,0.15);  color: var(--blue); }
.macro-c   { background: rgba(76,201,240,0.15); color: var(--cyan); }
.macro-f   { background: rgba(227,179,65,0.15); color: var(--yellow); }

.food-card-header { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); display: flex; gap: 4px; flex-wrap: wrap; }
.food-type-badge  { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.badge-solid   { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-liquid  { background: rgba(76,201,240,0.15);  color: var(--cyan); }

.food-label-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.food-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }
.food-card-actions { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.macro-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.macro-val { font-size: 1.4rem; font-weight: 700; }
.macro-lbl { font-size: 0.75rem; color: var(--text-muted); }
.macro-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; }

.nutrition-table .nutrition-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.875rem;
}

.nutrition-row.nutrition-calories { font-weight: 700; font-size: 1rem; }
.nutrition-row.nutrition-sub { padding-left: 1rem; color: var(--text-muted); font-size: 0.8rem; }

.nutrition-preview {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}

.preview-val { font-size: 1.1rem; font-weight: 700; }
.preview-lbl { font-size: 0.7rem; color: var(--text-muted); }

/* ─── Training ──────────────────────────────────────────── */
.exercise-card { position: relative; overflow: hidden; }
.exercise-muscle-badge {
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-chest     { background: rgba(248,81,73,0.15);  color: var(--red);    border-bottom: 1px solid var(--border); }
.badge-back      { background: rgba(67,97,238,0.15);  color: var(--blue);   border-bottom: 1px solid var(--border); }
.badge-shoulders { background: rgba(188,140,255,0.15);color: var(--purple); border-bottom: 1px solid var(--border); }
.badge-biceps    { background: rgba(63,185,80,0.15);  color: var(--green);  border-bottom: 1px solid var(--border); }
.badge-triceps   { background: rgba(76,201,240,0.15); color: var(--cyan);   border-bottom: 1px solid var(--border); }
.badge-legs      { background: rgba(255,107,53,0.15); color: var(--accent); border-bottom: 1px solid var(--border); }
.badge-glutes    { background: rgba(227,179,65,0.15); color: var(--yellow); border-bottom: 1px solid var(--border); }
.badge-core      { background: rgba(63,185,80,0.15);  color: var(--green);  border-bottom: 1px solid var(--border); }
.badge-cardio    { background: rgba(248,81,73,0.15);  color: var(--red);    border-bottom: 1px solid var(--border); }
.badge-full_body { background: rgba(67,97,238,0.15);  color: var(--blue);   border-bottom: 1px solid var(--border); }
.badge-other     { background: rgba(255,255,255,0.06);color: var(--text-muted); border-bottom: 1px solid var(--border); }

.set-number-badge {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.stat-mini-val { font-size: 1.3rem; font-weight: 700; }
.stat-mini-lbl { font-size: 0.75rem; color: var(--text-muted); }

.gym-info {
  background: rgba(67,97,238,0.1);
  border: 1px solid rgba(67,97,238,0.3);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ─── Medications ───────────────────────────────────────── */
.med-log-card { transition: all 0.2s; }
.med-taken  { border-color: rgba(63,185,80,0.3);  background: rgba(63,185,80,0.05); }
.med-skipped{ border-color: rgba(255,255,255,0.1); opacity: 0.7; }

.med-status-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.med-icon-taken   { background: rgba(63,185,80,0.15);  color: var(--green); }
.med-icon-skipped { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.med-icon-pending { background: rgba(248,81,73,0.15);  color: var(--red); }

/* ─── Profile ───────────────────────────────────────────── */
.profile-avatar, .profile-avatar-placeholder {
  width: 96px; height: 96px;
  border-radius: 50%;
  margin: 0 auto;
  display: block;
}

.profile-avatar { object-fit: cover; border: 3px solid var(--border); }
.profile-avatar-placeholder {
  background: linear-gradient(135deg, var(--blue), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #fff;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0;
}

.profile-stat {
  text-align: center;
}

.profile-stat strong { display: block; font-size: 1.1rem; }
.profile-stat span   { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Progress Photos ───────────────────────────────────── */
.progress-photo-card { overflow: hidden; }
.progress-photo-img  { width: 100%; height: 200px; object-fit: cover; }
.progress-photo-info { padding: 0.75rem; }

/* ─── Hero Section ──────────────────────────────────────── */
.hero-section {
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  padding: 0 2rem;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.12;
}

.shape-1 { width: 500px; height: 500px; background: var(--accent); top: -100px; right: -100px; }
.shape-2 { width: 400px; height: 400px; background: var(--blue);   bottom: -50px; left: -50px; }
.shape-3 { width: 300px; height: 300px; background: var(--purple); top: 40%;  right: 30%; }

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,107,53,0.1);
  border: 1px solid rgba(255,107,53,0.3);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-stats {
  display: flex;
  gap: 2rem;
}

.hero-stat { text-align: center; }
.stat-num  { display: block; font-size: 1.5rem; font-weight: 800; }
.stat-label{ display: block; font-size: 0.75rem; color: var(--text-muted); }

.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Feature Cards Grid */
.hero-visual { position: relative; z-index: 1; }

.feature-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.3s, border-color 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.feature-card-1 { animation: float 4s ease-in-out infinite; }
.feature-card-2 { animation: float 4s ease-in-out infinite 1s; }
.feature-card-3 { animation: float 4s ease-in-out infinite 2s; }
.feature-card-4 { animation: float 4s ease-in-out infinite 3s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ─── Empty States ──────────────────────────────────────── */
.empty-state { color: var(--text-muted); }
.empty-state h5 { color: var(--text-primary); }

/* ─── Date Nav ──────────────────────────────────────────── */
.date-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* ─── Misc ──────────────────────────────────────────────── */
.x-small { font-size: 0.7rem; }
.py-6 { padding-top: 4rem; padding-bottom: 4rem; }

.feature-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

.feature-primary { background: rgba(67,97,238,0.15);  color: var(--blue); }
.feature-success { background: rgba(63,185,80,0.15);  color: var(--green); }
.feature-warning { background: rgba(227,179,65,0.15); color: var(--yellow); }
.feature-danger  { background: rgba(248,81,73,0.15);  color: var(--red); }
.feature-info    { background: rgba(76,201,240,0.15); color: var(--cyan); }
.feature-purple  { background: rgba(188,140,255,0.15);color: var(--purple); }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .gym-main { padding: 1rem 0; }
  .hero-section { padding: 0 1rem; }
  .hero-title { font-size: 2rem; }
  .page-header { flex-direction: column; }
  .feature-cards-grid { grid-template-columns: 1fr; }
}
