/* ============================================================
   SPORT PULSE — shared.css
   ============================================================ */

:root {
  /* DataForme — black + electric green identity */
  --navy:    #0A0A0A;          /* historic name kept for backwards-compat; now near-black */
  --red:     #00E676;          /* historic name kept for backwards-compat; now electric green */
  --gold:    #f5b400;
  --green:   #1a7a45;
  --orange:  #e07b20;
  --blue:    #1d4ed8;
  --surface: #ffffff;
  --surface2:#f4f4f5;
  --muted:   #6b7280;
  --border:  rgba(10,10,10,0.10);
  --shadow:  0 2px 12px rgba(10,10,10,0.08);
  --radius:  12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface2);
  color: var(--navy);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ---- HEADER ---- */
.app-header {
  background: var(--navy);
  border-bottom: 3px solid var(--red);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 10px; }

.logo-badge {
  background: #0A0A0A;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  padding: 2px;
  border: 1px solid rgba(255,255,255,0.15);
}

.header-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.header-sub {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  margin-top: 1px;
}

.back-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.logout-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s;
}
.logout-btn:hover { background: rgba(255,255,255,0.2); }

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--navy);
  border-top: 3px solid var(--red);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  transition: color .15s;
}

.nav-item.active, .nav-item:hover { color: var(--red); }

.nav-icon { font-size: 18px; line-height: 1; }

/* ---- MAIN CONTENT ---- */
.page-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

/* ---- SECTION LABEL ---- */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 20px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 4px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.tab-btn.active {
  background: var(--navy);
  color: #fff;
}

/* ---- FORM ELEMENTS ---- */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  background: #f7f9fc;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--navy);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  background: #fff;
}

textarea { resize: vertical; min-height: 80px; }

/* ---- RANGE SLIDER (Wellness/RPE) ---- */
.slider-group { margin-bottom: 20px; }

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.slider-label { font-size: 14px; font-weight: 600; color: var(--navy); }

.slider-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
  min-width: 32px;
  text-align: center;
}

.slider-desc {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
  min-height: 16px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--surface2);
  outline: none;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,230,118,0.45);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid #fff;
  cursor: pointer;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); opacity: .9; }

.btn-primary   { background: var(--red);   color: #0A0A0A; width: 100%; font-weight: 800; }
.btn-secondary { background: var(--navy);  color: #fff; }
.btn-ghost     { background: var(--surface2); color: var(--navy); }
.btn-gold      { background: var(--gold);  color: #0A0A0A; }
.btn-green     { background: var(--green); color: #fff; }
.btn-danger    { background: #fee2e2; color: #991b1b; }

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 7px; }
.btn-full { width: 100%; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-green  { background: #dcfce7; color: #166534; }
.badge-orange { background: #fff7ed; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-muted  { background: var(--surface2); color: var(--muted); }

/* ---- ROLE PILLS ---- */
.role-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 1px 6px;
  border-radius: 4px;
}
.role-admin  { background: #7c3aed; color: #fff; }
.role-coach  { background: var(--navy); color: #fff; }
.role-joueur { background: var(--red); color: #0A0A0A; }

/* ---- STAT CARDS ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- LIST ITEMS ---- */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.list-item:last-child { border-bottom: none; }

.list-item-left { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 38px; height: 38px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.item-name  { font-size: 14px; font-weight: 600; color: var(--navy); }
.item-sub   { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: #dbeafe; color: #1e40af; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-warning { background: #fff7ed; color: #92400e; }
.alert-error   { background: #fee2e2; color: #991b1b; }

/* ---- NOTIFICATION BANNER ---- */
.notif-banner {
  background: linear-gradient(135deg, var(--navy), #1a3a6e);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-banner-icon { font-size: 24px; }
.notif-banner-text { flex: 1; font-size: 13px; line-height: 1.4; }
.notif-banner-text strong { display: block; font-size: 14px; margin-bottom: 2px; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13,31,60,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.modal {
  background: var(--surface);
  border-radius: 20px 20px 16px 16px;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  animation: slideUp .2s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
}

/* ---- LOADING ---- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 20px; height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; line-height: 1.5; }

/* ---- TOAST ---- */
#toast {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: all .25s;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- CHART CONTAINER ---- */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

/* ---- SCORE DISPLAY ---- */
.score-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  border: 4px solid currentColor;
}
.score-circle .score-num  { font-size: 24px; font-weight: 800; line-height: 1; }
.score-circle .score-max  { font-size: 10px; opacity: .7; }

/* ---- RPE SCALE ---- */
.rpe-scale {
  display: flex;
  gap: 3px;
  margin: 8px 0;
}
.rpe-pip {
  flex: 1; height: 8px;
  border-radius: 2px;
  background: var(--surface2);
  transition: background .15s;
}

/* ---- RESPONSIVE ---- */
@media (min-width: 500px) {
  .page-content { padding: 20px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
