/* ============================================
   AK FITNESS — DESIGN SYSTEM
   Premium Dark Theme with Neon Green Accents
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Backgrounds */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a24;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);

  /* Borders */
  --border-subtle: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --border-glow: rgba(0,255,136,0.3);

  /* Accent Colors */
  --accent-green: #00ff88;
  --accent-green-dim: #00cc6a;
  --accent-green-glow: rgba(0,255,136,0.15);
  --accent-green-soft: rgba(0,255,136,0.08);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168,85,247,0.15);
  --accent-blue: #3b82f6;
  --accent-orange: #f97316;

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #9999aa;
  --text-muted: #555566;

  /* Status */
  --danger: #ff4466;
  --danger-glow: rgba(255,68,102,0.15);
  --warning: #ffaa00;
  --success: #00ff88;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radii — Asymmetric Geometry */
  --radius-sm: 6px 2px 6px 2px;
  --radius-md: 10px 3px 10px 3px;
  --radius-lg: 16px 4px 16px 4px;
  --radius-xl: 20px 6px 20px 6px;
  --radius-card: 16px 4px 16px 4px;
  --radius-card-alt: 4px 16px 4px 16px;
  --radius-btn: 12px 3px 12px 3px;
  --radius-input: 8px 2px 8px 2px;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Shadows — Smooth */
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.2);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.3);
  --shadow-elevated: 0 24px 48px rgba(0,255,136,0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-indices */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-nav: 30;
  --z-modal: 40;
  --z-toast: 50;

  /* Layout */
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --bottomnav-height: 72px;
}

/* --- CSS Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
::selection { background: var(--accent-green); color: var(--bg-primary); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-green); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); color: var(--text-primary); font-weight: 700; line-height: 1.2; }
.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-green); }
.text-uppercase { text-transform: uppercase; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.letter-wide { letter-spacing: 1.5px; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-lg); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none !important; }
.block { display: block; }
.overflow-hidden { overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Card Component --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--border-hover);
}
.card-glass {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-card);
  padding: 20px;
}
.card-interactive:hover {
  transform: translateY(-4px);
  border-color: var(--accent-green);
  box-shadow: var(--shadow-md);
}
.card-glow {
  border: 2px solid var(--accent-green);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  outline: none;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 2px; }
.btn-primary {
  background: var(--accent-green);
  color: #000;
  border: 1px solid var(--accent-green);
  box-shadow: 0 4px 16px rgba(0,255,136,0.2);
  transform: translateY(0);
}
.btn-primary:hover {
  background: var(--accent-green-dim);
  border-color: var(--accent-green-dim);
  box-shadow: 0 6px 20px rgba(0,255,136,0.3);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-ghost {
  background: rgba(0,255,136,0.05);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  box-shadow: none;
  transform: translateY(0);
}
.btn-ghost:hover {
  background: rgba(0,255,136,0.15);
  transform: translateY(-2px);
}
.btn-ghost:active { transform: translateY(0); box-shadow: none; }
.btn-danger {
  background: var(--danger);
  color: white;
  border: 1px solid var(--danger);
  box-shadow: 0 4px 16px rgba(255,68,102,0.2);
  transform: translateY(0);
}
.btn-danger:hover { background: #e63d5c; transform: translateY(-2px); }
.btn-danger:active { transform: translateY(0); box-shadow: none; }
.btn-sm { padding: 8px 18px; font-size: var(--text-xs); }
.btn-lg { padding: 16px 36px; font-size: var(--text-base); }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.btn-icon:hover { color: var(--accent-green); border-color: var(--accent-green); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,255,136,0.15); }
.btn-icon:active { transform: translateY(0); box-shadow: none; }
.btn-block { width: 100%; }

/* --- Form Inputs --- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: all 0.2s ease;
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(0,255,136,0.15);
  transform: translateY(0);
}
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: var(--text-xs); color: var(--text-muted); }
.form-error-text { font-size: var(--text-xs); color: var(--danger); }
.form-input.error { border-color: var(--danger); }
.input-icon-wrapper { position: relative; }
.input-icon-wrapper .form-input { padding-left: 42px; }
.input-icon-wrapper .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); width: 18px; height: 18px; pointer-events: none;
}
.input-icon-wrapper .input-action {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); cursor: pointer; background: none; border: none; padding: 4px;
}
.input-icon-wrapper .input-action:hover { color: var(--text-primary); }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green { background: var(--accent-green-glow); color: var(--accent-green); }
.badge-purple { background: var(--accent-purple-glow); color: var(--accent-purple); }
.badge-danger { background: var(--danger-glow); color: var(--danger); }
.badge-muted { background: rgba(85,85,102,0.2); color: var(--text-muted); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-orange { background: rgba(249,115,22,0.15); color: var(--accent-orange); }

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 6px 2px 6px 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 6px 2px 6px 2px;
  transition: width 0.6s ease;
}
.progress-segmented {
  display: flex;
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: 6px 2px 6px 2px;
  overflow: hidden;
  gap: 2px;
}
.progress-segment {
  height: 100%;
  transition: width 0.6s ease;
  border-radius: 6px 2px 6px 2px;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 10px; width: 80%; }
.skeleton-text.short { width: 50%; }
.skeleton-title { height: 24px; margin-bottom: 16px; width: 60%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card { height: 140px; border-radius: var(--radius-lg); margin-bottom: 16px; }
.skeleton-chart { height: 200px; border-radius: var(--radius-lg); }

/* --- Navigation: Sidebar (Desktop) --- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  z-index: var(--z-nav);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base);
}
.sidebar-logo { height: 36px; margin-bottom: var(--space-2xl); }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  border-radius: 10px 4px 10px 4px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.sidebar-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.sidebar-link.active { background: var(--accent-green-soft); color: var(--accent-green); }
.sidebar-link .icon { width: 20px; height: 20px; }
.sidebar-logout { margin-top: auto; }

/* --- Navigation: Top Bar --- */
.topbar {
  position: fixed;
  top: 0; right: 0;
  left: var(--sidebar-width);
  height: var(--topbar-height);
  background: rgba(17,17,24,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  z-index: var(--z-nav);
}
.topbar-title { font-family: var(--font-heading); font-weight: 600; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-md); }
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-green-glow);
  color: var(--accent-green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
}
.notification-btn { position: relative; }
.notification-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

/* --- Navigation: Bottom Tab Bar (Mobile) --- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-height);
  background: rgba(17,17,24,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  display: none;
  justify-content: space-around;
  align-items: center;
  padding: 0 var(--space-sm);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: var(--z-nav);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color var(--transition-fast);
  text-decoration: none;
}
.bottom-nav-item .icon { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--accent-green); }

/* --- Main Content Area --- */
.app-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
}
.app-shell { display: none; }
.app-shell.visible { display: block; }

/* --- Tooltip --- */
.tooltip { position: relative; display: inline-flex; }
.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px 3px 6px 3px;
  font-size: var(--text-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-dropdown);
}
.tooltip-content::after {
  content: ''; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-tertiary);
}
.tooltip:hover .tooltip-content { opacity: 1; }

/* --- Modal Overlay --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay .modal, .modal-overlay .pricing-card {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px 4px 10px 4px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  min-width: 280px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
}
.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--accent-blue); }
.toast.removing { animation: slideOutRight 0.3s ease forwards; }

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  width: 44px; height: 24px;
  background: var(--bg-tertiary);
  border-radius: 12px 4px 12px 4px;
  cursor: pointer;
  transition: background var(--transition-base);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}
.toggle.active { background: var(--accent-green); border-color: var(--accent-green); }
.toggle::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: white;
  border-radius: 8px 3px 8px 3px;
  top: 1px; left: 2px;
  transition: transform var(--transition-base);
}
.toggle.active::after { transform: translateX(20px); }

/* --- Keyframe Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes neonPulse {
  0%, 100% { border-color: var(--accent-green); }
  50% { border-color: var(--accent-green-dim); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes borderRotate {
  to { --border-angle: 360deg; }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* --- Spinner --- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: var(--bg-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .topbar { left: 0; }
  .app-content { margin-left: 0; padding-bottom: var(--bottomnav-height); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 var(--space-md); }
  .toast-container { top: auto; bottom: calc(var(--bottomnav-height) + 12px); right: 12px; left: 12px; }
  .toast { min-width: auto; }
}
@media (max-width: 480px) {
  :root { --space-lg: 16px; --space-xl: 24px; }
}
@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
  .sidebar { display: flex; }
}

/* --- Focus / Accessibility --- */
*:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Page Transitions --- */
.page-enter { animation: fadeInUp 0.35s ease forwards; }
.page-exit { animation: fadeIn 0.2s ease reverse forwards; }
