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

:root {
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #10b981;
  --primary-dark: #059669;
  --secondary: #eab308;
  --gold: #eab308;
  --silver: #94a3b8;
  --bronze: #d97706;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

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

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}

.brand-logo {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1rem;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 60px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.target-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--secondary) 0 34%, #ef4444 35% 67%, var(--primary) 68% 100%);
  border: 2px solid var(--text);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.92rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.25rem;
}

.nav-links a:hover {
  color: var(--primary-dark);
}

/* 1 Ενιαίο Responsive Banner */
.banner-single-wrap {
  margin: 1.15rem 0;
}

.banner-card {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.banner-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.banner-card img,
.banner-single img {
  display: block;
  width: 100%;
  height: clamp(92px, 16vw, 150px);
  object-fit: cover;
}

.banner-placeholder {
  min-height: clamp(92px, 16vw, 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--surface-muted), #ecfdf5);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.stats-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.input, .select, .btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.65rem 0.9rem;
  min-height: 44px;
}

.select-sm {
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  min-height: 36px;
}

.input, .select {
  background: var(--surface);
  color: var(--text);
}

.input:focus, .select:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-color: var(--primary);
}

.btn {
  cursor: pointer;
  font-weight: 600;
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.check-status {
  margin-top: 0.65rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  word-break: break-word;
}

.check-status strong {
  color: var(--text);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.55rem 1rem;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  touch-action: manipulation;
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

.grid-col-min {
  min-width: 0;
}

@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 0.95fr 1.05fr;
  }
}

/* Searchable Athlete Dropdown */
.athlete-search-box {
  position: relative;
  margin-bottom: 0.85rem;
}

.athlete-search-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.athlete-search-row {
  display: flex;
  gap: 0.45rem;
}

.athlete-search-row .input {
  min-width: 0;
}

.athlete-search-row .btn {
  flex-shrink: 0;
  min-width: 44px;
  padding: 0.65rem 0.85rem;
}

.athlete-search-results {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.athlete-search-results li {
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.athlete-search-results li:last-child {
  border-bottom: none;
}

.athlete-search-results li:hover,
.athlete-search-results li.active {
  background: var(--surface-muted);
}

.athlete-search-empty {
  cursor: default !important;
  color: var(--text-muted);
}

.athlete-search-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.athlete-empty-hint {
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Athlete Progress Chart (Right Column) */
.athlete-chart-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem;
  background: var(--surface);
}

.athlete-chart-placeholder {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  background: var(--surface-muted);
}

.athlete-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.athlete-chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.athlete-chart-wrap {
  position: relative;
  height: 300px;
  width: 100%;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-row:hover {
  background: var(--surface-muted);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.kpi {
  background: var(--surface-muted);
  border-radius: 10px;
  padding: 0.75rem;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-muted);
  font-weight: 600;
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
}

.medal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem 0;
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hidden {
  display: none !important;
}

/* Mobile Enhancements */
@media (max-width: 767.98px) {
  .container {
    padding: 0 0.75rem;
  }

  .topbar-inner {
    min-height: 54px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .brand-logo {
    height: 30px;
  }

  .nav-links {
    gap: 0.65rem;
    font-size: 0.85rem;
  }

  .card {
    padding: 0.95rem;
    margin-bottom: 1rem;
    border-radius: 10px;
  }

  h2 {
    font-size: 1.22rem;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row .input,
  .search-row .btn,
  .stats-header-row .select {
    width: 100%;
  }

  /* 16px font-size αποτρέπει το αυτόματο zoom στο iOS Safari */
  .input,
  .select {
    font-size: 16px;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .tab-btn {
    width: 100%;
    text-align: center;
    padding: 0.55rem 0.6rem;
    font-size: 0.86rem;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .kpi {
    padding: 0.6rem 0.7rem;
  }

  .kpi-value {
    font-size: 1.18rem;
  }

  th, td {
    padding: 0.5rem 0.6rem;
    font-size: 0.84rem;
  }

  .athlete-chart-card {
    padding: 0.75rem;
  }

  .athlete-chart-wrap {
    height: 245px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
