/* ============================================================
   NASCAR Track Intel — Page Styles
   ============================================================ */

/* ── Series Pills ── */
.nti-series-pills-wrap {
  max-width: 900px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

.nti-series-pills {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.nti-series-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 28px;
  border-radius: 14px;
  background: linear-gradient(145deg, #011a1a 0%, #001212 100%);
  border: 1px solid rgba(29, 225, 209, 0.25);
  color: #8ca09c;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s, color 0.2s;
  min-width: 140px;
  font-family: inherit;
}

.nti-series-pill:hover {
  background: linear-gradient(145deg, #013232 0%, #001f1f 100%);
  border-color: rgba(29, 225, 209, 0.6);
  color: #fff;
  transform: translateY(-1px);
}

.nti-series-pill.active {
  background: linear-gradient(145deg, #014545 0%, #012f2f 100%);
  border-color: #1de1d1;
  box-shadow: 0 6px 20px rgba(29, 225, 209, 0.2), 0 2px 6px rgba(0,0,0,0.5);
  color: #fff;
}

.nti-series-pill__short {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1de1d1;
  line-height: 1;
}

.nti-series-pill.active .nti-series-pill__short {
  color: #1de1d1;
}

.nti-series-pill__label {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

/* ── Page Loader ── */
.nti-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
  color: #8ca09c;
}

.nti-loader .fa-spinner {
  font-size: 42px;
  color: #1de1d1;
}

.nti-loader p {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}

/* ── Content Wrap ── */
.nti-content-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ── Section Wrapper ── */
.nti-section {
  margin-bottom: 32px;
}

.nti-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(29, 225, 209, 0.15);
}

.nti-section-header h2 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1de1d1;
  margin: 0;
}

.nti-section-header .nti-section-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8ca09c;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── Track DNA Card ── */
.nti-track-dna {
  background: linear-gradient(145deg, rgba(1,30,30,0.9) 0%, rgba(0,14,14,0.95) 100%);
  border: 1px solid rgba(29, 225, 209, 0.25);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  margin-bottom: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.nti-track-dna__left {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.nti-track-dna__right {
  position: relative;
  background: #000;
  min-height: 220px;
  overflow: hidden;
}

.nti-track-dna__right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  display: block;
}

.nti-track-dna__right-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,14,14,0.9) 0%, transparent 40%);
}

.nti-track-dna__name-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.nti-track-dna__name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.nti-track-dna__type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 4px;
}

.nti-track-dna__type-badge--superspeedway {
  background: rgba(255,87,51,0.15);
  border: 1px solid rgba(255,87,51,0.45);
  color: #ff5733;
}
.nti-track-dna__type-badge--intermediate {
  background: rgba(29,225,209,0.12);
  border: 1px solid rgba(29,225,209,0.4);
  color: #1de1d1;
}
.nti-track-dna__type-badge--short_track,
.nti-track-dna__type-badge--short {
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.4);
  color: #f5a623;
}
.nti-track-dna__type-badge--road_course,
.nti-track-dna__type-badge--road {
  background: rgba(100,200,100,0.12);
  border: 1px solid rgba(100,200,100,0.4);
  color: #6dc875;
}
.nti-track-dna__type-badge--oval {
  background: rgba(150,100,255,0.12);
  border: 1px solid rgba(150,100,255,0.4);
  color: #a07aff;
}

/* KPI row */
.nti-track-dna__kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nti-kpi {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(29,225,209,0.12);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 80px;
  text-align: center;
}

.nti-kpi__value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  display: block;
}

.nti-kpi__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8ca09c;
  margin-top: 4px;
  display: block;
}

/* Race info row */
.nti-track-dna__race-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nti-track-dna__race-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8f0ee;
}

.nti-track-dna__stage-bar {
  display: flex;
  gap: 0;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  max-width: 400px;
}

.nti-track-dna__stage-segment {
  height: 100%;
  transition: opacity 0.2s;
}

.nti-track-dna__stage-segment--1 { background: #1de1d1; }
.nti-track-dna__stage-segment--2 { background: #f5a623; }
.nti-track-dna__stage-segment--3 { background: #e84040; }

.nti-track-dna__stage-labels {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.nti-stage-label {
  font-size: 0.75rem;
  color: #8ca09c;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nti-stage-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.nti-stage-label__dot--1 { background: #1de1d1; }
.nti-stage-label__dot--2 { background: #f5a623; }
.nti-stage-label__dot--3 { background: #e84040; }

/* Dominator pill */
.nti-dominator-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nti-dominator-profile--none {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #8ca09c;
}
.nti-dominator-profile--single {
  background: rgba(29,225,209,0.1);
  border: 1px solid rgba(29,225,209,0.3);
  color: #1de1d1;
}
.nti-dominator-profile--double {
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.3);
  color: #f5a623;
}
.nti-dominator-profile--multi {
  background: rgba(232,64,64,0.1);
  border: 1px solid rgba(232,64,64,0.3);
  color: #e84040;
}

/* Hist stats strip */
.nti-track-dna__hist-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.nti-hist-stat {
  font-size: 0.8rem;
  color: #8ca09c;
}

.nti-hist-stat strong {
  color: #cdd8d5;
  font-weight: 700;
}

/* ── Spotlight Strip ── */
.nti-spotlight-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.nti-spotlight-card {
  background: linear-gradient(145deg, rgba(1,25,25,0.95) 0%, rgba(0,12,12,0.98) 100%);
  border: 1px solid rgba(29,225,209,0.18);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nti-open-driver-card {
  cursor: pointer;
}

.nti-spotlight-card:hover {
  border-color: rgba(29,225,209,0.45);
  box-shadow: 0 4px 16px rgba(29,225,209,0.1);
}

.nti-spotlight-card__icon {
  font-size: 1.4rem;
  line-height: 1;
}

.nti-spotlight-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1de1d1;
}

.nti-spotlight-card__driver {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.nti-spotlight-card__value {
  font-size: 0.88rem;
  font-weight: 600;
  color: #8ca09c;
}

.nti-spotlight-card__value strong {
  color: #e8f0ee;
}

/* ── Two-column layout ── */
.nti-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

/* ── Section Cards ── */
.nti-card {
  background: linear-gradient(145deg, rgba(1,25,25,0.95) 0%, rgba(0,12,12,0.98) 100%);
  border: 1px solid rgba(29,225,209,0.18);
  border-radius: 14px;
  overflow: hidden;
}

.nti-card__header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(29,225,209,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nti-card__title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1de1d1;
  margin: 0;
}

.nti-card__subtitle {
  font-size: 0.72rem;
  color: #8ca09c;
}

.nti-card__body {
  padding: 0;
}

/* ── Data Tables ── */
.nti-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.nti-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8ca09c;
  border-bottom: 1px solid rgba(29,225,209,0.1);
  white-space: nowrap;
  background: rgba(0,0,0,0.2);
}

.nti-table td {
  padding: 9px 12px;
  color: #cdd8d5;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
  vertical-align: middle;
}

.nti-table tr:last-child td {
  border-bottom: none;
}

.nti-table tr:hover td {
  background: rgba(29,225,209,0.04);
}

.nti-table .nti-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: #8ca09c;
  min-width: 28px;
  text-align: center;
}

.nti-table .nti-rank--top3 {
  color: #f5a623;
}

.nti-table .nti-driver-name {
  font-weight: 700;
  color: #e8f0ee;
  cursor: pointer;
}

.nti-table .nti-driver-name:hover {
  color: #1de1d1;
  text-decoration: underline;
}

.nti-table .nti-mfr {
  font-size: 0.72rem;
  color: #8ca09c;
  font-weight: 600;
}

.nti-table .nti-speed {
  font-weight: 700;
  color: #1de1d1;
  font-variant-numeric: tabular-nums;
}

.nti-table .nti-prob {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nti-table .nti-prob--high { color: #2ecc71; }
.nti-table .nti-prob--mid  { color: #f5a623; }
.nti-table .nti-prob--low  { color: #8ca09c; }

.nti-table .nti-grade-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  min-width: 36px;
}

.nti-grade-elite   { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.nti-grade-solid   { background: rgba(29,225,209,0.12); color: #1de1d1; border: 1px solid rgba(29,225,209,0.3); }
.nti-grade-avg     { background: rgba(245,166,35,0.12); color: #f5a623; border: 1px solid rgba(245,166,35,0.3); }
.nti-grade-subpar  { background: rgba(232,64,64,0.1);   color: #e84040; border: 1px solid rgba(232,64,64,0.25); }

/* ── History Year Tabs ── */
.nti-year-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
}

.nti-year-tab {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #8ca09c;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.nti-year-tab:hover {
  border-color: rgba(29,225,209,0.4);
  color: #cdd8d5;
}

.nti-year-tab.active {
  background: rgba(29,225,209,0.12);
  border-color: #1de1d1;
  color: #1de1d1;
}

.nti-history-year-panel {
  display: none;
  padding: 4px 0;
}

.nti-history-year-panel.active {
  display: block;
}

/* ── Finish Position Badges ── */
.nti-finish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.nti-finish--1  { background: rgba(255,215,0,0.2);  color: #ffd700; border: 1px solid rgba(255,215,0,0.4);  }
.nti-finish--2  { background: rgba(192,192,192,0.2); color: #c0c0c0; border: 1px solid rgba(192,192,192,0.4); }
.nti-finish--3  { background: rgba(205,127,50,0.2);  color: #cd7f32; border: 1px solid rgba(205,127,50,0.4);  }
.nti-finish--top5  { background: rgba(29,225,209,0.1); color: #1de1d1; border: 1px solid rgba(29,225,209,0.25); }
.nti-finish--top10 { background: rgba(245,166,35,0.1); color: #f5a623; border: 1px solid rgba(245,166,35,0.25); }
.nti-finish--other { background: rgba(255,255,255,0.05); color: #8ca09c; border: 1px solid rgba(255,255,255,0.1); }

/* ── Analytics Rating Bars ── */
.nti-rating-bar {
  position: relative;
  height: 20px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
  display: flex;
  align-items: center;
}

.nti-rating-bar__fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.nti-rating-bar__label {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  padding-left: 6px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.nti-rating--elite { background: rgba(46,204,113,0.55);  }
.nti-rating--solid { background: rgba(29,225,209,0.45);  }
.nti-rating--avg   { background: rgba(245,166,35,0.45);  }
.nti-rating--sub   { background: rgba(232,64,64,0.4);    }

/* Traffic delta coloring */
.nti-table td.nti-delta--pos {
  color: #2ecc71;
  font-weight: 700;
}

.nti-table td.nti-delta--neg {
  color: #e84040;
  font-weight: 700;
}

/* Races sample size cell */
.nti-table .nti-analytics-races {
  color: #8ca09c;
  font-size: 0.78rem;
}

/* ── Empty State ── */
.nti-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #8ca09c;
}

.nti-empty-state i {
  font-size: 32px;
  color: rgba(29,225,209,0.25);
  margin-bottom: 12px;
  display: block;
}

.nti-empty-state p {
  font-size: 0.88rem;
  margin: 0;
}

/* ── No Race Found ── */
.nti-no-race {
  text-align: center;
  padding: 80px 20px;
  color: #8ca09c;
  max-width: 480px;
  margin: 0 auto;
}

.nti-no-race i {
  font-size: 48px;
  color: rgba(29,225,209,0.2);
  margin-bottom: 20px;
  display: block;
}

.nti-no-race h3 {
  color: #cdd8d5;
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.nti-no-race p {
  font-size: 0.88rem;
  margin: 0;
}

/* ── AJAX transition ── */
.nti-content-wrap.is-loading {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .nti-spotlight-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .nti-track-dna {
    grid-template-columns: 1fr;
  }
  .nti-track-dna__right {
    height: 180px;
  }
  .nti-spotlight-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nti-series-pills {
    gap: 8px;
  }
  .nti-series-pill {
    padding: 10px 16px;
    min-width: 100px;
  }
  .nti-series-pill__label {
    font-size: 0.72rem;
  }
  .nti-two-col {
    grid-template-columns: 1fr;
  }
  .nti-spotlight-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .nti-track-dna__name {
    font-size: 1.2rem;
  }
  .nti-track-dna__left {
    padding: 20px;
  }
  .nti-track-dna__kpis {
    gap: 8px;
  }
  .nti-kpi {
    padding: 8px 12px;
  }
  .nti-kpi__value {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .nti-spotlight-strip {
    grid-template-columns: 1fr 1fr;
  }
  .nti-series-pill__label {
    display: none;
  }
  .nti-series-pill {
    min-width: auto;
    padding: 10px 20px;
  }
}
