/* =====================================================
   WORKOUT FITNESS CENTER - GymAPP
   Global Design System & CSS Variables
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────── */
:root {
  --bg-primary:     #0a0a0a;
  --bg-secondary:   #111111;
  --bg-card:        #161616;
  --bg-card-hover:  #1c1c1c;
  --bg-input:       #1a1a1a;
  --bg-glass:       rgba(255, 255, 255, 0.03);

  --accent:         #e8321a;
  --accent-dark:    #c42615;
  --accent-light:   #ff4d34;
  --accent-glow:    rgba(232, 50, 26, 0.25);
  --accent-glow-lg: rgba(232, 50, 26, 0.12);

  --text-primary:   #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted:     #555555;

  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(255, 255, 255, 0.14);
  --border-accent:  rgba(232, 50, 26, 0.5);

  --success:        #22c55e;
  --warning:        #f59e0b;
  --error:          #ef4444;
  --info:           #3b82f6;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-red:  0 0 40px rgba(232, 50, 26, 0.15);
  --shadow-glow: 0 0 20px rgba(232, 50, 26, 0.35);

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

  --sidebar-w: 260px;
  --header-h:  64px;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }

/* ── Typography ────────────────────────────────── */
.font-bebas   { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.05em; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; }

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow-lg);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ── Form Inputs ───────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-card); }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-error   { background: rgba(239, 68, 68, 0.15);  color: var(--error);   border: 1px solid rgba(239,68,68,0.3); }
.badge-info    { background: rgba(59, 130, 246, 0.15); color: var(--info);    border: 1px solid rgba(59,130,246,0.3); }
.badge-accent  { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--border-accent); }

/* ── Tables ─────────────────────────────────────── */
.gym-table {
  width: 100%;
  border-collapse: collapse;
}
.gym-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.gym-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.gym-table tbody tr:hover { background: var(--bg-glass); }
.gym-table tbody tr:last-child td { border-bottom: none; }

/* ── Notification ───────────────────────────────── */
.gym-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  transform: translateY(80px);
  opacity: 0;
  transition: var(--transition);
  max-width: 340px;
}
.gym-notification--show { transform: translateY(0); opacity: 1; }
.gym-notification--success { border-color: rgba(34,197,94,0.4); }
.gym-notification--error   { border-color: rgba(239,68,68,0.4); }
.gym-notification--warning { border-color: rgba(245,158,11,0.4); }
.gym-notification__icon { font-size: 1.1rem; }

/* ── Dashboard Layout ───────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { height: 40px; width: auto; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
}
.sidebar-link:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}
.sidebar-link .icon { font-size: 1.2rem; min-width: 20px; text-align: center; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 32px;
}
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
}
.page-subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-top: 4px; }

/* ── Stats Grid ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-glow-lg);
  border: 1px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-info {}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

/* ── Tabs ───────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 20px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: none;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-glass); }
.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--border);
  border-bottom-color: var(--bg-card);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Avatar ─────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-sm  { width: 36px; height: 36px; }
.avatar-md  { width: 52px; height: 52px; }
.avatar-lg  { width: 80px; height: 80px; }
.avatar-xl  { width: 120px; height: 120px; border: 3px solid var(--accent); }
.avatar-placeholder {
  background: linear-gradient(135deg, var(--accent-glow), var(--bg-card));
  border: 2px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent); font-size: 1.2rem;
}

/* ── Progress Bar ────────────────────────────────── */
.progress-bar {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 1.25rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}
.modal-close:hover { background: var(--border-hover); color: var(--text-primary); }

/* ── Utility Classes ─────────────────────────────── */
.text-accent    { color: var(--accent) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-error     { color: var(--error) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.gap-16         { gap: 16px; }
.gap-24         { gap: 24px; }
.mt-8           { margin-top: 8px; }
.mt-12          { margin-top: 12px; }
.mt-16          { margin-top: 16px; }
.mt-24          { margin-top: 24px; }
.mb-8           { margin-bottom: 8px; }
.mb-16          { margin-bottom: 16px; }
.mb-24          { margin-bottom: 24px; }
.w-full         { width: 100%; }
.hidden         { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

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

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ── Glow Divider ────────────────────────────────── */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 24px 0;
}

/* ── Skeleton Loader ─────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% center; } }

/* ── Section Label ─────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── Toggle Switch ─────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-hover);
  border-radius: 12px;
  transition: var(--transition);
  cursor: pointer;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ── Sidebar overlay for mobile ─────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }
