/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

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

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

.header-logo-text {
  font-family: 'Titillium Web', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  font-style: italic;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

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

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

 .pb-card-mark {
    transition: opacity 0.3s 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%;
  }

  /* Smaller page titles on mobile */
  .page-title {
    font-size: var(--text-2xl);
  }

  /* Stack header buttons */
  .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%, #F7931E 100%);
  border-radius: var(--rounded-xl);
  padding: var(--size-6);
  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-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.run-mark-race-name {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: var(--size-1) 0;
}

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

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

.run-mark-time-label {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-bottom: var(--size-1);
}

.run-mark-time {
  font-family: 'Titillium Web', sans-serif;
  font-size: var(--text-5xl);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
}

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

.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);
  border-radius: var(--rounded-lg);
  padding: var(--size-4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-2);
}

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

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

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

.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.05em;
}

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

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

  .run-mark-time {
    font-size: var(--text-4xl);
  }

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

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

.stats-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  font-style: italic;
  color: var(--color-accent);
  margin-bottom: var(--size-1);
}

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

.stats-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-xl);
  padding: var(--size-5);
  margin-bottom: var(--size-6);
}

.stats-section--highlight {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(247, 147, 30, 0.05) 100%);
  border-color: var(--color-accent);
  border-width: 2px;
}

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

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

.stats-section-icon {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
}

.stats-section-badge {
  background: var(--color-accent);
  color: white;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--size-1) var(--size-2);
  border-radius: var(--rounded-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* Personal Bests Grid */
.pb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 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(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--pb-color);
  background: var(--pb-color-light);
}

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

.pb-card-time {
  font-family: 'Titillium Web', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  font-style: italic;
  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);
}

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

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

/* 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);
  background: var(--color-bg);
  border-left: 3px solid var(--ep-color);
  border-radius: var(--rounded-md);
  box-shadow: var(--shadow-xs);
}

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

.estimated-pace-time {
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  text-align: center;
}

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

/* 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);
  border-radius: var(--rounded-lg);
  text-decoration: none;
  transition: all 0.2s ease;
}

.shoe-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

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

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

.shoe-card-distance {
  font-weight: 700;
  color: var(--color-accent);
}

.shoe-card-progress {
  height: 6px;
  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%, #F7931E 100%);
  border-radius: var(--rounded-full);
  transition: width 0.3s ease;
}

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

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

/* Page actions (edit, delete buttons) */
.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-lg);
  padding: var(--size-4);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}

.top-three-row-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--tt-color);
}

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

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

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

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

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

.top-three-time {
  font-family: 'Titillium Web', sans-serif;
  font-size: var(--text-lg);
  font-weight: 700;
  font-style: italic;
  color: var(--color-text);
  line-height: 1;
}

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

.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;
}

/* 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: 2px solid var(--race-color);
  border-radius: var(--rounded-xl);
  padding: var(--size-4);
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.race-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  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: var(--text-sm);
  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: 600;
  padding: 2px 6px;
  border-radius: var(--rounded-full);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

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

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

.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);
}

.race-card-best-label {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-transform: uppercase;
}

.race-card-best-time {
  font-family: 'Titillium Web', sans-serif;
  font-size: var(--text-lg);
  font-weight: 700;
  font-style: italic;
  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;
  }

}