/* ===== ROOT VARIABLES & DEFAULTS ===== */
:root {
  --color-primary: #2980b9;
  --color-primary-dark: #1e6091;
  --color-primary-light: #3498db;
  --color-primary-shadow: rgba(41, 128, 185, 0.35);
  --gradient-primary: linear-gradient(
    135deg,
    var(--color-primary-light),
    var(--color-primary)
  );
  --color-accent: #f39c12;
  --color-accent-dark: #d35400;
  --color-accent-shadow: rgba(211, 84, 0, 0.35);
  --color-warning: #fbbf24;
  --color-success: #2d8b57;
  --color-danger: #c0392b;
  --color-danger-dark: #e74c3c;
  --color-danger-shadow: rgba(231, 76, 60, 0.35);
  --color-text: #374151;
  --color-text-secondary: #7f8c8d;
  --color-bg-light: #f1f5f9;
  --color-bg-card: #fff;
  --color-border: #dee2e6;
  --gradient-card-hover: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  --gradient-icon: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --gradient-glow: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
  --shadow-card-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
  --shadow-float: 0 10px 30px rgba(102, 126, 234, 0.2);
  --transition-base: all 0.3s ease;
  --transition-elastic: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== GENERAL & BODY STYLING ===== */
body {
  font-family:
    "Roboto",
    system-ui,
    -apple-system,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== ANIMATIONS ===== */
@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}
@keyframes logoGlow {
  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}
@keyframes statusPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shimmer {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===== HERO SECTION ===== */
.hero-section {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.95) 0%,
    rgba(118, 75, 162, 0.95) 100%
  );
  padding-top: 70px;
  position: relative;
  overflow: hidden;
}
.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 20s linear infinite;
}
.particle-1 {
  left: 10%;
  animation-delay: 0s;
  animation-duration: 25s;
}
.particle-2 {
  left: 30%;
  animation-delay: -5s;
  animation-duration: 30s;
}
.particle-3 {
  left: 50%;
  animation-delay: -10s;
  animation-duration: 20s;
}
.particle-4 {
  left: 70%;
  animation-delay: -15s;
  animation-duration: 35s;
}
.particle-5 {
  left: 90%;
  animation-delay: -20s;
  animation-duration: 25s;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.3rem;
  font-weight: 300;
  margin-top: 15px;
}
.hero-features-cards {
  margin: 30px 0;
}
.hero-feature-card {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15); /* было 0.2 */
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  transition: var(--transition-elastic);
  height: 100%;
  position: relative;
  overflow: hidden;
}
.hero-feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}
.hero-feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, 0.25); /* более мягкий фон */
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 30px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}
.hero-feature-card:hover::before {
  left: 100%;
}
.hero-feature-card .feature-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-icon);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  margin: 0 auto 15px;
  transition: var(--transition-base);
  box-shadow: 0 8px 16px rgba(251, 191, 36, 0.3);
}
.hero-feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 24px rgba(251, 191, 36, 0.4);
}
.hero-feature-card h5 {
  color: white;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1.1rem;
}
.hero-feature-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin: 0;
}

.partners-section {
  padding-bottom: 50px;
}
/* ===== GENERAL CONTENT SECTION ===== */
.content-section {
  background: white;
}
.bg-light {
  background-color: var(--color-bg-light) !important;
}
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 560px;
  height: 2px;
  background: linear-gradient(
    270deg,
    var(--color-primary-dark),
    var(--color-primary),
    var(--color-primary-light),
    var(--color-accent),
    var(--color-accent-dark),
    var(--color-primary-dark)
  );
  background-size: 300% 100%;
  animation: gradientFlow 5s linear infinite;
  border-radius: 100px / 6px;
  box-shadow: 0 2px 6px var(--color-primary-shadow);
}
.content-divider {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    var(--color-accent-shadow),
    rgba(255, 255, 255, 0.1),
    transparent
  );
  border-radius: 1px;
  width: 80%;
  max-width: 400px;
  margin: 0 auto;
}
/* ===== ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ FEATURES SECTION ===== */

/* Обновляем .feature-card для соответствия стилю hero-feature-card */
.feature-card {
  background: var(--color-bg-light);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Добавляем shimmer эффект */
.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

/* Hover эффекты как у hero-feature-card */
.feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 30px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.feature-card:hover::before {
  left: 100%;
}

/* Обновляем иконки для соответствия стилю */
.feature-card .feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  margin: 0 auto 15px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 16px rgba(251, 191, 36, 0.3);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 24px rgba(251, 191, 36, 0.4);
}

/* Стили для заголовков и текста */
.feature-card h5 {
  color: #374151;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.feature-card p {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin: 0;
}

/* ===== NEWS, ADS & COMPETITIONS CARDS ===== */
.news-card,
.competition-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  margin-bottom: 20px;
}
.news-card:hover,
.competition-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.news-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background-color: #f8f9fa;
}
.news-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.competition-date {
  background: var(--color-primary);
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 15px;
}

/* ===== PARTNERS SECTION ===== */

.partners-title {
  color: var(--color-text);
  font-size: 2rem;
  margin-bottom: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 25px;
  text-align: center;
}
.partner-item {
  background: var(--color-bg-light);
  border-radius: 16px;
  padding: 30px 20px;
  transition: var(--transition-elastic);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.partner-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.partner-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(41, 128, 185, 0.08),
    transparent
  );
  transition: left 0.6s ease;
}
.partner-item:hover::before {
  left: 100%;
}
.partner-icon {
  font-size: 2.8rem;
  color: var(--color-primary);
  margin-bottom: 15px;
  transition: var(--transition-base);
  display: block;
}
.partner-item:hover .partner-icon {
  transform: scale(1.1) rotate(-5deg);
  color: var(--color-primary-light);
  filter: drop-shadow(0 4px 8px rgba(41, 128, 185, 0.2));
}
.partner-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* ===== UTILITIES & HELPERS ===== */
.loading {
  opacity: 0.7;
  pointer-events: none;
}
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  .hero-section {
    padding: 20px 0;
  }
  .brand-subtitle {
    font-size: 1.1rem;
    padding: 0 15px;
  }

  #newsSection {
    padding: 20px 0;
  }

  .section-title {
    font-size: 2rem;
  }
  .hero-feature-card {
    margin-bottom: 20px;
  }
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .partner-item {
    padding: 25px 15px;
  }
  .partner-icon {
    font-size: 2.4rem;
  }
  .partner-name {
    font-size: 0.9rem;
  }
}
@media (max-width: 576px) {
  .brand-subtitle {
    font-size: 1rem;
    margin-top: 10px;
  }
}
@media (min-width: 768px) {
  .hero-features-cards {
    margin: 50px 0;
  }
}

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

/* Slider container */
.races-slider-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.races-slider-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 1rem 0.5rem;
  gap: 2rem;
}

/* Non-slider mode: flexbox layout (like Bootstrap) */
.races-slider-container:not(.slider-active) .races-slider-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  transform: none !important;
  padding: 1rem 0;
}

/* Slider mode: flex nowrap */
.races-slider-container.slider-active .races-slider-track {
  display: flex;
  flex-wrap: nowrap;
}

.races-slider-container:not(.slider-active) .race-card-wrapper {
  flex: 1 1 320px;
  max-width: 420px;
  box-sizing: border-box;
}

/* Card wrapper */
.race-card-wrapper {
  flex: 0 0 auto;
  transition: var(--transition-base);
  height: 100%;
}
/* Card width in slider mode */
.races-slider-container.slider-active .race-card-wrapper {
  width: calc((100% - 4rem) / 3);
}

/* Race card base */
.race-card {
  position: relative;
  display: block !important;
  background: white;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: inherit;
  padding: 0;
  text-decoration: none !important;
  transition: var(--transition-elastic);
  height: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  width: 100%;
}

/* Shimmer effect */
.race-card {
  display: block !important;
  position: relative;
  height: 100%;
  width: 100%;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: visible;
  text-decoration: none !important;
  transition: var(--transition-elastic);
}

.race-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.race-card:hover::before {
  left: 100%;
}

/* Card content */
.race-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 220px;
  position: relative;
  z-index: 1;
}

/* Card title */
.race-card-title {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  margin: 0 0 1rem 0 !important;
  color: var(--color-text) !important;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Status icon */
.race-status-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71 0%, #28b463 100%);
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.5);
  animation: livePulse 2s infinite;
}

@keyframes livePulseGreen {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.5);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.5);
  }
}

/* Meta badges */
.race-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  align-items: center;
}

.race-card-meta .badge {
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  padding: 0.4em 0.8em !important;
  border-radius: 8px !important;
  color: white !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: var(--transition-base);
}

.badge.bg-sport {
  background: var(--gradient-primary) !important;
  box-shadow: 0 4px 8px var(--color-primary-shadow);
}

.badge.bg-sport:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px var(--color-primary-shadow);
}

.badge.bg-distance {
  background: var(--gradient-icon) !important;
  box-shadow: 0 4px 8px rgba(251, 191, 36, 0.3);
}

.badge.bg-distance:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(251, 191, 36, 0.4);
}

/* View button */
.race-view-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--gradient-primary);
  color: white;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  transition: var(--transition-elastic);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.race-view-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.race-view-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.race-view-btn:hover::before {
  left: 100%;
}

/* Navigation buttons */
.slider-btn {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  border: none;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-elastic);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.slider-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.slider-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.slider-btn:hover::before {
  left: 100%;
}

.slider-btn:active {
  transform: translateY(0) scale(0.95);
}

.slider-btn.disabled {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  cursor: not-allowed;
  opacity: 0.6;
}

.slider-btn.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

.slider-btn.disabled::before {
  display: none;
}

/* Hide buttons by default */
.slider-btn {
  display: none;
}

/* Show in active mode */
.races-slider-wrapper:has(.slider-active) .slider-btn {
  display: flex;
}

/* No races placeholder */
.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;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
/* Media queries */
@media (max-width: 1199px) {
  .races-slider-container.slider-active .race-card-wrapper {
    width: calc((100% - 2rem) / 2);
  }
}
@media (max-width: 767px) {
  .races-slider-wrapper {
    gap: 0.5rem;
  }
  .races-slider-container.slider-active .race-card-wrapper {
    width: 100%;
  }
  .races-slider-track {
    gap: 1rem;
  }
  .race-card-content {
    padding: 25px 20px;
  }
  .race-card-title {
    font-size: 1rem !important;
  }
  .slider-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    border-radius: 12px;
  }
  .race-status-icon {
    width: 12px;
    height: 12px;
    top: 12px;
    right: 12px;
  }
  .race-view-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

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

.race-card[data-animation="slide-up"] {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-elastic);
}

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

.races-slider-track {
  will-change: transform;
}

.race-card-wrapper,
.slider-btn {
  will-change: transform;
}
