/* Pro Judo — technique statistics pages */

.tech-page {
  --tech-bg: #0f172a;
  --tech-panel: #1e293b;
  --tech-panel-2: #172033;
  --tech-border: #334155;
  --tech-muted: #94a3b8;
  --tech-text: #f1f5f9;
  --tech-link: #7dd3fc;
  --tech-link-hover: #e0f2fe;
  --tech-accent: #38bdf8;
  --tech-ippon: #fbbf24;
  --tech-yuko: #7dd3fc;
  --tech-waza: #a5b4fc;
  --tech-win: #4ade80;
  --tech-warn: #f87171;
  --tech-impact: #fcd34d;
  --tech-elo: #c4b5fd;
}

.tech-page main {
  flex: 1;
}

.tech-hero {
  background: linear-gradient(135deg, #1e293b 0%, #172033 55%, #1a2744 100%);
  border: 1px solid var(--tech-border);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.tech-hero h1 {
  color: var(--tech-text);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.tech-hero .lead {
  color: var(--tech-muted);
  font-size: 0.92rem;
  margin-bottom: 0;
  max-width: 52rem;
}

.tech-hero-meta {
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

.tech-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.tech-advanced-wrap {
  border: 1px solid var(--tech-border);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.45);
}

.tech-advanced-wrap .tech-advanced-hint {
  color: var(--tech-muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
}

.tech-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.tech-advanced-grid label {
  font-size: 0.78rem;
  color: var(--tech-muted);
  margin-bottom: 0.2rem;
  display: block;
}

.tech-advanced-grid .form-control,
.tech-advanced-grid .form-select {
  background: var(--tech-bg);
  border: 1px solid #475569;
  color: var(--tech-text);
  font-size: 0.9rem;
}

.tech-advanced-grid .form-control:focus,
.tech-advanced-grid .form-select:focus {
  border-color: #64748b;
  box-shadow: none;
  color: var(--tech-text);
}

.tech-advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  align-items: center;
}

.tech-advanced-actions .btn-primary {
  font-weight: 600;
}

.tech-search-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: #cbd5e1;
  background: var(--tech-panel);
  border: 1px solid #475569;
  border-radius: 0.45rem;
  text-decoration: none;
}

.tech-search-clear:hover {
  color: var(--tech-text);
  border-color: #94a3b8;
  background: #334155;
}

.tech-athletes-panel {
  margin-bottom: 1.5rem;
}

.tech-athletes-panel .tech-panel-head {
  border-bottom: 1px solid var(--tech-border);
}

.tech-athletes-meta {
  color: var(--tech-muted);
  font-size: 0.8rem;
  padding: 0.5rem 1rem 0.75rem;
  border-bottom: 1px solid var(--tech-border);
}

.tech-cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.tech-cat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tech-muted);
  font-weight: 700;
  margin-right: 0.25rem;
}

.tech-cat-btn {
  appearance: none;
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.65);
  color: var(--tech-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: 1.25;
}

.tech-cat-btn small {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 0.05rem;
}

.tech-cat-btn:hover {
  color: var(--tech-text);
  border-color: #64748b;
}

.tech-cat-btn.active {
  color: var(--tech-text);
  border-color: var(--tech-accent);
  background: rgba(56, 189, 248, 0.12);
}

.tech-cat-btn.active small {
  color: var(--tech-muted);
}

.tech-cat-btn[data-category="nage-waza"].active {
  border-color: #38bdf8;
}

.tech-cat-btn[data-category="katame-waza"].active {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
}

.tech-search {
  flex: 1 1 220px;
  max-width: 420px;
  background: var(--tech-bg);
  border: 1px solid #475569;
  color: var(--tech-text);
  border-radius: 0.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
}

.tech-search:focus {
  background: var(--tech-bg);
  border-color: var(--tech-accent);
  color: var(--tech-text);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  outline: none;
}

.tech-search::placeholder {
  color: #64748b;
}

.tech-count-pill {
  font-size: 0.78rem;
  color: var(--tech-muted);
  background: var(--tech-bg);
  border: 1px solid var(--tech-border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.tech-panel {
  background: var(--tech-panel);
  border: 1px solid var(--tech-border);
  border-radius: 1rem;
  overflow: hidden;
}

/* Setup-techniques block: padded body (not tab layout); avoid clipping headings */
#tech-setups-panel {
  padding: 1rem;
  overflow: visible;
}

.tech-panel-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--tech-border);
  background: rgba(15, 23, 42, 0.45);
  color: var(--tech-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.tech-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Custom data table — NOT bootstrap .table */
.tech-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  color: var(--tech-text) !important;
  background: transparent !important;
}

.tech-data-table thead th.col-num {
  text-transform: none;
  letter-spacing: 0.02em;
}

.tech-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #172033;
  color: var(--tech-muted) !important;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid #475569;
  white-space: nowrap;
  user-select: none;
}

.tech-data-table thead th.sortable {
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tech-data-table thead th.sortable:hover {
  color: var(--tech-text) !important;
  background: #1e293b;
}

.tech-data-table thead th.sort-asc::after,
.tech-data-table thead th.sort-desc::after {
  content: " ▲";
  font-size: 0.6rem;
  color: var(--tech-accent);
}

.tech-data-table thead th.sort-desc::after {
  content: " ▼";
}

.tech-data-table tbody tr {
  transition: background 0.12s ease;
}

.tech-data-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

.tech-data-table tbody td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid var(--tech-border);
  color: var(--tech-text) !important;
  background: transparent !important;
  vertical-align: middle;
}

.tech-data-table tbody tr:last-child td {
  border-bottom: none;
}

.tech-data-table .col-name {
  font-weight: 600;
  min-width: 9rem;
}

.tech-data-table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tech-data-table a.tech-link {
  color: var(--tech-link) !important;
  text-decoration: none;
  font-weight: 600;
}

.tech-data-table a.tech-link:hover {
  color: var(--tech-link-hover) !important;
  text-decoration: underline;
}

/* Links anywhere on technique pages (judoka tab, etc.) */
.tech-page a.tech-link {
  color: var(--tech-link) !important;
  text-decoration: none;
  font-weight: 600;
}

.tech-page a.tech-link:hover {
  color: var(--tech-link-hover) !important;
  text-decoration: underline;
}

.tech-num-total { font-weight: 700; color: var(--tech-text) !important; }
.tech-num-ippon { color: var(--tech-ippon) !important; }
.tech-num-yuko { color: var(--tech-yuko) !important; }
.tech-num-waza { color: var(--tech-waza) !important; }
.tech-num-win { color: var(--tech-win) !important; }
.tech-num-warn { color: var(--tech-warn) !important; }
.tech-num-impact { color: var(--tech-impact) !important; }
.tech-num-elo { color: var(--tech-elo) !important; }
.tech-num-muted { color: #64748b !important; }

.tech-bar-cell {
  min-width: 5.5rem;
}

.tech-bar-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.tech-bar {
  width: 3.5rem;
  height: 0.35rem;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #334155;
}

.tech-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 999px;
}

.tech-bar-win > span {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.tech-bar-impact > span {
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
}

.tech-footnote {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 1rem;
}

/* Technique advisor */
.tech-advisor {
  background: linear-gradient(135deg, #1a2744 0%, #1e293b 50%, #172033 100%);
  border: 1px solid #475569;
  border-radius: 1rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.45);
}

.tech-advisor-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tech-text);
  margin: 0 0 0.25rem;
}

.tech-advisor-intro {
  color: var(--tech-muted);
  font-size: 0.86rem;
  margin-bottom: 1rem;
  max-width: 44rem;
}

.tech-advisor-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tech-advisor-field label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tech-muted);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.tech-advisor-select {
  width: 100%;
  background: var(--tech-bg);
  border: 1px solid #475569;
  color: var(--tech-text);
  border-radius: 0.55rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
}

.tech-advisor-select:focus {
  border-color: var(--tech-accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  outline: none;
}

.tech-advisor-results-head {
  font-size: 0.82rem;
  color: var(--tech-muted);
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.tech-advisor-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tech-advisor-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--tech-border);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.tech-advisor-item:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  color: inherit;
  transform: translateY(-1px);
}

.tech-advisor-rank {
  font-weight: 800;
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
}

.tech-advisor-rank.top1 { color: #fbbf24; }
.tech-advisor-rank.top2 { color: #cbd5e1; }
.tech-advisor-rank.top3 { color: #d97706; }

.tech-advisor-name {
  font-weight: 700;
  color: var(--tech-link);
  font-size: 0.92rem;
}

.tech-advisor-item:hover .tech-advisor-name {
  color: var(--tech-link-hover);
}

.tech-advisor-meta {
  font-size: 0.72rem;
  color: var(--tech-muted);
  margin-top: 0.1rem;
}

.tech-advisor-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.35rem;
}

.tech-advisor-stats {
  text-align: right;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
}

.tech-advisor-stat-win {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--tech-win);
}

.tech-advisor-empty {
  color: var(--tech-muted);
  font-size: 0.88rem;
  padding: 0.5rem 0;
}

.tech-section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem 0 1rem;
  color: var(--tech-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tech-section-divider::before,
.tech-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tech-border);
}

.tech-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--tech-link) !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.tech-back:hover {
  color: var(--tech-link-hover) !important;
}

/* Detail page stats */
.tech-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.75rem;
}

.tech-stat-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--tech-border);
  border-radius: 0.75rem;
  padding: 0.85rem 0.75rem;
  text-align: center;
}

.tech-stat-card .label {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--tech-muted);
  font-weight: 600;
}

.tech-stat-card .value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--tech-text);
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.tech-stat-card.accent-ippon .value { color: var(--tech-ippon); }
.tech-stat-card.accent-win .value { color: var(--tech-win); }
.tech-stat-card.accent-elo .value { color: var(--tech-elo); }

/* Tabs */
.tech-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--tech-border);
  background: rgba(15, 23, 42, 0.35);
}

.tech-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--tech-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem 0.5rem 0 0;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.tech-tab:hover {
  color: var(--tech-text);
  background: rgba(56, 189, 248, 0.08);
}

.tech-tab.active {
  color: var(--tech-text);
  background: var(--tech-panel);
  border-color: var(--tech-border);
  border-bottom-color: var(--tech-panel);
  margin-bottom: -1px;
}

.tech-tab-panel {
  display: none;
  padding: 1rem;
}

.tech-tab-panel.active {
  display: block;
}

.tech-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tech-text);
  margin: 0 0 0.35rem;
}

.tech-section-hint {
  font-size: 0.82rem;
  color: var(--tech-muted);
  margin-bottom: 0.85rem;
}

/* Division / country list rows */
.tech-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 3.5rem 4rem 4rem 4rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--tech-border);
  color: var(--tech-text);
}

.tech-list-row:last-child {
  border-bottom: none;
}

.tech-list-row.head {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--tech-muted);
  font-weight: 700;
  padding-top: 0;
}

.tech-list-row .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tech-list-row a {
  color: var(--tech-link) !important;
  text-decoration: none;
  font-weight: 600;
}

.tech-list-row a:hover {
  text-decoration: underline;
}

.tech-vol-bar {
  height: 0.4rem;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.25rem;
  border: 1px solid #334155;
}

.tech-vol-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
}

.tech-judoka-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem 4rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--tech-border);
  color: var(--tech-text) !important;
}

.tech-judoka-row:last-child { border-bottom: none; }

.tech-judoka-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem 4rem;
  gap: 0.75rem;
  align-items: end;
  padding-bottom: 0.4rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid #475569;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--tech-muted) !important;
  font-weight: 700;
}

.tech-judoka-head .num {
  text-align: right;
}

.tech-judoka-row .name {
  color: var(--tech-text) !important;
  font-weight: 600;
  min-width: 0;
  line-height: 1.35;
}

.tech-judoka-row .name .meta {
  display: block;
  color: var(--tech-muted) !important;
  font-size: 0.78rem;
  font-weight: 400;
  margin-top: 0.15rem;
}

.tech-judoka-row .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.92rem;
}

.tech-judoka-row .num.tech-num-elo {
  color: var(--tech-elo) !important;
  font-size: 1rem;
}

.tech-judoka-row .num.tech-num-total {
  color: var(--tech-text) !important;
}

.tech-judoka-row .num.tech-num-win {
  color: var(--tech-win) !important;
}

.tech-bar-wrap > span {
  color: var(--tech-text) !important;
  font-variant-numeric: tabular-nums;
}

.tech-empty {
  color: var(--tech-muted);
  font-size: 0.88rem;
  padding: 1rem 0;
}

@media (max-width: 767.98px) {
  .tech-list-row.head {
    display: none;
  }

  .tech-list-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.85rem 0;
  }

  .tech-list-row .num {
    text-align: left;
    display: inline-block;
    margin-right: 0.85rem;
    font-size: 0.82rem;
  }

  .tech-list-row .num::before {
    color: var(--tech-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.25rem;
  }

  .tech-list-row .num:nth-child(2)::before { content: "Fights: "; }
  .tech-list-row .num:nth-child(3)::before { content: "High-impact: "; }
  .tech-list-row .num:nth-child(4)::before { content: "Win: "; }

  .tech-judoka-head {
    display: none;
  }

  .tech-judoka-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.75rem 0;
  }

  .tech-judoka-row .num {
    text-align: left;
    font-size: 0.82rem;
    display: block;
  }

  .tech-judoka-row .num::before {
    color: var(--tech-muted) !important;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.35rem;
  }

  .tech-judoka-subpanel-elo .tech-judoka-row .num:nth-child(2)::before { content: "Avg ELO: "; }
  .tech-judoka-subpanel-elo .tech-judoka-row .num:nth-child(3)::before { content: "Fights: "; }
  .tech-judoka-subpanel-volume .tech-judoka-row .num:nth-child(2)::before { content: "Fights: "; }
  .tech-judoka-subpanel-volume .tech-judoka-row .num:nth-child(3)::before { content: "Win: "; }

  .tech-data-table .col-hide-sm {
    display: none;
  }
}
