/* ===== CARDS — Benfica style ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-title {
  font-family: 'Roboto', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.card-value {
  font-size: 30px; font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.card-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
  margin-top: 6px;
}
.card-delta.up { background: var(--green-dim); color: var(--green); }
.card-delta.down { background: var(--red-dim); color: var(--red); }
.card-delta.neutral { background: var(--bg-soft); color: var(--text-muted); }
.card-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.card-icon.blue { background: var(--blue-glow); color: var(--blue-primary); }
.card-icon.gold { background: var(--gold-dim); color: var(--gold); }
.card-icon.green { background: var(--green-dim); color: var(--green); }
.card-icon.red { background: var(--red-dim); color: var(--red); }
.card-icon.purple { background: var(--purple-dim); color: var(--purple); }
.card-icon.cyan { background: var(--cyan-dim); color: var(--cyan); }
.card-icon.orange { background: var(--orange-dim); color: var(--orange); }
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-body { flex: 1; min-width: 0; }

/* Featured card (Benfica red) */
.stat-card.featured {
  background: var(--benfica-red);
  color: #fff;
}
.stat-card.featured .card-title,
.stat-card.featured .card-value { color: #fff; }
.stat-card.featured .card-icon {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif;
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0;
}
.btn-primary { background: var(--benfica-red); color: #fff; }
.btn-primary:hover { background: var(--benfica-red-dark); box-shadow: 0 4px 12px rgba(195,0,0,0.25); }
.btn-secondary { background: var(--bg-soft); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-soft); }
.btn-danger { background: var(--red-dim); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-dim); color: var(--green); }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-gold { background: var(--gold-dim); color: var(--gold); }
.btn-gold:hover { background: var(--gold); color: var(--benfica-black); }
.btn-dark { background: var(--benfica-black); color: #fff; }
.btn-dark:hover { background: #1a1a1c; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: 'Roboto', sans-serif;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-blue { background: var(--blue-glow); color: var(--blue-primary); }
.badge-gold { background: var(--gold-dim); color: #cc9800; }
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-cyan { background: var(--cyan-dim); color: var(--cyan); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-muted { background: var(--bg-soft); color: var(--text-muted); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: none; }

/* ===== ATHLETE CARD ===== */
.athlete-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.athlete-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(44,44,46,0.08);
}
.athlete-avatar-lg {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--benfica-red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Roboto', sans-serif;
  font-size: 15px; font-weight: 900;
  margin-bottom: 12px;
}
.athlete-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.athlete-meta { font-size: 12px; color: var(--text-muted); }
.athlete-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.athlete-stat { text-align: center; }
.athlete-stat-val { font-size: 16px; font-weight: 800; color: var(--text-primary); display: block; }
.athlete-stat-lbl { font-size: 10px; color: var(--text-muted); }

/* ===== SCORE RING ===== */
.score-ring-wrap { position: relative; display: inline-block; }
.score-ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-ring-val { font-size: 18px; font-weight: 800; }
.score-ring-txt { font-size: 9px; color: var(--text-muted); text-transform: uppercase; }

/* ===== PROGRESS BARS ===== */
.progress-bar { background: var(--bg-soft); border-radius: 8px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 8px; transition: width 0.6s ease; }
.progress-blue { background: var(--blue-primary); }
.progress-gold { background: var(--gold); }
.progress-green { background: var(--green); }
.progress-red { background: var(--benfica-red); }
.progress-primary { background: var(--benfica-red); }

/* ===== SEARCH & FILTER BAR ===== */
.filter-bar {
  display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-input {
  flex: 1; min-width: 200px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-soft);
  border: 1px solid transparent;
}
.filter-select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 140px;
  background: var(--bg-soft);
  border: 1px solid transparent;
}

/* ===== TABS ===== */
.tabs {
  display: flex; gap: 4px;
  background: var(--bg-soft);
  border-radius: 22px;
  padding: 4px;
  margin-bottom: 22px;
  overflow-x: auto;
}
.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 18px;
  font-family: 'Roboto', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
  min-width: fit-content;
}
.tab-btn.active {
  background: var(--benfica-red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(195,0,0,0.25);
}
.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ===== AI ALERT ===== */
.ai-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.ai-alert.info { background: var(--blue-glow); }
.ai-alert.info .ai-alert-title { color: var(--blue-primary); }
.ai-alert.success { background: var(--green-dim); }
.ai-alert.success .ai-alert-title { color: var(--green); }
.ai-alert.warning { background: var(--orange-dim); }
.ai-alert.warning .ai-alert-title { color: var(--orange); }
.ai-alert.danger { background: var(--red-dim); }
.ai-alert.danger .ai-alert-title { color: var(--red); }
.ai-alert.gold { background: var(--gold-dim); }
.ai-alert.gold .ai-alert-title { color: #a17800; }
.ai-alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ai-alert-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.ai-alert-body { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.ai-alert-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ===== CHART CONTAINERS ===== */
.chart-container { position: relative; }
.chart-container canvas { max-width: 100%; }

/* ===== TIMELINE ===== */
.timeline { padding-left: 20px; }
.timeline-item {
  position: relative;
  padding-left: 20px;
  padding-bottom: 20px;
  border-left: 2px solid var(--border);
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot {
  position: absolute;
  left: -7px; top: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--benfica-red);
  border: 2px solid var(--bg-secondary);
}
.timeline-date { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-content { font-size: 13px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  transition: all var(--transition);
}
.form-control:focus {
  background: #fff;
  border-color: var(--benfica-red);
  box-shadow: 0 0 0 3px var(--benfica-red-soft);
}
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ===== PROFILE HEADER ===== */
.profile-header {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.profile-avatar {
  width: 84px; height: 84px;
  border-radius: 20px;
  background: var(--benfica-red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Roboto', sans-serif;
  font-size: 28px; font-weight: 900;
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name {
  font-family: 'Roboto', sans-serif;
  font-size: 22px; font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.profile-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.profile-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== SCORES GRID ===== */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.score-item {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.score-item-val { font-size: 24px; font-weight: 900; display: block; letter-spacing: -0.02em; }
.score-item-lbl { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; font-weight: 500; letter-spacing: 0.08em; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-sub { font-size: 13px; }

/* ===== AI BRAIN ANIMATION ===== */
.ai-running {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--cyan);
  padding: 6px 14px;
  background: var(--cyan-dim);
  border-radius: 20px;
  font-weight: 600;
}
.ai-dots span {
  display: inline-block; width: 4px; height: 4px;
  background: var(--cyan); border-radius: 50%;
  animation: blink 1.4s infinite;
}
.ai-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }

/* ===== HORIZONTAL SCROLL LIST ===== */
.h-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.h-scroll::-webkit-scrollbar { height: 4px; }

/* ===== SPLIT LAYOUT ===== */
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split-layout.left-wide { grid-template-columns: 2fr 1fr; }
.split-layout.right-wide { grid-template-columns: 1fr 2fr; }

/* ===== RANKING LIST ===== */
.rank-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-pos {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Roboto', sans-serif;
  font-size: 12px; font-weight: 900;
  flex-shrink: 0;
  color: var(--text-primary);
}
.rank-pos.gold { background: var(--gold-dim); color: #a17800; }
.rank-pos.silver { background: rgba(142,142,147,0.15); color: #52525B; }
.rank-pos.bronze { background: rgba(205,127,50,0.15); color: #cd7f32; }
.rank-info { flex: 1; }
.rank-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.rank-club { font-size: 11px; color: var(--text-muted); }
.rank-score { font-size: 15px; font-weight: 900; color: var(--benfica-red); }

/* ===== MAP ===== */
#mapContainer { height: 500px; border-radius: var(--radius); overflow: hidden; }

/* ===== COMPETITION RESULT ===== */
.comp-result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.comp-medal { font-size: 20px; }
.comp-name { font-size: 13px; font-weight: 700; flex: 1; color: var(--text-primary); }
.comp-date { font-size: 11px; color: var(--text-muted); }

/* ===== SCROLLABLE SECTION ===== */
.scroll-section { overflow-y: auto; }

/* ===== LOADING ===== */
.loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--benfica-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FULL PAGE CONTAINERS ===== */
.page { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== FLOATING KPI ===== */
.kpi-bar {
  display: flex; gap: 16px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 24px;
}
.kpi-chip {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 150px;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}
.kpi-chip-val {
  font-family: 'Roboto', sans-serif;
  font-size: 26px; font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}
.kpi-chip-lbl { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
.kpi-chip-delta { font-size: 11px; font-weight: 600; margin-top: 2px; }

/* ===== RADAR CHART LABELS ===== */
.radar-labels { font-size: 11px; color: var(--text-muted); }

/* ===== MODAL FULLSCREEN (fiche athlète) ===== */
.modal.modal-fullscreen {
  width: calc(100vw - 40px) !important;
  max-width: calc(100vw - 40px) !important;
  height: calc(100vh - 40px) !important;
  max-height: calc(100vh - 40px) !important;
  border-radius: var(--radius-lg);
  animation: fsModalIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fsModalIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.modal.modal-fullscreen .modal-header {
  padding: 18px 28px;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.modal.modal-fullscreen .modal-body {
  padding: 28px 32px 32px;
}
.modal.modal-fullscreen .profile-header {
  border-radius: var(--radius-lg);
}
.modal.modal-fullscreen .ath-tabs {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  padding-top: 4px;
  z-index: 5;
}

/* ===== ATTACHMENT CHIP ===== */
.attachment-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-soft);
  border-radius: 16px; font-size: 11px;
  margin: 2px;
  color: var(--text-secondary);
}
