html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(128, 17, 31, 0.2), transparent 36%),
    radial-gradient(circle at 88% 92%, rgba(88, 17, 25, 0.18), transparent 34%),
    linear-gradient(180deg, #fcf8f8 0%, #f7eded 100%);
  color: #32181b;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-navbar {
  background: linear-gradient(100deg, #5f111a 0%, #7a1520 55%, #4f0e15 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(76, 7, 16, 0.28);
  backdrop-filter: blur(8px);
  padding: 0.7rem 1rem;
}

.app-brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.app-nav-link {
  color: rgba(255, 255, 255, 0.94) !important;
  border-radius: 999px;
  padding: 0.42rem 0.86rem !important;
  line-height: 1.25;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.app-dropdown-menu {
  background: linear-gradient(180deg, #6b101a 0%, #540d15 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 26px rgba(35, 6, 10, 0.4);
  border-radius: 0.85rem;
  padding: 0.3rem;
  min-width: 13.5rem;
  z-index: 1050;
}

.app-dropdown-item {
  color: rgba(255, 255, 255, 0.95);
  border-radius: 0.62rem;
  padding: 0.45rem 0.72rem;
}

.app-dropdown-item:hover,
.app-dropdown-item:focus-visible {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.16);
}

.app-main {
  width: min(1720px, 98vw);
  margin: 1.4rem auto 1.4rem;
  padding: 0 0.2rem;
  flex: 1;
}

.app-content {
  background-color: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(126, 20, 34, 0.12);
  box-shadow: 0 12px 40px rgba(64, 12, 19, 0.11);
  border-radius: 1rem;
  padding: clamp(0.75rem, 1.25vw, 1.3rem);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  animation: content-enter 0.42s ease-out;
}

.app-footer {
  background: linear-gradient(100deg, #5f111a 0%, #7a1520 55%, #4f0e15 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #f6e6e8;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  line-height: 1.2;
}

.app-footer .container {
  color: #f6e6e8;
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991.98px) {
  .app-navbar {
    padding: 0.65rem 0.8rem;
  }

  .app-nav-link {
    border-radius: 0.72rem;
  }

  .app-main {
    width: min(1600px, 97.5vw);
    margin-top: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .app-content,
  .app-nav-link {
    animation: none;
    transition: none;
  }
}

html[data-bs-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 10%, rgba(151, 34, 49, 0.34), transparent 38%),
    radial-gradient(circle at 90% 90%, rgba(111, 22, 32, 0.27), transparent 34%),
    linear-gradient(180deg, #1b1013 0%, #150d0f 100%);
  color: #f7e8ea;
}

html[data-bs-theme="dark"] .app-content {
  background-color: rgba(24, 17, 19, 0.84);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .app-nav-link:hover,
html[data-bs-theme="dark"] .app-nav-link:focus-visible {
  background-color: rgba(255, 255, 255, 0.2);
}

.custom-width {
    max-width: 1500px;
}

input[readonly] {
    background-color: transparent;
    background-color: #EEEEEE;
    cursor: not-allowed;
}

/* ---------- Home page ---------- */
.home-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 3vw, 2.5rem);
    margin-bottom: 2rem;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.14), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(0, 0, 0, 0.25), transparent 50%),
        linear-gradient(120deg, #5f111a 0%, #7a1520 55%, #3d0a11 100%);
    box-shadow: 0 18px 48px rgba(64, 12, 19, 0.28);
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.35;
    pointer-events: none;
}

.home-hero-inner {
    position: relative;
    max-width: 780px;
}

.home-hero-eyebrow {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.home-hero-title {
    font-size: clamp(1.75rem, 3.4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.home-hero-lead {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.5rem;
}

.home-hero-btn {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    color: #6b101a;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-hero-btn:hover,
.home-hero-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
    color: #4f0e15;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    font-weight: 700;
    margin: 0;
    color: #4f0e15;
}

.section-subtitle {
    margin: 0.25rem 0 0;
    color: rgba(79, 14, 21, 0.7);
    font-size: 0.95rem;
}

.race-card {
    position: relative;
    background-color: #fff;
    border: 1px solid rgba(126, 20, 34, 0.1);
    border-radius: 0.9rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 18px rgba(64, 12, 19, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.race-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(64, 12, 19, 0.18);
    border-color: rgba(126, 20, 34, 0.22);
}

.race-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.race-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.race-card:hover .race-card-media img {
    transform: scale(1.05);
}

.race-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: rgba(95, 17, 26, 0.92);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.race-card-body {
    padding: 1rem 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.race-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #32181b;
}

.race-card-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.35rem;
    color: rgba(50, 24, 27, 0.82);
    font-size: 0.9rem;
}

.race-card-meta li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.race-card-meta i {
    width: 1rem;
    color: #7a1520;
}

.race-card-link {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    color: #7a1520;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.race-card-link:hover,
.race-card-link:focus-visible {
    color: #4f0e15;
    border-color: #4f0e15;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed rgba(126, 20, 34, 0.3);
    border-radius: 0.9rem;
    color: rgba(79, 14, 21, 0.75);
    background-color: rgba(255, 255, 255, 0.6);
}

.empty-state-icon {
    font-size: 2.2rem;
    color: #7a1520;
    margin-bottom: 0.5rem;
}

/* Dark theme overrides for home page */
html[data-bs-theme="dark"] .section-title {
    color: #f7e8ea;
}

html[data-bs-theme="dark"] .section-subtitle {
    color: rgba(247, 232, 234, 0.7);
}

html[data-bs-theme="dark"] .race-card {
    background-color: #1f1518;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .race-card-title {
    color: #f7e8ea;
}

html[data-bs-theme="dark"] .race-card-meta {
    color: rgba(247, 232, 234, 0.85);
}

html[data-bs-theme="dark"] .race-card-link {
    color: #f2a4ad;
}

html[data-bs-theme="dark"] .race-card-link:hover,
html[data-bs-theme="dark"] .race-card-link:focus-visible {
    color: #ffd4d9;
    border-color: #ffd4d9;
}

html[data-bs-theme="dark"] .empty-state {
    background-color: rgba(31, 21, 24, 0.7);
    border-color: rgba(247, 232, 234, 0.25);
    color: rgba(247, 232, 234, 0.8);
}

/* ---------- Breadcrumbs ---------- */
nav[aria-label="breadcrumb"] {
  margin-bottom: 1rem;
}

.breadcrumb {
  margin-bottom: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(122, 21, 32, 0.11) 0%, rgba(122, 21, 32, 0.06) 100%);
  border: 1px solid rgba(122, 21, 32, 0.16);
  box-shadow: 0 5px 16px rgba(64, 12, 19, 0.08);
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.breadcrumb-item,
.breadcrumb-item a {
  color: #5f111a;
  font-weight: 600;
  text-decoration: none;
}

.breadcrumb-item a:hover,
.breadcrumb-item a:focus-visible {
  color: #7a1520;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: rgba(95, 17, 26, 0.7);
  font-weight: 700;
}

.breadcrumb-item.active {
  color: rgba(50, 24, 27, 0.86);
  font-weight: 700;
}

html[data-bs-theme="dark"] .breadcrumb {
  background: linear-gradient(90deg, rgba(242, 164, 173, 0.2) 0%, rgba(242, 164, 173, 0.08) 100%);
  border-color: rgba(242, 164, 173, 0.26);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

html[data-bs-theme="dark"] .breadcrumb-item,
html[data-bs-theme="dark"] .breadcrumb-item a {
  color: #ffd9de;
}

html[data-bs-theme="dark"] .breadcrumb-item.active {
  color: #ffffff;
}

html[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 217, 222, 0.75);
}
