/* ===================================================
   FitPro - Fitness App CSS
   RTL Arabic Design | Material Design Inspired
   =================================================== */

:root {
  --primary: #2196F3;
  --primary-dark: #1565C0;
  --primary-light: #BBDEFB;
  --secondary: #4CAF50;
  --secondary-dark: #2E7D32;
  --secondary-light: #C8E6C9;
  --accent: #FF6B35;
  --accent-light: #FFE0D3;
  --purple: #9C27B0;
  --purple-light: #E1BEE7;
  --orange: #FF9800;
  --orange-light: #FFE0B2;
  --warning: #FFC107;
  --danger: #F44336;
  --danger-light: #FFCDD2;

  --bg: #F0F4FF;
  --surface: #FFFFFF;
  --surface-2: #F8FAFF;
  --border: #E3EAF5;
  --text-primary: #1A2340;
  --text-secondary: #546E7A;
  --text-muted: #90A4AE;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(33,150,243,0.1);
  --shadow-lg: 0 8px 32px rgba(33,150,243,0.18);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { border: none; outline: none; cursor: pointer; font-family: 'Cairo', sans-serif; }
input, select, textarea { font-family: 'Cairo', sans-serif; }

/* ===== SPLASH SCREEN ===== */
#splash-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1565C0 0%, #2196F3 50%, #4CAF50 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#splash-screen.fade-out { opacity: 0; visibility: hidden; }

.splash-content { text-align: center; color: white; }

.splash-logo {
  font-size: 80px;
  margin-bottom: 20px;
  animation: pulse 1.5s infinite ease-in-out;
}

.splash-title {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.splash-subtitle {
  font-size: 18px;
  opacity: 0.85;
  margin-bottom: 40px;
}

.splash-loader {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: white;
  border-radius: 2px;
  animation: loadBar 2s ease forwards;
}

@keyframes loadBar {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== HIDDEN UTIL ===== */
.hidden { display: none !important; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #1565C0 0%, #1976D2 40%, #2196F3 100%);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateX(0);
  transition: transform var(--transition);
  box-shadow: -4px 0 24px rgba(21,101,192,0.3);
}

.sidebar.collapsed { transform: translateX(100%); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.logo-area { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 26px; }
.logo-text { font-size: 22px; font-weight: 900; letter-spacing: 1px; }

.sidebar-close-btn {
  background: rgba(255,255,255,0.15);
  color: white;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}

.sidebar-close-btn:hover { background: rgba(255,255,255,0.25); }

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.1);
  margin: 12px 12px 8px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.user-name { font-size: 15px; font-weight: 700; display: block; }
.user-level { font-size: 12px; opacity: 0.8; display: block; margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.22);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.nav-icon { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-export, .btn-import {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--transition);
}

.btn-export {
  background: rgba(76,175,80,0.3);
  color: #A5D6A7;
  border: 1px solid rgba(76,175,80,0.4);
}

.btn-export:hover { background: rgba(76,175,80,0.5); color: white; }

.btn-import {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-import:hover { background: rgba(255,255,255,0.2); color: white; }

/* ===== OVERLAY ===== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  transition: margin var(--transition);
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(33,150,243,0.06);
}

.menu-btn {
  background: var(--bg);
  color: var(--primary);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.menu-btn:hover { background: var(--primary); color: white; }

.topbar-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.streak-badge {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #FF6B35, #FF9800);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.streak-badge i { color: #FFD54F; }

.date-badge {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ===== PAGES ===== */
.pages-container { flex: 1; }

.page { display: none; }
.page.active { display: block; }

.page-content {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 16px;
}

.section-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h3 i { color: var(--primary); }

/* ===== HERO CARD ===== */
.hero-card {
  background: linear-gradient(135deg, #1565C0 0%, #2196F3 60%, #42A5F5 100%);
  border-radius: var(--radius);
  padding: 28px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -40px; left: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}

.hero-greeting {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 6px;
}

.hero-subtitle { font-size: 14px; opacity: 0.85; margin-bottom: 20px; }

.hero-stats { display: flex; gap: 24px; }

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

.stat-val {
  display: block;
  font-size: 26px;
  font-weight: 900;
}

.stat-lbl {
  display: block;
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}

.hero-icon-big {
  font-size: 72px;
  opacity: 0.25;
  flex-shrink: 0;
}

/* ===== TODAY CARD ===== */
.today-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.today-card-header {
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.today-card-header h3 { font-size: 17px; font-weight: 800; }

.day-badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.today-exercises-list { padding: 16px 20px; }

.today-exercise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

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

.ex-dot {
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.ex-name { font-weight: 700; flex: 1; }
.ex-sets { color: var(--text-secondary); font-size: 13px; }

.start-workout-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #42A5F5);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(33,150,243,0.4);
}

.start-workout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33,150,243,0.5);
}

.rest-day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--text-secondary);
}

.rest-day-card i { font-size: 50px; color: var(--secondary); }
.rest-day-card h3 { font-size: 20px; color: var(--text-primary); }
.rest-day-card p { text-align: center; font-size: 14px; }

/* ===== QUICK STATS ===== */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; left: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--secondary); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.purple::before { background: var(--purple); }

.stat-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.stat-card.blue .stat-card-icon { color: var(--primary); }
.stat-card.green .stat-card-icon { color: var(--secondary); }
.stat-card.orange .stat-card-icon { color: var(--orange); }
.stat-card.purple .stat-card-icon { color: var(--purple); }

.stat-card-body {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.stat-card-val {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
}

.stat-card-unit {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.stat-card-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.water-quick-btns {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.water-btn {
  flex: 1;
  padding: 6px;
  background: var(--purple-light);
  color: var(--purple);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  transition: all var(--transition);
}

.water-btn:hover { background: var(--purple); color: white; }

/* ===== WEEKLY PROGRESS ===== */
.weekly-progress-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.week-days {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.week-day-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.week-day-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
  background: var(--surface-2);
}

.week-day-circle.done {
  background: linear-gradient(135deg, var(--secondary), #66BB6A);
  border-color: var(--secondary);
  color: white;
}

.week-day-circle.today {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.week-day-circle.rest {
  background: var(--orange-light);
  border-color: var(--orange);
}

.week-day-name {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
}

.weekly-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weekly-bar-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }

.weekly-bar-track {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.weekly-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), #66BB6A);
  border-radius: 5px;
  transition: width 0.8s ease;
  width: 0%;
}

.weekly-bar-pct {
  font-size: 14px;
  font-weight: 800;
  color: var(--secondary);
  min-width: 40px;
  text-align: left;
}

/* ===== DAY TABS ===== */
.day-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.day-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.day-tab i { font-size: 20px; margin-bottom: 4px; }
.day-tab small { font-size: 11px; font-weight: 600; opacity: 0.7; }

.day-tab:hover { border-color: var(--primary); color: var(--primary); }

.day-tab.active {
  background: linear-gradient(135deg, var(--primary), #42A5F5);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 15px rgba(33,150,243,0.35);
}

.day-tab.active small { opacity: 0.9; }

/* ===== WORKOUT DAY CONTENT ===== */
.workout-day-content {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.workout-day-header {
  background: linear-gradient(135deg, #1565C0, #2196F3);
  color: white;
  padding: 20px 24px;
}

.workout-day-header h2 { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.workout-day-header p { font-size: 13px; opacity: 0.85; }

.workout-day-meta {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.workout-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: rgba(255,255,255,0.15);
  padding: 5px 10px;
  border-radius: 20px;
}

/* ===== EXERCISE CARD ===== */
.exercise-cards-list { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.exercise-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
}

.exercise-card:hover { border-color: var(--primary-light); box-shadow: 0 4px 16px rgba(33,150,243,0.12); }

.exercise-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
}

.ex-number {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #42A5F5);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  font-weight: 900;
  flex-shrink: 0;
}

.ex-info { flex: 1; }

.ex-arabic { font-size: 15px; font-weight: 800; color: var(--text-primary); }
.ex-english { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.ex-sets-info {
  text-align: center;
  background: var(--primary-light);
  padding: 6px 12px;
  border-radius: 8px;
}

.ex-sets-val { font-size: 16px; font-weight: 900; color: var(--primary); display: block; }
.ex-sets-lbl { font-size: 10px; color: var(--primary); font-weight: 600; }

.ex-detail-btn {
  width: 34px; height: 34px;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 14px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.ex-detail-btn:hover { background: var(--primary); color: white; }

/* Exercise Expand Panel */
.ex-expand-panel {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: white;
}

.ex-expand-panel.open { display: block; }

.ex-expand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.ex-expand-section h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ex-expand-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ex-expand-section ul li {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}

.ex-expand-section ul li::before {
  content: '✓';
  color: var(--secondary);
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 1px;
}

.muscles-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.muscle-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.muscle-tag.secondary {
  background: var(--secondary-light);
  color: var(--secondary-dark);
}

.complete-set-area {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.sets-tracker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.set-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.set-btn.done {
  background: linear-gradient(135deg, var(--secondary), #66BB6A);
  border-color: transparent;
  color: white;
}

.set-btn:hover:not(.done) { border-color: var(--primary); color: var(--primary); }

.weight-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.weight-input-row input {
  width: 80px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}

.weight-input-row input:focus { border-color: var(--primary); }

/* ===== CHART CARD ===== */
.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

/* ===== MEASUREMENTS ===== */
.measurements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.meas-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}

.meas-icon { font-size: 28px; margin-bottom: 8px; }
.meas-val { font-size: 28px; font-weight: 900; color: var(--text-primary); }
.meas-unit { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.meas-name { font-size: 13px; color: var(--text-secondary); font-weight: 700; margin-top: 4px; }
.meas-change { font-size: 12px; font-weight: 700; margin-top: 4px; }
.meas-change.up { color: var(--secondary); }
.meas-change.down { color: var(--danger); }

/* ===== HISTORY LIST ===== */
.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.history-info { flex: 1; }
.history-name { font-size: 15px; font-weight: 700; }
.history-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.history-stats { text-align: left; }
.history-completion { font-size: 16px; font-weight: 900; color: var(--secondary); }
.history-exercises { font-size: 11px; color: var(--text-muted); }

/* ===== PR GRID ===== */
.pr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.pr-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.pr-medal {
  font-size: 28px;
  flex-shrink: 0;
}

.pr-exercise { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.pr-weight { font-size: 20px; font-weight: 900; color: var(--primary); }
.pr-unit { font-size: 12px; color: var(--text-muted); }

/* ===== NUTRITION HERO ===== */
.nutrition-hero {
  display: flex;
  background: linear-gradient(135deg, #4CAF50, #66BB6A);
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  margin-bottom: 8px;
  box-shadow: 0 4px 20px rgba(76,175,80,0.3);
}

.nutrition-hero-item {
  flex: 1;
  text-align: center;
}

.nut-val { font-size: 30px; font-weight: 900; display: block; }
.nut-lbl { font-size: 12px; opacity: 0.85; display: block; margin-top: 4px; font-weight: 600; }

.nutrition-hero-divider {
  width: 1px;
  background: rgba(255,255,255,0.3);
  margin: 0 8px;
}

/* ===== MACROS PROGRESS ===== */
.macros-progress-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.macro-row {}

.macro-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.macro-name { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.macro-name i { color: var(--primary); }
.macro-numbers { font-size: 13px; color: var(--text-secondary); font-weight: 600; }

.macro-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.macro-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  width: 0%;
}

.calories-fill { background: linear-gradient(90deg, #FF6B35, #FF9800); }
.protein-fill { background: linear-gradient(90deg, var(--primary), #42A5F5); }
.carbs-fill { background: linear-gradient(90deg, #FF9800, #FFD54F); }
.fats-fill { background: linear-gradient(90deg, var(--purple), #BA68C8); }

/* ===== WATER TRACKER ===== */
.water-tracker-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.water-visual {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.water-bottle {
  width: 80px;
  height: 150px;
  border: 3px solid var(--purple);
  border-radius: 0 0 20px 20px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.water-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, #7E57C2, #9C27B0);
  transition: height 0.8s ease;
  height: 0%;
  opacity: 0.7;
  border-radius: 0 0 16px 16px;
}

.water-amount-text {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  color: var(--purple);
  text-align: center;
}

.water-cups { flex: 1; }

#water-cups-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.water-cup {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface-2);
}

.water-cup.filled {
  background: var(--purple-light);
  border-color: var(--purple);
}

.water-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-water {
  flex: 1;
  min-width: 100px;
  padding: 10px;
  background: var(--purple-light);
  color: var(--purple);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--transition);
}

.btn-water:hover { background: var(--purple); color: white; }
.btn-water.red { background: var(--danger-light); color: var(--danger); }
.btn-water.red:hover { background: var(--danger); color: white; }

/* ===== MEALS LIST ===== */
.meals-list { display: flex; flex-direction: column; gap: 10px; }

.meal-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.meal-icon {
  width: 44px; height: 44px;
  background: var(--secondary-light);
  color: var(--secondary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.meal-info { flex: 1; }
.meal-name { font-size: 15px; font-weight: 700; }
.meal-macros { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.meal-cal { font-size: 18px; font-weight: 900; color: var(--accent); }

.meal-delete {
  background: var(--danger-light);
  color: var(--danger);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all var(--transition);
}

.meal-delete:hover { background: var(--danger); color: white; }

/* ===== NUTRITION TIPS ===== */
.nutrition-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tip-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.tip-icon {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 10px;
  display: block;
}

.tip-card h4 { font-size: 14px; font-weight: 800; margin-bottom: 6px; color: var(--text-primary); }
.tip-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* ===== ACHIEVEMENTS ===== */
.achievements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #FF9800, #FFB300);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: white;
  margin-bottom: 8px;
  box-shadow: 0 4px 20px rgba(255,152,0,0.3);
}

.ach-total { font-size: 36px; font-weight: 900; }
.ach-total small { font-size: 14px; opacity: 0.85; font-weight: 600; display: block; margin-top: 4px; }

.ach-level-badge {
  background: rgba(255,255,255,0.2);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 800;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.ach-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all var(--transition);
}

.ach-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.ach-card.unlocked {
  border-color: var(--warning);
  background: linear-gradient(135deg, #FFFDE7, #FFF8E1);
}

.ach-icon-wrap {
  font-size: 32px;
  flex-shrink: 0;
}

.ach-info {}
.ach-title { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.ach-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.ach-status-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.ach-status-badge.done { background: var(--secondary-light); color: var(--secondary-dark); }
.ach-status-badge.pending { background: var(--border); color: var(--text-muted); }

/* ===== CHALLENGES ===== */
.challenges-list { display: flex; flex-direction: column; gap: 12px; }

.challenge-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.challenge-icon { font-size: 32px; flex-shrink: 0; }
.challenge-info { flex: 1; }
.challenge-name { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.challenge-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }

.challenge-progress-wrap { display: flex; align-items: center; gap: 8px; }

.challenge-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.challenge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #42A5F5);
  border-radius: 3px;
  transition: width 0.8s ease;
}

.challenge-pct { font-size: 13px; font-weight: 800; color: var(--primary); min-width: 38px; text-align: left; }

/* ===== PROFILE ===== */
.profile-hero {
  text-align: center;
  padding: 32px 20px 24px;
  background: linear-gradient(135deg, var(--primary), #42A5F5);
  border-radius: var(--radius);
  color: white;
  margin-bottom: 8px;
  box-shadow: var(--shadow-lg);
}

.profile-avatar-big {
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.4);
}

.profile-name { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.profile-tagline { font-size: 14px; opacity: 0.85; }

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.profile-stat-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.profile-stat-icon { font-size: 22px; color: var(--primary); margin-bottom: 8px; }
.profile-stat-val { font-size: 20px; font-weight: 900; color: var(--text-primary); }
.profile-stat-unit { font-size: 12px; color: var(--text-muted); }
.profile-stat-name { font-size: 12px; color: var(--text-secondary); font-weight: 700; margin-top: 4px; display: block; }

.health-calcs-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.calc-item { text-align: center; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.calc-label { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.calc-value { font-size: 22px; font-weight: 900; color: var(--primary); }
.calc-unit { font-size: 12px; color: var(--text-secondary); }

.goals-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

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

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

.goal-icon { font-size: 22px; width: 36px; text-align: center; flex-shrink: 0; }
.goal-text { font-size: 14px; font-weight: 600; color: var(--text-primary); flex: 1; }
.goal-badge { background: var(--primary-light); color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.3s ease;
}

.modal-box.small-modal { max-width: 400px; }

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px; left: 16px;
  width: 34px; height: 34px;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.modal-close:hover { background: var(--danger); color: white; }

.modal-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.modal-form label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }

.modal-form input, .modal-form select {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
  background: var(--surface-2);
  width: 100%;
  direction: rtl;
}

.modal-form input:focus, .modal-form select:focus { border-color: var(--primary); }

/* Exercise Modal Specific */
.ex-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.ex-modal-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), #42A5F5);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: white;
  flex-shrink: 0;
}

.ex-modal-title { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.ex-modal-subtitle { font-size: 14px; color: var(--text-muted); }

.ex-modal-section { margin-bottom: 20px; }
.ex-modal-section h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-light);
}

.steps-list { counter-reset: step-counter; list-style: none; }
.steps-list li {
  counter-increment: step-counter;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.steps-list li::before {
  content: counter(step-counter);
  width: 26px; height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 1px;
}

.warnings-list li::before { content: '⚠️'; background: none; color: unset; }
.tips-list li::before { content: '💡'; background: none; color: unset; }

.variants-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.variant-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 13px;
}

.variant-card.beginner { border-color: var(--secondary); background: var(--secondary-light); }
.variant-card.advanced { border-color: var(--primary); background: var(--primary-light); }
.variant-card h5 { font-size: 12px; font-weight: 800; margin-bottom: 4px; }

/* ===== BUTTONS ===== */
.btn-add-small {
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}

.btn-add-small:hover { background: var(--primary); color: white; }

.btn-edit {
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}

.btn-edit:hover { background: var(--primary); color: white; }

.btn-primary-full {
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #42A5F5);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(33,150,243,0.35);
  margin-top: 4px;
}

.btn-primary-full:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(33,150,243,0.45); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1A2340;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 5000;
  animation: toastIn 0.3s ease;
}

.toast i { color: var(--secondary); }

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

/* ===== DATE LABEL ===== */
.date-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    width: 280px;
    transform: translateX(100%);
  }

  .sidebar.open { transform: translateX(0); }

  .main-wrapper { margin-right: 0; }

  .sidebar-close-btn { display: flex; }

  .quick-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .measurements-grid { grid-template-columns: repeat(2, 1fr); }
  .nutrition-tips-grid { grid-template-columns: 1fr; }
  .achievements-grid { grid-template-columns: 1fr; }
  .pr-grid { grid-template-columns: 1fr; }
  .day-tabs { grid-template-columns: repeat(2, 1fr); }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .health-calcs-card { grid-template-columns: 1fr; }
  .week-days { gap: 4px; }
  .week-day-circle { width: 34px; height: 34px; font-size: 13px; }
  .hero-card { flex-direction: column; }
  .hero-right { display: none; }
  .page-content { padding: 16px; }
  .ex-expand-grid { grid-template-columns: 1fr; }
  .variants-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .quick-stats-grid { grid-template-columns: 1fr 1fr; }
  .day-tabs { grid-template-columns: 1fr 1fr; }
  .topbar-title { font-size: 15px; }
  .date-badge { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.page.active .page-content > * {
  animation: fadeInUp 0.4s ease both;
}

.page.active .page-content > *:nth-child(2) { animation-delay: 0.05s; }
.page.active .page-content > *:nth-child(3) { animation-delay: 0.1s; }
.page.active .page-content > *:nth-child(4) { animation-delay: 0.15s; }
.page.active .page-content > *:nth-child(5) { animation-delay: 0.2s; }
