/*
 * This is a manifest file that'll be compiled into application.css.
 */

/* Header branding with logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  text-decoration: none;
}

.header-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--rounded-lg);
}

.header-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

@media (max-width: 48rem) {
  .header-logo-icon {
    width: 26px;
    height: 26px;
  }

  .header-logo-text {
    font-size: var(--text-base);
  }
}

.pb-card-mark {
  transition: opacity 0.2s ease;
}

.pb-card-mark:hover {
  opacity: var(--opacity-75);
}

/* Stats cards grid */
.stats-cards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4);
}

@media (max-width: 48rem) {
  .stats-cards {
    flex-direction: column;
  }

  .stats-cards .card {
    margin: 0;
    width: 100%;
  }

  .page-title {
    font-size: var(--text-2xl);
  }

  .flex.items-center.justify-between {
    flex-wrap: wrap;
    gap: var(--size-2);
  }
}

/* Run Mark Show Page */
.run-mark-hero {
  background: linear-gradient(135deg, var(--color-accent) 0%, #FF8C42 100%);
  border-radius: var(--rounded-2xl);
  padding: var(--size-8);
  margin-bottom: var(--size-6);
  color: white;
  text-align: center;
}

.run-mark-hero-header {
  margin-bottom: var(--size-4);
}

.run-mark-edition {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  opacity: 0.8;
}

.run-mark-race-name {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--size-1) 0;
}

.run-mark-date {
  font-size: var(--text-sm);
  opacity: 0.8;
  font-weight: 400;
}

.run-mark-time-display {
  margin-top: var(--size-5);
}

.run-mark-time-label {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  opacity: 0.75;
  margin-bottom: var(--size-2);
}

.run-mark-time {
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.run-mark-source {
  display: block;
  font-size: var(--text-xs);
  opacity: 0.65;
  margin-top: var(--size-2);
  font-weight: 400;
}

.run-mark-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--size-4);
  margin-bottom: var(--size-6);
}

.run-mark-stat-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--rounded-xl);
  padding: var(--size-4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-2);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.run-mark-stat-icon {
  width: 26px;
  height: 26px;
  color: var(--color-accent);
}

.run-mark-stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.run-mark-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.run-mark-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4);
  margin-bottom: var(--size-4);
}

.run-mark-detail {
  display: flex;
  flex-direction: column;
  gap: var(--size-1);
}

.run-mark-detail-label {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.run-mark-detail-value {
  font-weight: 600;
}

@media (max-width: 48rem) {
  .run-mark-stats {
    grid-template-columns: 1fr;
  }

  .run-mark-hero {
    padding: var(--size-6);
    border-radius: var(--rounded-xl);
  }

  .run-mark-race-name {
    font-size: var(--text-xl);
  }
}

/* Stats Page */
.stats-header {
  margin-bottom: var(--size-8);
}

.stats-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-text);
  line-height: 1.05;
  margin-bottom: var(--size-2);
}

.stats-subtitle {
  color: var(--color-text-subtle);
  font-size: var(--text-base);
  font-weight: 400;
}

.stats-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--rounded-2xl);
  padding: var(--size-6);
  margin-bottom: var(--size-6);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
}

.stats-section--highlight {
  background: linear-gradient(160deg, #FFF9F7 0%, #FFFBF9 100%);
  border-color: #FFD4C4;

  @media (prefers-color-scheme: dark) {
    background: linear-gradient(160deg, #1F120E 0%, #1A0F0C 100%);
    border-color: #5C3020;
  }
}

.stats-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--size-5);
  flex-wrap: wrap;
  gap: var(--size-2);
}

.stats-section-title {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.stats-section-icon {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.stats-section-badge {
  background: var(--color-accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--rounded-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 6px rgba(255, 92, 53, 0.3);
}

.stats-section-description {
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  margin-bottom: var(--size-4);
  font-weight: 400;
}

/* Personal Bests Grid */
.pb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--size-3);
}

.pb-card {
  background: var(--color-bg);
  border: 2px solid var(--pb-color);
  border-radius: var(--rounded-xl);
  padding: var(--size-4);
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--size-1);
}

.pb-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.1);
  background: var(--pb-color-light);
}

.pb-card-distance {
  font-size: 11px;
  font-weight: 700;
  color: var(--pb-color);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pb-card-time {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1;
}

.pb-card-pace {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-1);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  font-weight: 500;
}

.pb-card-pace-icon {
  width: 13px;
  height: 13px;
}

.pb-card-date {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  opacity: 0.7;
  font-weight: 400;
}

/* Stats Grid 2 columns */
.stats-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--size-6);
}

/* Estimated Paces */
.estimated-paces-list {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.estimated-pace-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--size-3) var(--size-4);
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--ep-color);
  border-radius: var(--rounded-lg);
}

.estimated-pace-distance {
  font-weight: 700;
  color: var(--ep-color);
  min-width: 40px;
  font-size: var(--text-sm);
}

.estimated-pace-time {
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
  text-align: center;
  letter-spacing: -0.02em;
}

.estimated-pace-per-km {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  min-width: 70px;
  text-align: right;
  font-weight: 500;
}

/* Shoes List */
.shoes-list {
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}

.shoe-card {
  display: block;
  padding: var(--size-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--rounded-xl);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
}

.shoe-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.07);
  transform: translateY(-1px);
}

.shoe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--size-3);
}

.shoe-card-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-sm);
}

.shoe-card-distance {
  font-weight: 700;
  color: var(--color-accent);
  font-size: var(--text-sm);
  letter-spacing: -0.01em;
}

.shoe-card-progress {
  height: 5px;
  background: var(--color-border-light);
  border-radius: var(--rounded-full);
  overflow: hidden;
  margin-bottom: var(--size-2);
}

.shoe-card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, #FF8C42 100%);
  border-radius: var(--rounded-full);
  transition: width 0.4s ease;
}

.shoe-card-footer {
  display: flex;
  justify-content: flex-end;
}

.shoe-card-retirement {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  font-weight: 400;
}

/* Page actions */
.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--size-2);
  margin-top: var(--size-4);
}

@media (max-width: 48rem) {
  .page-actions {
    margin-bottom: var(--size-16);
  }
}

/* Top Three per Distance */
.top-three-rows {
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

.top-three-row {
  background: var(--color-bg);
  border-left: 4px solid var(--tt-color);
  border-radius: var(--rounded-xl);
  padding: var(--size-4) var(--size-5);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--tt-color);
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}

.top-three-row-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--tt-color);
  letter-spacing: -0.01em;
}

.top-three-items {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--size-1_5);
}

.top-three-item {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  padding: var(--size-2_5) var(--size-3);
  border-radius: var(--rounded-lg);
  text-decoration: none;
  transition: background-color 0.15s ease;
  background: var(--color-bg-subtle);
}

.top-three-item:hover {
  background: var(--tt-color-light);
}

.top-three-rank {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tt-color);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--rounded-full);
  flex-shrink: 0;
}

.top-three-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.top-three-time {
  font-size: var(--text-base);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1;
}

.top-three-pace {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  font-weight: 400;
}

.top-three-name {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  flex: 1;
}

.top-three-date {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  white-space: nowrap;
  font-weight: 400;
}

/* Races List */
.races-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--size-4);
}

.race-card {
  background: var(--color-bg);
  border: 1.5px solid var(--race-color);
  border-radius: var(--rounded-2xl);
  padding: var(--size-5);
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.race-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.09);
  background: var(--race-color-light);
}

.race-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-2);
}

.race-card-distance {
  font-size: 11px;
  font-weight: 700;
  color: var(--race-color);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.race-card-badge {
  background: var(--color-accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--rounded-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.race-card-name {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 1.2;
}

.race-card-location {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  font-weight: 400;
}

.race-card-best {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  margin-top: var(--size-2);
  padding-top: var(--size-2);
  border-top: 1px solid var(--color-border-light);
}

.race-card-best-label {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.race-card-best-time {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--race-color);
}

/* Mobile responsive */
@media (max-width: 48rem) {
  .stats-grid-2 {
    grid-template-columns: 1fr;
  }

  .pb-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-section {
    border-radius: var(--rounded-xl);
  }
}
