/* Modern Animated Racing UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  /* New Color Palette */
  --color-red: #D6101D;
  --color-light: #E4E5E3;
  --color-blue: #2672B8;
  --color-dark: #1D1D1D;
  --color-yellow: #FBBB44;
  
  /* Background Colors */
  --bg-dark: #1D1D1D;
  --bg-darker: #0f0f0f;
  --bg-elevated: rgba(228, 229, 227, 0.08);
  
  /* Accent Colors */
  --accent-primary: #D6101D;
  --accent-secondary: #2672B8;
  --accent-success: #FBBB44;
  --accent-danger: #D6101D;
  --accent-warning: #FBBB44;
  --accent-highlight: #FBBB44;
  
  /* Text Colors */
  --text-primary: #E4E5E3;
  --text-secondary: rgba(228, 229, 227, 0.7);
  --text-muted: rgba(228, 229, 227, 0.5);
  
  /* Border Colors */
  --border-subtle: rgba(228, 229, 227, 0.1);
  --border-medium: rgba(228, 229, 227, 0.2);
  --border-accent: rgba(228, 229, 227, 0.3);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.6);
  
  /* Glows */
  --glow-red: 0 0 20px rgba(214, 14, 29, 0.4), 0 0 40px rgba(214, 14, 29, 0.2);
  --glow-blue: 0 0 20px rgba(25, 114, 183, 0.4), 0 0 40px rgba(25, 114, 183, 0.2);
  --glow-yellow: 0 0 20px rgba(251, 186, 68, 0.4), 0 0 40px rgba(251, 186, 68, 0.2);
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: all 0.15s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  background-color: #1D1D1D;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}

/* Animated dynamic spotlights */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at -10% 50%, rgba(214, 14, 29, 0.35) 0%, rgba(214, 14, 29, 0.15) 25%, transparent 50%),
    radial-gradient(circle at 110% 50%, rgba(25, 114, 183, 0.35) 0%, rgba(25, 114, 183, 0.15) 25%, transparent 50%);
  animation: pulseSpotlights 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(28, 29, 28, 0.2) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Dynamic floating light orbs */
.container::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  top: 30%;
  left: 20%;
  background: radial-gradient(circle, rgba(251, 186, 68, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: floatOrb1 15s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes pulseSpotlights {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes floatOrb1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.12;
  }
  33% {
    transform: translate(30%, -20%) scale(1.1);
    opacity: 0.18;
  }
  66% {
    transform: translate(-20%, 30%) scale(0.9);
    opacity: 0.08;
  }
}

/* Material Icons Utility */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga';
  vertical-align: middle;
}

/* Announcement Strip */
.announcement-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(90deg, #f4c430 0%, #ffd700 50%, #f4c430 100%);
  z-index: 1001;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.announcement-content {
  display: inline-flex;
  align-items: center;
  height: 100%;
  animation: scroll-left 60s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

.announcement-text {
  display: inline-block;
  padding: 0 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  letter-spacing: 0.3px;
}

@keyframes scroll-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-33.333%);
  }
}

/* Pause animation on hover */
.announcement-strip:hover .announcement-content {
  animation-play-state: paused;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(135deg, rgba(28, 29, 28, 0.98) 0%, rgba(28, 29, 28, 0.95) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(228, 229, 227, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.navbar-content {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.8;
}

.navbar-logo {
  font-size: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.navbar-logo .material-symbols-outlined {
  font-size: 1.5rem;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.navbar-title {
  color: var(--color-light);
  font-weight: 600;
  font-size: 1.25rem;
  font-style: italic;
}

.navbar-logo-img {
  height: 50px !important;
  width: auto;
}

.navbar-tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.navbar-kofi {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  background: transparent;
}

.navbar-kofi:hover {
  color: var(--text-primary);
}

/* Style Ko-fi widget button to match navbar theme */
.navbar-kofi .kofi-button {
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  padding: 0 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: inherit !important;
}

.navbar-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  position: relative;
}

.navbar-tab:hover {
  color: var(--text-primary);
}

.navbar-tab.active {
  color: var(--color-light);
}

.navbar-tab.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 3px;
  background: #E4E5E3;
  border-radius: 2px;
}

.navbar-tab .material-symbols-outlined {
  font-size: 20px;
}

/* Mobile responsive navbar */
@media (max-width: 640px) {
  .navbar-content {
    padding: 0 1rem;
  }
  
  .navbar-brand {
    font-size: 1rem;
    gap: 0.5rem;
  }
  
  .navbar-logo {
    font-size: 1.25rem;
  }
  
  .navbar-logo .material-symbols-outlined {
    font-size: 1.25rem;
  }
  
  .navbar-title {
    display: none;
  }
  
  .navbar-tab {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    gap: 0.375rem;
  }
  
  .navbar-tab span:not(.material-symbols-outlined) {
    display: none;
  }
  
  .navbar-tab .material-symbols-outlined {
    font-size: 22px;
  }
}

.container {
  min-height: 100vh;
  padding: 0.5rem;
  padding-top: 0; /* Remove space between header and content */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

/* Blurred foggy logo background */
.container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background-image: url('/static/img/logo transparent.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.08;
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: lighten;
}

/* Landing Search Card */
.search-card {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(28, 29, 28, 0.95) 0%, rgba(28, 29, 28, 0.98) 100%);
  border: none;
  border-radius: 24px;
  padding: 1rem 1rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out;
}

/* Reduce width for the main search card specifically (does not affect fuel card) */
#search-card.search-card {
  max-width: 620px; /* reduced further per request */
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1100px) {
  /* narrower on medium screens */
  #search-card.search-card {
    max-width: 520px;
  }
}

@media (max-width: 768px) {
  /* full width on small screens */
  #search-card.search-card {
    max-width: 100%;
    margin: 0.5rem;
  }
}

/* Inner padding specifically for the search card so content isn't flush to the edges */
#search-card.search-card .card-content {
  padding: 1.25rem 1.5rem; /* moderate inner padding */
}

@media (max-width: 768px) {
  #search-card.search-card .card-content {
    padding: 1rem; /* slightly smaller on mobile */
  }
}

/* When the search card is minimized (header mode), reduce the inner padding so it
   aligns visually with the compact header layout. Keep responsive reduction
   for small screens. */
#search-card.search-card.minimized .card-content {
  padding: 0.5rem 0.75rem; /* compact padding for header mode */
}

@media (max-width: 768px) {
  #search-card.search-card.minimized .card-content {
    padding: 0.5rem; /* ensure it stays compact on mobile */
  }
}

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

.search-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(90deg, 
    #D6101D 0%, 
    #2672B8 50%, 
    #D6101D 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  -webkit-mask: linear-gradient(#E4E5E3 0 0) content-box, linear-gradient(#E4E5E3 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#E4E5E3 0 0) content-box, linear-gradient(#E4E5E3 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}

@keyframes shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* Transform states */
.search-card.minimized {
  position: fixed;
  top: 116px; /* 36px announcement + 64px navbar + 16px spacing */
  left: 50%;
  transform: translateX(-50%);
  bottom: auto;
  right: auto;
  max-width: fit-content;
  width: auto;
  margin: 0;
  padding: 0.875rem 1.25rem;
  border-radius: 16px;
  z-index: 1000;
  height: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: shrinkToWidget 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes shrinkToWidget {
  0% {
    top: 40vh;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 24px;
    padding: 2.5rem 2.5rem;
    max-width: 600px;
    width: 600px;
  }
  100% {
    top: 116px; /* 36px announcement + 64px navbar + 16px spacing */
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px;
    padding: 0.875rem 1.25rem;
    max-width: fit-content;
    width: auto;
  }
}

.card-content {
  text-align: center;
  transition: var(--transition-smooth);
  position: relative;
  z-index: 1;
}

.search-card.minimized .card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 1rem;
  flex-wrap: nowrap;
}

.emblem {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(251, 186, 68, 0.6));
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.emblem .material-symbols-outlined {
  font-size: 3rem;
  display: block;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes sparkle-rotate {
  0%, 100% { 
    transform: rotate(0deg) scale(1);
    opacity: 0.9;
  }
  25% { 
    transform: rotate(-10deg) scale(1.1);
    opacity: 1;
  }
  50% { 
    transform: rotate(10deg) scale(0.95);
    opacity: 0.8;
  }
  75% { 
    transform: rotate(-5deg) scale(1.05);
    opacity: 1;
  }
}

.search-card.minimized .emblem {
  font-size: 2rem;
  margin: 0;
  flex-shrink: 0;
}

.search-card.minimized .emblem .material-symbols-outlined {
  font-size: 2rem;
}

.brand {
  font-size: 1.8rem; /* updated per request */
  font-weight: 900;
  color: #E4E5E3;
  margin-bottom: 2.5rem;
  margin-top: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.sparkle {
  display: inline-block;
  animation: sparkle-rotate 3s ease-in-out infinite;
  font-size: 0.8em;
  margin: 0 0.3rem;
}

.sparkle .material-symbols-outlined {
  font-size: 1.6rem;
  vertical-align: middle;
}

.sparkle:nth-child(1) {
  animation-delay: 0s;
}

.sparkle:nth-child(3) {
  animation-delay: 1.5s;
}

.search-card.minimized .brand {
  display: none;
}

.search-card.minimized .sparkle {
  display: none;
}

.search-card.minimized .sparkle .material-symbols-outlined {
  font-size: 1.125rem;
}

.lead {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
}

.search-card.minimized .lead {
  display: none;
}

.filters {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
}

.search-card.minimized .filters {
  display: flex;
  gap: 0.625rem;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
}

.input-group {
  text-align: left;
  transition: var(--transition-smooth);
}

.search-card.minimized .input-group {
  flex: 0 1 auto;
  max-width: 200px;
  min-width: 120px;
}

.header-search-group {
  display: none;
}

.header-tools-toggle {
  display: none;
}

.search-card.minimized .header-tools-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(228, 229, 227, 0.1);
  border: 2px solid rgba(228, 229, 227, 0.3);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
}

.search-card.minimized .header-tools-toggle:hover {
  border-color: var(--color-light);
  background: rgba(228, 229, 227, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.header-tools-icon {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.header-tools-icon .dot {
  width: 4px;
  height: 4px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-tools-toggle.active .header-tools-icon .dot {
  width: 18px;
  height: 2px;
  border-radius: 1px;
}

.header-tools-toggle.active .header-tools-icon .dot:nth-child(1) {
  transform: translateY(0);
}

.header-tools-toggle.active .header-tools-icon .dot:nth-child(2) {
  transform: scaleX(0.8);
}

.header-tools-toggle.active .header-tools-icon .dot:nth-child(3) {
  transform: translateY(0);
}

.header-tools-container {
  position: fixed;
  display: none;
  flex-direction: column;
  gap: 1rem;
  background: rgba(28, 29, 28, 0.95);
  border: 2px solid rgba(228, 229, 227, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  min-width: 350px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.header-tools-container.expanded {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.header-tools-container::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(228, 229, 227, 0.3);
}

.header-search-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header-search-group label {
  font-size: 0.875rem;
  font-weight: 600;
}

.sort-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sort-group label {
  font-size: 0.875rem;
  font-weight: 600;
}

.sort-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sort-group select {
  pointer-events: auto;
  cursor: pointer;
  flex: 1;
}

.sort-order-btn {
  background: rgba(228, 229, 227, 0.1);
  border: 2px solid rgba(228, 229, 227, 0.3);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
  min-width: 40px;
  height: 40px;
}

.sort-order-btn:hover:not(:disabled) {
  border-color: var(--color-light);
  background: rgba(228, 229, 227, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.weather-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weather-filter-group label {
  font-size: 0.875rem;
  font-weight: 600;
}

.weather-options {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.radio-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: var(--transition-smooth);
  background: rgba(228, 229, 227, 0.05);
  border: 2px solid rgba(228, 229, 227, 0.2);
}

.radio-option:hover {
  background: rgba(228, 229, 227, 0.1);
  border-color: rgba(228, 229, 227, 0.3);
  transform: translateY(-1px);
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-option input[type="radio"]:checked + .radio-label {
  color: #FBBB44;
  font-weight: 700;
}

.radio-option input[type="radio"]:checked ~ * {
  background: rgba(38, 114, 184, 0.15);
  border-color: rgba(38, 114, 184, 0.4);
  box-shadow: 0 0 0 2px rgba(38, 114, 184, 0.2);
}

.radio-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.radio-option:has(input[value="wet"]:checked) {
  background: rgba(120, 160, 200, 0.15);
  border-color: rgba(120, 160, 200, 0.4);
  box-shadow: 0 0 0 2px rgba(120, 160, 200, 0.2);
}

.radio-option:has(input[value="wet"]:checked) .radio-label {
  color: #E4E5E3;
}

.sort-order-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sort-order-btn .material-symbols-outlined {
  font-size: 1.25rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sort-order-btn.ascending .material-symbols-outlined {
  transform: rotate(180deg);
}

.header-search-group input {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.9375rem;
  border: 2px solid rgba(228, 229, 227, 0.15);
  background: rgba(28, 29, 28, 0.6);
  color: var(--text-primary);
  border-radius: 12px;
  transition: var(--transition-fast);
  font-family: var(--font-family);
  backdrop-filter: blur(10px);
}

.header-search-group input:hover {
  border-color: rgba(228, 229, 227, 0.25);
  background: rgba(28, 29, 28, 0.8);
}

.header-search-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(28, 29, 28, 0.9);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.header-search-group input::placeholder {
  color: var(--text-muted);
}

.input-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition-smooth);
}

.search-card.minimized .input-group label {
  display: none;
}

select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

select option {
  background: var(--bg-dark);
  color: var(--text-primary);
  padding: 0.5rem;
}

.search-card.minimized select {
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  font-size: 0.875rem;
  background-position: right 0.75rem center;
  background: rgba(228, 229, 227, 0.1);
  border: 2px solid rgba(228, 229, 227, 0.3);
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.search-card.minimized select:hover {
  border-color: var(--color-light);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
  background: rgba(228, 229, 227, 0.15);
}

.search-card.minimized select:focus {
  border-color: var(--color-light);
  box-shadow: 0 0 0 4px rgba(228, 229, 227, 0.25);
  transform: translateY(-2px) scale(1.02);
}

select:hover {
  border-color: var(--color-light);
  box-shadow: none;
}

select:focus {
  outline: none;
  border-color: var(--color-light);
  box-shadow: 0 0 0 3px rgba(228, 229, 227, 0.2);
}

.card-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  transition: var(--transition-smooth);
}

.search-card.minimized .card-actions {
  margin-left: auto;
  flex-shrink: 0;
}

.btn {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-spring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.search-card.minimized .btn {
  padding: 0.625rem 1.75rem;
  font-size: 0.875rem;
  min-width: 110px;
}

.search-card.minimized #search {
  min-width: 140px;
}

.search-card.minimized .btn .material-symbols-outlined {
  font-size: 18px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: #E4E5E3;
  color: #1D1D1D;
  box-shadow: none;
  flex: 1;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  display: none;
}

.btn-primary:hover::after {
  display: none;
}

.btn-primary:hover {
  background: #E4E5E3;
  color: #1D1D1D;
}

.btn-primary:active {
  background: #E4E5E3;
  color: #1D1D1D;
}

.search-card.minimized .btn-primary {
  flex: 0;
}

.btn-primary .material-symbols-outlined {
  transition: none;
}

.btn-primary:hover .material-symbols-outlined {
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-medium);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.chips {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  min-height: 2rem;
  transition: var(--transition-smooth);
}

.search-card.minimized .chips {
  display: none;
}

.chip {
  padding: 0.5rem 1rem;
  background: rgba(251, 186, 68, 0.1);
  border: 1px solid rgba(251, 186, 68, 0.3);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-yellow);
  animation: chipIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 0 10px rgba(251, 186, 68, 0.2);
}

.chip .material-symbols-outlined {
  font-size: 18px;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Compact Header (duplicate controls) */
.compact-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 2rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-100%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  display: none;
}

.compact-header.visible {
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.header-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.emblem-small {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.brand-small {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-filters {
  display: flex;
  gap: 1rem;
  flex: 1;
  max-width: 600px;
}

.select-compact {
  flex: 1;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: var(--transition-smooth);
}

.select-compact:hover {
  border-color: var(--accent-primary);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 1.25rem;
}

.btn-icon:hover {
  transform: scale(1.05);
  box-shadow: var(--glow-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

.results-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.results-count strong {
  color: var(--accent-success);
  font-size: 1.125rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  padding: 0.5rem 1rem;
}

.btn-text:hover {
  color: var(--text-primary);
}

/* Results Section */
.results-section {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
}

.results-section.visible {
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.results-section.with-header {
  padding-top: 6rem;
}

/* When the search card is minimized (header mode), set results spacing
   relative to the actual height of the minimized search card. We use a
   CSS variable `--search-card-min-height` (set by JS) so the gap tracks
   the card's size even when it changes on resize or content. */
:root {
  --search-card-min-height: 0px;
}

#search-card.search-card.minimized ~ #results-section {
  padding-top: calc(var(--search-card-min-height, 0px) + 0.5rem);
  padding-bottom: 3rem; /* keep some breathing room above the footer */
}

@media (max-width: 768px) {
  #search-card.search-card.minimized ~ #results-section {
    padding-top: calc(var(--search-card-min-height, 0px) * 0.9 + 0.25rem);
    padding-bottom: 2rem;
  }
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Setup Cards */
.setup-card {
  background: linear-gradient(135deg, rgba(28, 29, 28, 0.8) 0%, rgba(28, 29, 28, 0.9) 100%);
  border: 2px solid rgba(228, 229, 227, 0.1);
  border-radius: 20px;
  padding: 1.5rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.setup-card:nth-child(1) { animation-delay: 0.05s; }
.setup-card:nth-child(2) { animation-delay: 0.1s; }
.setup-card:nth-child(3) { animation-delay: 0.15s; }
.setup-card:nth-child(4) { animation-delay: 0.2s; }
.setup-card:nth-child(5) { animation-delay: 0.25s; }
.setup-card:nth-child(6) { animation-delay: 0.3s; }
.setup-card:nth-child(7) { animation-delay: 0.35s; }
.setup-card:nth-child(8) { animation-delay: 0.4s; }
.setup-card:nth-child(9) { animation-delay: 0.45s; }

.setup-card:hover {
  transform: translateY(-6px) scale(1.02);
  background: linear-gradient(135deg, rgba(29, 29, 29, 0.9) 0%, rgba(29, 29, 29, 0.95) 100%);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.download-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  background: rgba(38, 114, 184, 0.15);
  border: 1px solid rgba(38, 114, 184, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #FBBB44;
  backdrop-filter: blur(10px);
}

.weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  background: rgba(38, 114, 184, 0.15);
  border: 1px solid rgba(38, 114, 184, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #FBBB44;
  backdrop-filter: blur(10px);
}

.weather-badge-wet {
  background: rgba(120, 160, 200, 0.15);
  border: 1px solid rgba(120, 160, 200, 0.3);
  color: #E4E5E3;
}

.card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: flex-end;
}

.position-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border-medium);
  color: var(--text-primary);
  flex-shrink: 0;
}

.position-badge.p1 {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  border: none;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.position-badge.p2 {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: #000;
  border: none;
}

.position-badge.p3 {
  background: linear-gradient(135deg, #cd7f32, #f4a460);
  color: #000;
  border: none;
}

.card-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-track {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.card-car {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.card-setup-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.card-date .material-symbols-outlined {
  font-size: 1rem;
}

.card-meta {
  display: none;
}

.meta-item {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-success);
  text-align: right;
  flex-shrink: 0;
}

.card-actions-btn {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-small {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-small .material-symbols-outlined {
  font-size: 18px;
}

.btn-copy {
  background: #2672B8;
  color: white;
  border: 1px solid #2672B8;
}

.btn-copy:hover {
  background: rgba(25, 114, 183, 0.8);
  border-color: #2672B8;
  transform: translateY(-2px);
}

.btn-download {
  background: #FBBB44;
  color: #1D1D1D;
  border: 1px solid #FBBB44;
}

.btn-download:hover {
  background: rgba(251, 186, 68, 0.8);
  transform: translateY(-2px);
}

.btn-view {
  background: #D6101D;
  color: white;
  border: 1px solid #D6101D;
}

.btn-view:hover {
  background: rgba(214, 14, 29, 0.8);
  transform: translateY(-2px);
}

/* Expanded JSON View */
.card-json {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 1rem;
}

.card-json.expanded {
  max-height: 500px;
  opacity: 1;
  overflow: auto;
}

.card-json pre {
  background: var(--bg-darker);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--accent-success);
  overflow-x: auto;
}

/* Group sections */
.group-section {
  margin-bottom: 2rem;
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group-header {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-header:hover {
  border-color: #E4E5E3;
  box-shadow: none;
}

.group-header.expanded {
  border-color: var(--accent-success);
  box-shadow: var(--glow-success);
}

.group-title-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.caret {
  font-size: 1rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.group-header.expanded .caret {
  transform: rotate(90deg);
  color: var(--accent-primary);
}

.group-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.group-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.group-badge {
  padding: 0.375rem 0.875rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-success);
}

.group-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.group-content.expanded {
  max-height: 10000px;
  opacity: 1;
}

/* Empty state */
.empty-state {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  z-index: 100;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }
  
  .search-card {
    margin-top: 10vh;
    padding: 1rem 1rem;
  }
  
  .fuel-calculator-card {
    padding: 0.75rem 1rem; /* add breathing room inside the card */
  }

  /* On small screens stack inputs and results vertically */
  .fuel-calculator-content {
    flex-direction: column;
  }

  .fuel-results-section {
    flex: 1 1 auto;
    max-width: none;
  }
  
  .search-card.minimized {
    padding: 0.75rem 1rem;
  }
  
  .search-card.minimized .card-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .search-card.minimized .filters {
    width: 100%;
  }
  
  .search-card.minimized .input-group {
    max-width: 100%;
  }
  
  .search-card.minimized .card-actions {
    width: 100%;
    margin: 0;
  }
  
  .brand {
    font-size: 2rem;
  }
  
  .emblem {
    font-size: 3rem;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .compact-header {
    padding: 0.75rem 1rem;
  }
  
  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .header-filters {
    order: 3;
    width: 100%;
    max-width: 100%;
  }
  
  .header-right {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .results-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .setup-card {
    padding: 1.25rem;
  }
  
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .card-time {
    text-align: left;
    margin-top: 0.5rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Modal Overlay for Setup Detail View */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 24px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl), 0 0 100px rgba(59, 130, 246, 0.3);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-success));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

/* Two-column modal layout */
.modal-main {
  display: flex;
  flex-direction: row;
  height: 100%;
  overflow: hidden;
}

.modal-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Support panel sidebar */
.modal-support-panel {
  width: 280px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
  border-left: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  flex-shrink: 0;
}

.modal-support-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: bounce 2s ease-in-out infinite;
}

.modal-support-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 0;
}

.modal-support-panel p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.modal-support-panel p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-support-panel > p:last-child {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent-success);
}

.modal-support-kofi {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
  .modal-main {
    flex-direction: column;
  }
  
  .modal-support-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: 1.5rem;
    gap: 0.75rem;
  }
  
  .modal-support-icon {
    font-size: 2rem;
    margin-bottom: 0;
  }
  
  .modal-support-title {
    font-size: 1rem;
  }
  
  .modal-support-panel p {
    font-size: 0.8rem;
  }
}

.modal-header {
  padding: 2rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-shrink: 0;
}

.modal-info {
  flex: 1;
  min-width: 0;
}

.modal-track {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.modal-car {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.modal-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.modal-meta-item {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-meta-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-secondary);
}

.modal-meta-item strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.modal-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-success);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition-smooth);
  z-index: 1;
  padding: 0;
}

.modal-close .material-symbols-outlined {
  font-size: 24px;
}

.modal-close:hover {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem;
}

.modal-json {
  background: var(--bg-darker);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-x: auto;
}

.modal-json pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--accent-success);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.modal-footer {
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.modal-btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-btn .material-symbols-outlined {
  font-size: 20px;
}

.modal-btn-copy {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 2px solid var(--border-medium);
}

.modal-btn-copy:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: var(--glow-primary);
}

.modal-btn-download {
  background: #FBBB44;
  color: #1D1D1D;
}

.modal-btn-download:hover {
  background: rgba(251, 187, 68, 0.8);
  transform: translateY(-2px);
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Support Notification Modal */
.support-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.support-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.support-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  max-width: 600px;
  width: 90%;
  padding: 3rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.support-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.support-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.support-modal-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 1.5rem;
  animation: bounce 2s ease-in-out infinite;
}

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

.support-modal-title {
  font-size: 1.75rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.support-modal-message {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  text-align: center;
}

.support-modal-highlight {
  background: rgba(251, 186, 68, 0.1);
  border: 1px solid rgba(251, 186, 68, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: center;
}

.support-modal-highlight strong {
  color: var(--color-yellow);
  font-size: 1.1rem;
}

.support-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.support-modal-actions > div:first-child {
  flex: 2;
}

.support-modal-btn {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.support-modal-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
}

.support-modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

.support-modal-btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.support-modal-btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* Ko-fi button sizing */
.support-modal-actions img.kofiimg {
  height: 50px !important;
}

.support-modal-actions a.kofi-button {
  padding: 1rem 2rem !important;
  font-size: 1.1rem !important;
  min-width: 250px !important;
}

.support-modal-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Modal responsive */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 1rem;
  }
  
  .modal-content {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 16px;
  }
  
  .modal-header {
    padding: 1.5rem 1.5rem 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .modal-car {
    font-size: 1.5rem;
  }
  
  .modal-time {
    font-size: 1.75rem;
    text-align: left;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .modal-footer {
    padding: 1rem 1.5rem;
  }
  
  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* Stats Footer */
.stats-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(19, 19, 26, 0.95) 20%, var(--bg-card) 100%);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  padding: 0.75rem 2rem;
  z-index: 999;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 60px;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.stats-footer.expanded {
  max-height: 600px;
  padding: 2rem 2rem 1rem;
  cursor: default;
}

.stats-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
  opacity: 0.5;
  transition: var(--transition-smooth);
}

.stats-footer.expanded::before {
  width: 100px;
  opacity: 1;
}

.footer-peek {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-stats-group {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.footer-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(228, 229, 227, 0.1);
  padding: 0.375rem 0.875rem;
  border-radius: 12px;
  border: 1px solid rgba(228, 229, 227, 0.2);
  font-size: 0.8rem;
}

.footer-visitors {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(228, 229, 227, 0.1);
  padding: 0.375rem 0.875rem;
  border-radius: 12px;
  border: 1px solid rgba(228, 229, 227, 0.2);
  font-size: 0.8rem;
}

#visitor-count-footer,
#setup-count-footer {
  font-weight: 900;
  color: #FBBB44;
  font-size: 1rem;
}

.stats-footer.expanded .footer-peek {
  opacity: 0;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.stats-footer.expanded .stats-container {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.stats-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.stats-section:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.stats-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stats-loading {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.875rem;
}

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.stats-item:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateX(4px);
}

.stats-item-rank {
  font-size: 1rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 1.75rem;
  text-align: center;
}

.stats-item-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.stats-item-count {
  font-weight: 700;
  color: var(--color-light);
  background: rgba(228, 229, 227, 0.1);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

.stats-item:nth-child(1) .stats-item-rank {
  font-size: 1.25rem;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-item:nth-child(2) .stats-item-rank {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-item:nth-child(3) .stats-item-rank {
  background: linear-gradient(135deg, #cd7f32, #e8a87c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
  pointer-events: none;
}

.stats-footer.expanded .footer-bottom {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.footer-bottom a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.footer-bottom a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .stats-footer {
    padding: 0.5rem 1rem;
    max-height: 50px;
  }
  
  .stats-footer.expanded {
    max-height: 700px;
    padding: 1.5rem 1rem 1rem;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .stats-section {
    padding: 1.25rem;
  }
  
  .stats-title {
    font-size: 1rem;
  }
  
  .stats-item {
    padding: 0.5rem 0.75rem;
  }
  
  .stats-item-name {
    font-size: 0.8rem;
  }
  
  .footer-peek {
    font-size: 0.75rem;
    gap: 1rem;
  }
  
  .footer-visitors {
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
  }
  
  #visitor-count-footer {
    font-size: 0.875rem;
  }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: linear-gradient(135deg, rgba(28, 29, 28, 0.95) 0%, rgba(28, 29, 28, 0.98) 100%);
  border: 1px solid rgba(228, 229, 227, 0.5);
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(214, 14, 29, 0.2);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.toast-removing {
  animation: toastSlideOut 0.3s ease-out forwards;
}

.toast-icon {
  flex-shrink: 0;
  font-size: 24px;
  color: var(--color-yellow);
}

.toast-message {
  flex: 1;
  color: var(--color-light);
  font-size: 0.95rem;
  line-height: 1.4;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  z-index: 100;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(228, 229, 227, 0.2);
  border-top: 4px solid #D6101D;
  border-right: 4px solid #2672B8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Spinning animation for loading icons */
.spinning {
  animation: spin 1s linear infinite;
  display: inline-block;
}

.loading-spinner p {
  color: var(--text-secondary);
  font-size: 1rem;
}

@media (max-width: 768px) {
  #toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: unset;
    max-width: unset;
  }
}

/* Context Menu Styles */
.context-menu {
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: 8px 0;
  min-width: 160px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  transition: all 0.15s ease;
}

.context-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: white;
  transition: background-color 0.15s ease;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.context-menu-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--color-yellow);
}

/* Loading Overlay Styles */
.loading-spinner {
  text-align: center;
  color: white;
}

.loading-spinner .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.loading-spinner p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fuel Calculator Styles */
.fuel-results {
  margin-top: 2rem;
  animation: fadeIn 0.3s ease-in-out;
}

.result-card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.result-card h3 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--background-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.result-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.result-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.result-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

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

/* Fuel Calculator Styles */
.fuel-calculator-card .card-content {
  padding: 0.75rem 1rem; /* ensure inner content is padded away from edges */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fuel-calculator-card {
  padding: 0.75rem 1rem; /* add breathing room inside the card */
}

.fuel-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.fuel-calculator-content {
  /* Use a two-column grid so Race Parameters and Fuel Requirements are equal width */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 0.5rem;
}

/* Layout balance: make inputs take the flexible space and results a fixed narrower column */
.fuel-input-section {
  /* Ensure sections fill their grid cell */
  width: 100%;
}

/* Add a subtle border around the input section to visually group inputs */
.fuel-input-section {
  border: 1px solid rgba(255,255,255,0.04);
  padding: 0.75rem;
  border-radius: 10px;
}

.fuel-results-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fuel-input-section h2,
.fuel-results-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.fuel-input-section .input-group {
  margin-bottom: 1rem; /* increase vertical spacing between input groups */
}

.fuel-input-section .input-group label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.time-input-group {
  display: flex;
  gap: 1rem;
}

.time-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

/* Positioning for numeric steppers */
.time-input,
.fuel-input {
  position: relative;
}

.numeric-stepper {
  position: absolute;
  /* position the steppers inside the input field (right side) */
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2; /* ensure steppers appear above the input */
}


.numeric-stepper button {
  width: 18px;
  height: 14px;
  padding: 0;
  border: none;
  background: transparent; /* transparent background per request */
  color: var(--text-secondary); /* grey text color */
  opacity: 0.95;
  font-size: 10px;
  line-height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: pointer;
}

.numeric-stepper button:hover {
  background: rgba(255,255,255,0.02); /* subtle hover without changing layout */
  color: rgba(255,255,255,0.9);
}

.numeric-stepper button:active {
  transform: translateY(1px);
}

.time-input input {
  flex: 1;
  padding: 0.9rem; /* slightly larger input vertical padding for breathing room */
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

/* Hide native browser number input spin buttons inside the fuel input section to avoid duplicates */
.fuel-input-section input[type="number"]::-webkit-outer-spin-button,
.fuel-input-section input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fuel-input-section input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
  padding-right: 36px; /* leave room for custom steppers */
}

.time-input input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.time-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 60px;
}

.fuel-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fuel-input input {
  flex: 1;
  padding: 0.9rem; /* slightly larger input vertical padding for breathing room */
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.fuel-input input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Add a clearer border around race parameter inputs */
.fuel-input-section input[type="number"],
.fuel-input-section input[type="text"] {
  border: 1px solid rgba(228,229,227,0.14); /* slightly brighter */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 1px 0 rgba(0,0,0,0.04);
  background: rgba(255,255,255,0.02);
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.fuel-input-section input[type="number"]:focus,
.fuel-input-section input[type="text"]:focus {
  outline: none;
  border-color: rgba(251,186,68,0.95); /* highlight on focus */
  box-shadow: 0 0 0 4px rgba(251,186,68,0.08), 0 2px 6px rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.03);
}

.fuel-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 50px;
}

.fuel-calculate-section {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Make the calculate button size to its content (don't stretch full width) */
.fuel-calculate-section .btn-primary {
  flex: 0; /* don't grow */
  width: auto; /* fit content */
  min-width: initial; /* remove any minimum width enforcement */
}

/* Ensure the calculate button has comfortable padding and a minimum width so
   the text doesn't get clipped or the button collapse to a square on some
   layouts. Add a small top margin so it doesn't overlap neighboring elements. */
.fuel-calculate-section {
  margin-top: 0.6rem;
}

.fuel-calculate-section .btn-primary {
  padding: 0.9rem 1.8rem; /* more horizontal padding for breathing room */
  min-width: 160px; /* larger minimum width so text fits comfortably */
  border-radius: 12px;
  line-height: 1.05; /* ensure vertical alignment */
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

@media (max-width: 520px) {
  .fuel-calculate-section .btn-primary {
    min-width: 140px;
    padding: 0.75rem 1.25rem;
  }
}

.fuel-results-section {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(212, 29, 29, 0.1) 100%);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  min-height: 160px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem; /* increase vertical gap between result items */
  /* Make result text slightly larger and bolder */
  font-size: 1rem;
  color: var(--text-primary);
}

.fuel-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0; /* increase vertical padding */
  border-bottom: 1px solid var(--border-color);
}

.fuel-result-item:last-child {
  border-bottom: none;
  margin-top: auto;
}

.fuel-results-section .result-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.fuel-results-section .result-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Checkbox Styles */
.checkbox-item {
  justify-content: flex-start !important;
  padding: 0.75rem 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-label input[type="checkbox"] {
  /* keep checkbox in DOM and keyboard-focusable but visually hidden */
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
}

.checkmark {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
}

.checkmark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: left 0.22s cubic-bezier(.2,.9,.3,1);
}

    .checkbox-label input[type="checkbox"]:checked + .checkmark {
      background: var(--color-yellow); /* active state uses site yellow */
      border-color: transparent;
    }

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  left: calc(100% - 20px);
}

/* Focus state when keyboard navigating */
.checkbox-label:focus-within .checkmark {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Result Input Styles */
.result-input {
  background: transparent; /* clear to underlying card background */
  border: 1px solid rgba(251, 187, 68, 0.14); /* subtle yellow border */
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  color: var(--color-yellow); /* use site yellow for value */
  font-weight: 700;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  text-align: center;
  min-width: 80px;
  cursor: text; /* normal text cursor instead of disabled */
}

.result-input:focus {
  outline: none;
  border-color: var(--color-yellow);
}

/* Ensure disabled/readonly styling stays interactive-looking */
.result-input[disabled],
.result-input[readonly] {
  cursor: text;
  background: transparent;
  color: var(--color-yellow);
  opacity: 1; /* prevent browser dimming */
  border-color: rgba(251, 187, 68, 0.14);
}

.result-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.result-value {
  font-weight: 700;
  color: var(--accent-primary);
  font-size: 1rem;
  font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
  .fuel-calculator-content {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .fuel-calculator-card .card-content {
    padding: 0;
  }
  
  .fuel-title {
    font-size: 1.75rem;
  }
  
  .time-input-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .time-input {
    width: 100%;
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 100px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 300px;
  word-wrap: break-word;
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  border-left: 4px solid #2E7D32;
}

.toast-error {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  border-left: 4px solid #B71C1C;
}

.toast-info {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  border-left: 4px solid #0D47A1;
}
