/* ============================================================
   HIDEF ACWR Workload Tracker — Dark Theme
   Colors: #0f0f0f background, #00b7eb electric blue accent
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: #0f0f0f;
  color: #f0f0f0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
}

a { color: #00b7eb; text-decoration: none; }
a:hover { color: #33c9f5; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: #111111;
  border-bottom: 1px solid #1e1e1e;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-logo img {
  height: 38px;
  width: auto;
}

.navbar-center {
  display: flex;
  gap: 0.5rem;
}

.team-tab {
  padding: 0.45rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: #9ca3af;
  border: 1px solid #2a2a2a;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.team-tab:hover {
  border-color: #00b7eb;
  color: #00b7eb;
}

.team-tab.active {
  background: #00b7eb;
  border-color: #00b7eb;
  color: #000000;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link-btn {
  color: #9ca3af;
  font-size: 0.875rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link-btn:hover {
  background: #1e1e1e;
  border-color: #2a2a2a;
  color: #f0f0f0;
}

.nav-link-btn.primary {
  background: #00b7eb;
  color: #000;
  font-weight: 600;
  border-color: #00b7eb;
}

.nav-link-btn.primary:hover {
  background: #00a0d0;
  border-color: #00a0d0;
  color: #000;
}

/* ── Page Layout ──────────────────────────────────────────── */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
}

.page-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

/* ── Flash Messages ───────────────────────────────────────── */
.flash-container {
  max-width: 1280px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flash.success { background: #052e16; border: 1px solid #166534; color: #4ade80; }
.flash.error   { background: #2d0a0a; border: 1px solid #7f1d1d; color: #f87171; }
.flash.warning { background: #2d2000; border: 1px solid #78350f; color: #fbbf24; }
.flash.info    { background: #0c1a2d; border: 1px solid #1e3a5f; color: #60a5fa; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.stat-value.blue   { color: #00b7eb; }
.stat-value.green  { color: #22c55e; }
.stat-value.yellow { color: #eab308; }
.stat-value.red    { color: #ef4444; }

.stat-sub {
  font-size: 0.75rem;
  color: #6b7280;
}

/* ── Player Cards Grid ────────────────────────────────────── */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.player-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.player-card:hover {
  transform: translateY(-2px);
  border-color: #3a3a3a;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.player-card.zone-optimal::before   { background: #22c55e; }
.player-card.zone-caution::before   { background: #eab308; }
.player-card.zone-danger::before    { background: #ef4444; }
.player-card.zone-undertrained::before { background: #6b7280; }
.player-card.zone-no_data::before   { background: #2a2a2a; }

.player-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.player-name {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
}

.player-meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.1rem;
}

.acwr-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.acwr-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.zone-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  margin-top: 0.3rem;
}

.zone-optimal    { color: #22c55e; }
.zone-caution    { color: #eab308; }
.zone-danger     { color: #ef4444; }
.zone-undertrained { color: #6b7280; }
.zone-no_data    { color: #4b5563; }

.zone-badge.zone-optimal    { background: #052e16; border: 1px solid #166534; color: #4ade80; }
.zone-badge.zone-caution    { background: #2d2000; border: 1px solid #78350f; color: #fbbf24; }
.zone-badge.zone-danger     { background: #2d0a0a; border: 1px solid #7f1d1d; color: #f87171; }
.zone-badge.zone-undertrained { background: #1a1a1a; border: 1px solid #374151; color: #9ca3af; }
.zone-badge.zone-no_data    { background: #111; border: 1px solid #2a2a2a; color: #6b7280; }

.player-loads {
  display: flex;
  gap: 1.5rem;
}

.load-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.load-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  font-weight: 600;
}

.load-value {
  font-size: 1rem;
  font-weight: 600;
  color: #d1d5db;
}

.player-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2a2a;
}

.btn-detail {
  font-size: 0.8rem;
  color: #00b7eb;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-detail:hover { color: #33c9f5; }

/* ── Toolbar / Filters ────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-tabs {
  display: flex;
  gap: 0.4rem;
}

.filter-tab {
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #9ca3af;
  border: 1px solid #2a2a2a;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.filter-tab:hover  { border-color: #4b5563; color: #f0f0f0; }
.filter-tab.active { background: #1e1e1e; border-color: #4b5563; color: #f0f0f0; }

/* ── Forms ────────────────────────────────────────────────── */
.card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #2a2a2a;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  background: #111111;
  border: 1px solid #2a2a2a;
  color: #f0f0f0;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  width: 100%;
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: #00b7eb;
  background: #131313;
}

.form-control::placeholder { color: #4b5563; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: #00b7eb;
  color: #000000;
}

.btn-primary:hover {
  background: #00a0d0;
  color: #000;
}

.btn-secondary {
  background: #1e1e1e;
  color: #d1d5db;
  border: 1px solid #2a2a2a;
}

.btn-secondary:hover {
  background: #2a2a2a;
  color: #f0f0f0;
}

.btn-danger {
  background: transparent;
  color: #f87171;
  border: 1px solid #7f1d1d;
}

.btn-danger:hover {
  background: #2d0a0a;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
}

/* ── Session Log Table ────────────────────────────────────── */
.log-table-wrapper {
  overflow-x: auto;
}

table.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.log-table th {
  background: #111;
  color: #6b7280;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}

.log-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #1e1e1e;
  color: #d1d5db;
  vertical-align: middle;
}

.log-table tr:last-child td { border-bottom: none; }
.log-table tr:hover td { background: #1e1e1e; }

.rpe-input {
  width: 60px;
  text-align: center;
}

.dur-input {
  width: 80px;
  text-align: center;
}

.load-display {
  font-weight: 700;
  color: #00b7eb;
  min-width: 60px;
  display: inline-block;
}

/* ── Player Detail — Chart ────────────────────────────────── */
.chart-container {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1rem;
}

/* ── Roster Table ─────────────────────────────────────────── */
.roster-table th { color: #6b7280; }

.copy-link-btn {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  color: #9ca3af;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-link-btn:hover { border-color: #00b7eb; color: #00b7eb; }
.copy-link-btn.copied { border-color: #22c55e; color: #22c55e; }

.active-badge   { color: #4ade80; font-size: 0.75rem; font-weight: 600; }
.inactive-badge { color: #4b5563; font-size: 0.75rem; font-weight: 600; }

/* ── Self-Report Form ─────────────────────────────────────── */
.self-report-page {
  min-height: 100vh;
  background: #0f0f0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
}

.self-report-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}

.rpe-slider {
  width: 100%;
  accent-color: #00b7eb;
  margin: 0.5rem 0;
}

.rpe-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6b7280;
}

.rpe-display {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #00b7eb;
  margin: 0.5rem 0;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo img { height: 48px; width: auto; }

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-sub {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-error {
  background: #2d0a0a;
  border: 1px solid #7f1d1d;
  color: #f87171;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #4b5563;
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; color: #6b7280; margin-bottom: 0.5rem; }
.empty-state-sub   { font-size: 0.875rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar { flex-wrap: wrap; }
  .players-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .page-container { padding: 1rem; }
}
