/* =========================================
   ROOT VARIABLES
   ========================================= */
:root {
  --al-primary-gradient: linear-gradient(135deg, #3498db, #2980b9);
  --al-text-main: #374151;
  --al-text-muted: #7f8c8d;
  --al-bg-card: #ffffff;
  --al-border: #e5e7eb;
  --al-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --al-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --al-radius: 16px;
  --gradient-icon: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --color-border: #dee2e6;
  --color-text-secondary: #7f8c8d;
}

/* =========================================
   SLIDER LAYOUT & STRUCTURE
   ========================================= */
.races-slider-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.races-slider-container {
  flex: 1;
  overflow: hidden;
  padding: 10px 5px 20px 5px;
}

.races-slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  gap: 1.5rem;
  width: 100%;
}

.races-slider-container:not(.slider-active) .races-slider-track {
  flex-wrap: wrap;
  justify-content: center;
  transform: none !important;
}

.races-slider-container:not(.slider-active) .race-card-wrapper {
  flex: 0 1 350px;
  max-width: 400px;
  width: 100%;
}

.races-slider-container.slider-active .races-slider-track {
  flex-wrap: nowrap;
}

.races-slider-container.slider-active .race-card-wrapper {
  flex-shrink: 0;
}

.race-card-wrapper {
  height: 100%;
}

/* =========================================
   RACE CARD COMPONENT (CORRECTED DESIGN)
   ========================================= */
.race-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--al-bg-card);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius);
  box-shadow: var(--al-shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  text-decoration: none !important;
}

.race-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--al-shadow-lg);
  border-color: rgba(41, 128, 185, 0.3);
}

.race-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.race-status-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: livePulse 2s infinite;
  z-index: 2;
}

.race-card-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-right: 15px;
}

.sport-icon-outline {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 2px solid #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: #fff;
  transition: all 0.3s ease;
}

.race-card:hover .sport-icon-outline {
  transform: scale(1.05);
}

.race-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.race-card-title {
  font-size: 1.1rem;
  /* font-weight: 700; */
  color: var(--al-text-main);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.race-card-meta-new {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--al-text-muted);
}

.meta-item i {
  font-size: 1.1em;
  color: #9ca3af;
}

.race-view-btn {
  display: block;
  width: 100%;
  padding: 0.7rem;
  text-align: center;
  background: transparent;
  color: #2980b9;
  font-weight: 600;
  border: 1px solid rgba(41, 128, 185, 0.3);
  border-radius: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.95rem;
}

.race-view-btn:hover {
  background-color: rgba(41, 128, 185, 0.1);
  border-color: rgba(41, 128, 185, 0.5);
  color: #2980b9;
  transform: translateY(-1px);
  box-shadow: none;
}
/* =========================================
   SPORT TYPE COLORS (OUTLINE VARIANTS)
   ========================================= */
.sport-icon-outline.sport-run {
  border-color: #10b981;
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.05);
}

.sport-icon-outline.sport-road,
.sport-icon-outline.sport-mtb,
.sport-icon-outline.sport-cycling {
  border-color: #374151;
  color: #374151;
  background-color: rgba(55, 65, 81, 0.05);
}

.sport-icon-outline.sport-swim {
  border-color: #06b6d4;
  color: #06b6d4;
  background-color: rgba(6, 182, 212, 0.05);
}

.sport-icon-outline.sport-ski {
  border-color: #64748b;
  color: #64748b;
  background-color: rgba(100, 116, 139, 0.05);
}

.sport-icon-outline.sport-tri {
  border-color: #f59e0b;
  color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.05);
}

.sport-icon-outline.bg-sport,
.sport-icon-outline.sport-default {
  border-color: #3498db;
  color: #3498db;
}

/* =========================================
   NAVIGATION & UTILITIES
   ========================================= */
.slider-btn {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--al-text-main);
  box-shadow: var(--al-shadow-sm);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  z-index: 2;
}

.races-slider-wrapper:has(.slider-active) .slider-btn {
  display: flex;
}

.slider-btn:hover:not(.disabled) {
  background: var(--al-primary-gradient);
  color: #fff;
  transform: scale(1.1);
}

.slider-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f3f4f6;
}

.no-races-placeholder {
  width: 100%;
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border: 2px dashed var(--color-border, #e5e7eb);
  border-radius: 20px;
  color: var(--color-text-secondary);
  font-size: 1.125rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  grid-column: 1 / -1;
}

.no-races-placeholder::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmerFlow 3s ease-in-out infinite;
}

.no-races-placeholder i {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  background: var(--gradient-icon);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: bounce 2s infinite;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes livePulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmerFlow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

[data-animation="slide-up"] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

[data-animation="slide-up"].animate {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1199px) {
  .races-slider-container.slider-active .race-card-wrapper {
    width: calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 767px) {
  .races-slider-wrapper {
    flex-direction: column;
    padding: 0 10px;
  }

  .slider-btn {
    width: 40px;
    height: 40px;
  }

  .races-slider-container.slider-active .race-card-wrapper {
    width: 100%;
  }

  .race-card-title {
    font-size: 1.1rem;
  }
}

.race-card-footer {
  display: flex;
  gap: 10px;
  width: 100%;
}

.race-view-btn {
  flex: 1;
}

.race-btn-map {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  background-color: #fff;
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.race-btn-map:hover {
  background-color: #dc2626;
  color: #fff;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.race-btn-map:hover i {
  animation: bounce 0.5s;
}
