/* Results Page Custom Styles */

/* Header Styles */
.results-header {
  background: #fff;
  border-bottom: 1px solid var(--light-color);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 101;
}

.results-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-logo {
  max-width: 140px;
}

.results-logo img {
  width: 100%;
  height: auto;
}

.results-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.results-nav a {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--dark-color);
  transition: var(--transition);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.results-nav a:hover {
  color: var(--accent-color);
}

/* Banner / Hero style for Results page */
.results-hero {
  background: linear-gradient(135deg, var(--dark-color) 0%, #1e2027 100%);
  color: #fff;
  padding: 50px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.results-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(112, 163, 177, 0.15) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  z-index: 1;
}

.results-hero .container {
  position: relative;
  z-index: 2;
}

.results-hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.results-hero h1 span {
  color: var(--accent-color);
}

.results-hero p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* Sticky Navigation (Mobile tab-bar) */
.sticky-nav-bar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid var(--light-color);
  padding: 8px 0;
}

.sticky-nav-container {
  display: flex;
  gap: 8px;
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sticky-nav-container::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.sticky-nav-container {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.sticky-nav-btn {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  background: var(--light-color);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  color: var(--dark-color);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sticky-nav-btn span.dist {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}

.sticky-nav-btn span.label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.8;
  margin-top: 2px;
}

.sticky-nav-btn:hover {
  background: rgba(112, 163, 177, 0.1);
  color: var(--accent-color);
}

.sticky-nav-btn.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(112, 163, 177, 0.3);
}

/* Segmented Control / Sub-toggle Buttons */
.segment-wrapper {
  max-width: 600px;
  margin: 30px auto 25px;
  padding: 0 16px;
}

.segment-control {
  display: flex;
  background-color: var(--light-color);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.segment-btn {
  flex: 1;
  text-align: center;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: var(--dark-color);
  cursor: pointer;
  transition: var(--transition);
}

.segment-btn:hover {
  color: var(--accent-color);
}

.segment-btn.active {
  background-color: #fff;
  color: var(--accent-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Race Container Toggling */
.race-results-container {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.race-results-container.active {
  display: block;
}

/* Segment View Toggling */
.segment-view {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.segment-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections styling */
.results-section {
  padding: 40px 0 80px;
}

.results-section:nth-of-type(even) {
  background-color: var(--light-color);
}

.results-section-header {
  margin-bottom: 25px;
  text-align: center;
}

.results-section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark-color);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.results-section-header h2 span.badge {
  background-color: var(--accent-color);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-body);
}

/* Category header styling */
.category-subheader {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-color);
  margin: 40px 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-subheader span.count {
  font-size: 0.85rem;
  color: rgba(40, 43, 55, 0.6);
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

/* Athlete List/Row Design (Mobile First) */
.finisher-list {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.finisher-row {
  display: grid;
  grid-template-columns: 50px 1fr 110px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--light-color);
  transition: var(--transition);
}

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

.finisher-row:hover {
  background-color: rgba(112, 163, 177, 0.02);
}

/* Podium Placement Badges */
.pos-badge {
  width: 36px;
  height: 36px;
  background-color: var(--light-color);
  color: var(--dark-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  border: 1.5px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

/* Gold Medal */
.pos-badge.pos-1 {
  background: linear-gradient(135deg, #ffe066 0%, #ffd700 100%);
  color: #fff;
  border-color: #ffe066;
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Silver Medal */
.pos-badge.pos-2 {
  background: linear-gradient(135deg, #e9ecef 0%, #c0c0c0 100%);
  color: #fff;
  border-color: #e9ecef;
  box-shadow: 0 4px 10px rgba(192, 192, 192, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Bronze Medal */
.pos-badge.pos-3 {
  background: linear-gradient(135deg, #f4b277 0%, #cd7f32 100%);
  color: #fff;
  border-color: #f4b277;
  box-shadow: 0 4px 10px rgba(205, 127, 50, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Special Podium Row Highlights (Soft card backgrounds) */
.finisher-row.podium-1 {
  background-color: rgba(255, 243, 205, 0.25);
}
.finisher-row.podium-1:hover {
  background-color: rgba(255, 243, 205, 0.4);
}

.finisher-row.podium-2 {
  background-color: rgba(226, 227, 229, 0.15);
}
.finisher-row.podium-2:hover {
  background-color: rgba(226, 227, 229, 0.3);
}

.finisher-row.podium-3 {
  background-color: rgba(248, 215, 218, 0.15);
}
.finisher-row.podium-3:hover {
  background-color: rgba(248, 215, 218, 0.3);
}

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

.finisher-name {
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.95rem;
  word-break: break-word;
  text-transform: uppercase;
}

.finisher-sub {
  font-size: 0.75rem;
  color: rgba(40, 43, 55, 0.65);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.finisher-sub span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.finisher-sub i {
  color: var(--accent-color);
  font-size: 0.7rem;
}

/* Final Time styling */
.finisher-time {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-color);
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.finisher-time i {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Empty/No results state */
.no-results {
  padding: 40px;
  text-align: center;
  color: rgba(40, 43, 55, 0.5);
}

.no-results i {
  font-size: 2.5rem;
  color: rgba(112, 163, 177, 0.4);
  margin-bottom: 12px;
  display: block;
}

.no-results h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--dark-color);
}

/* Media query overrides */
@media (max-width: 600px) {
  .results-header {
    padding: 12px 0;
  }
  .results-header .container {
    padding: 0 16px;
  }
  .results-logo {
    max-width: 120px;
  }
  .results-nav {
    gap: 12px;
  }
  .results-nav a {
    font-size: 0.85rem;
  }
  
  .results-hero {
    padding: 40px 0 30px;
  }
  .results-hero h1 {
    font-size: 2.2rem;
  }
  .results-hero p {
    font-size: 0.95rem;
    padding: 0 10px;
  }
  
  .sticky-nav-bar {
    padding: 6px 0;
  }
  .sticky-nav-container {
    width: 95%;
  }
  .sticky-nav-btn {
    border-radius: 8px;
    padding: 8px 6px;
    min-width: 85px;
  }
  .sticky-nav-btn span.dist {
    font-size: 0.9rem;
  }
  .sticky-nav-btn span.label {
    font-size: 0.55rem;
    margin-top: 1px;
  }
  
  .segment-wrapper {
    margin: 20px auto 15px;
  }
  .segment-btn {
    font-size: 0.78rem;
    padding: 8px 2px;
  }
  
  .results-section {
    padding: 20px 0 50px;
  }
  .results-section-header h2 {
    font-size: 1.8rem;
  }
  
  .finisher-row {
    padding: 10px 12px;
    gap: 10px;
    grid-template-columns: 42px 1fr 90px;
  }
  .pos-badge {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .finisher-name {
    font-size: 0.88rem;
  }
  .finisher-time {
    font-size: 0.95rem;
  }
  
  .category-subheader {
    font-size: 1.1rem;
    margin: 30px 0 12px 0;
  }
}
