/* ═══════════════════════════════════════════
   Throttle Fitness — Design System Base
   CSS Variables, Reset, Typography
   ═══════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: var(--text-primary); background-color: var(--bg-primary); transition: background-color 0.3s ease, color 0.3s ease; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--text-primary); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.1rem; }
}

/* ── Light Theme (default) ── */
:root {
  --primary: #460082;
  --primary-dark: #2A004E;
  --primary-light: #6D00C9;
  --primary-rgb: 70, 0, 130;
  --primary-glow: rgba(70, 0, 130, 0.15);

  --bg-primary: #FCFCFD;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #F8FAFC;
  --bg-overlay: rgba(25, 15, 45, 0.5); /* Soft purple overlay */
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-primary: #2D1B36; /* Soft dark purple instead of slate */
  --text-secondary: #594A63; /* Soft medium purple-gray */
  --text-tertiary: #92839E;
  --text-inverse: #FFFFFF;

  --border: #E5DDEA; /* Soft purple tinted border */
  --border-light: #F3EEF6;
  --border-focus: var(--primary);

  --accent-gold: #F59E0B;
  --accent-green: #10B981;
  --accent-blue: #3B82F6;
  --accent-purple: #8B5CF6;

  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;

  --header-height: 72px;
  --container-max: 1200px;
  --sidebar-width: 240px;

  --space-page-top: 2.5rem;
  --space-section: 2rem;
  --space-heading-bottom: 1.5rem;

  /* ── Glassmorphism Tokens ── */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-heavy: rgba(255, 255, 255, 0.72);
  --glass-bg-light: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-border-subtle: rgba(255, 255, 255, 0.25);
  --glass-blur: blur(16px);
  --glass-blur-heavy: blur(24px);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.1);
  --glass-glow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --primary: #8533FF;
  --primary-dark: #460082;
  --primary-light: #B280FF;
  --primary-rgb: 133, 51, 255;
  --primary-glow: rgba(133, 51, 255, 0.2);

  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #334155;
  --bg-card: #1E293B;
  --bg-card-hover: #2A3B52;
  --bg-input: #0F172A;
  --bg-overlay: rgba(15, 23, 42, 0.7);
  --bg-glass: rgba(30, 41, 59, 0.75);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-inverse: #0F172A;

  --border: #334155;
  --border-light: #1E293B;
  --border-focus: var(--primary-light);

  --success-bg: #064E3B;
  --warning-bg: #78350F;
  --error-bg: #7F1D1D;
  --info-bg: #1E3A5F;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.35);

  /* ── Glassmorphism Tokens (Dark) ── */
  --glass-bg: rgba(30, 33, 48, 0.5);
  --glass-bg-heavy: rgba(30, 33, 48, 0.68);
  --glass-bg-light: rgba(30, 33, 48, 0.3);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-subtle: rgba(255, 255, 255, 0.04);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.3);
  --glass-glow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Typography Scale ── */
.text-xs { font-size: 0.7rem; }
.text-sm { font-size: 0.8125rem; }
.text-base { font-size: 0.9375rem; }
.text-lg { font-size: 1.05rem; }
.text-xl { font-size: 1.15rem; }
.text-2xl { font-size: 1.35rem; }
.text-3xl { font-size: 1.65rem; }
.text-4xl { font-size: 2rem; }
.text-5xl { font-size: 2.75rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-primary-color { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

/* ── Container ── */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 640px; }
.container-lg { max-width: 1400px; }

/* ── Section spacing ── */
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes glassReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-slide-up { animation: slideInUp 0.6s ease forwards; }
.animate-glass-reveal { animation: glassReveal 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Avatar / Profile Photo Hover System ── */
:root {
  --avatar-glow: 0 0 0 4px rgba(var(--primary-rgb), 0.15), 0 6px 20px rgba(var(--primary-rgb), 0.12);
  --avatar-transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
[data-theme="dark"] {
  --avatar-glow: 0 0 0 4px rgba(var(--primary-rgb), 0.2), 0 6px 24px rgba(var(--primary-rgb), 0.18);
}

/* Global avatar hover — targets all avatar/profile image containers */
.dash-sidebar-avatar,
.dash-avatar-btn,
.dash-welcome-avatar,
.user-sidebar-avatar,
.user-welcome-avatar,
.user-sidebar-initial,
.trainer-avatar-img,
.trainer-avatar-initial,
.testimonial-avatar,
.tp-photo,
.avatar-xl,
.edit-profile-photo-section .avatar {
  transition: var(--avatar-transition);
}

.dash-sidebar-avatar:hover,
.dash-avatar-btn:hover,
.dash-welcome-avatar:hover,
.user-sidebar-avatar:hover,
.user-welcome-avatar:hover,
.user-sidebar-initial:hover,
.trainer-avatar-img:hover,
.trainer-avatar-initial:hover,
.testimonial-avatar:hover,
.tp-photo:hover,
.avatar-xl:hover,
.edit-profile-photo-section .avatar:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: var(--avatar-glow);
  border-color: var(--primary);
}

/* ── Selection ── */
::selection { background: var(--primary); color: #fff; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Glass Utility Classes ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-glow);
}
.glass-heavy {
  background: var(--glass-bg-heavy);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-glow);
}

/* ── Centered Page Heading Utility ── */
.page-heading-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.5rem;
}
.page-heading-centered .page-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.page-heading-centered .text-muted {
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Page Content Centered Headers (public pages) ── */
.page-content h1,
.page-content h2 {
  text-align: center;
}
.page-content h1 {
  margin-bottom: 2rem;
}
