:root {
  --color-bg: #050506;
  --color-bg-elevated: #101015;
  --color-bg-elevated-soft: #15151c;
  --color-border-subtle: #272733;
  --color-primary: #f5b301; /* gold/yellow accent */
  --color-primary-soft: rgba(245, 179, 1, 0.16);
  --color-primary-hover: #ffd451;
  --color-secondary: #ff6b6b; /* coral accent for energy */
  --color-accent: #4ecdc4; /* teal accent for freshness */
  --color-text: #f7f7f7;
  --color-text-muted: #aaaaaa;
  --color-card-shadow: rgba(0, 0, 0, 0.6);
  --color-success: #51cf66;
  --color-warning: #ffd43b;

  --gradient-primary: linear-gradient(135deg, #f5b301 0%, #ffd451 100%);
  --gradient-hero: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #f5b301 100%);
  --gradient-card: radial-gradient(circle at top left, #20202b 0%, #101015 45%, #050506 100%);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease-out;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  --header-height: 64px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);

  /* Animation */
  --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Accessibility utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Global reset & base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: radial-gradient(circle at top, #1b1b25 0%, #050506 45%, #000 100%);
}

body.app {
  display: flex;
  flex-direction: column;
}

/* Header */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  min-height: 64px; /* Fallback height */
  backdrop-filter: blur(20px) saturate(180%);
  background: linear-gradient(
    135deg,
    rgba(5, 5, 6, 0.95) 0%,
    rgba(16, 16, 21, 0.9) 25%,
    rgba(10, 10, 15, 0.92) 75%,
    rgba(5, 5, 6, 0.88) 100%
  );
  /* Fallback background for older browsers */
  background-color: rgba(5, 5, 6, 0.9);
  border-bottom: 2px solid rgba(245, 179, 1, 0.3);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(245, 179, 1, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all var(--transition-med);
  overflow: hidden;
  position: relative;
  display: block; /* Ensure it's always displayed */
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 179, 1, 0.03) 25%,
    rgba(245, 179, 1, 0.08) 50%,
    rgba(245, 179, 1, 0.03) 75%,
    transparent 100%
  );
  animation: headerShimmer 8s ease-in-out infinite;
}

@keyframes headerShimmer {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(50%); }
}

.app-header:hover {
  background: linear-gradient(
    135deg,
    rgba(8, 8, 12, 0.96) 0%,
    rgba(20, 20, 28, 0.92) 25%,
    rgba(15, 15, 22, 0.94) 75%,
    rgba(8, 8, 12, 0.9) 100%
  );
  box-shadow: 
    0 6px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(245, 179, 1, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(245, 179, 1, 0.5);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(245, 179, 1, 0.02);
  border: 1px solid rgba(245, 179, 1, 0.08);
  transition: all var(--transition-med);
  cursor: pointer;
}

.header-logo:hover {
  background: rgba(245, 179, 1, 0.06);
  border-color: rgba(245, 179, 1, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.logo-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #0b0905;
  box-shadow: 
    0 0 0 1px rgba(245, 179, 1, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(245, 179, 1, 0.1);
  overflow: hidden;
  animation: logoGlow 4s ease-in-out infinite;
  transition: all var(--transition-med);
}

.logo-mark:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 
    0 0 0 2px rgba(245, 179, 1, 0.6),
    0 12px 28px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(245, 179, 1, 0.2);
}

@keyframes logoGlow {
  0%, 100% { 
    box-shadow: 
      0 0 0 1px rgba(245, 179, 1, 0.4),
      0 8px 20px rgba(0, 0, 0, 0.8),
      0 0 20px rgba(245, 179, 1, 0.1);
  }
  50% { 
    box-shadow: 
      0 0 0 2px rgba(245, 179, 1, 0.7),
      0 10px 24px rgba(0, 0, 0, 0.9),
      0 0 30px rgba(245, 179, 1, 0.2);
  }
  100% { box-shadow: 0 0 0 1px rgba(245, 179, 1, 0.6), 0 12px 24px rgba(245, 179, 1, 0.2); }
}

.logo-icon {
  position: relative;
  z-index: 2;
  animation: iconBounce 2s ease-in-out infinite;
}

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

.logo-pulse {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-primary);
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
}

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

.beta-badge {
  background: linear-gradient(135deg, var(--color-secondary), #ff5252);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 10px;
  letter-spacing: 0.1em;
  animation: fadeInUp 0.8s var(--bounce) 0.5s both;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.beta-badge:hover {
  animation: badgePulse 0.6s ease-in-out infinite alternate;
}

@keyframes badgePulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5); }
}

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

.stats-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 12px;
  background: rgba(245, 179, 1, 0.03);
  border: 1px solid rgba(245, 179, 1, 0.1);
  border-radius: var(--radius-md);
  transition: all var(--transition-med);
  cursor: pointer;
}

.stats-display:hover {
  background: rgba(245, 179, 1, 0.08);
  border-color: rgba(245, 179, 1, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.stat-label {
  font-size: 9px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(245, 179, 1, 0.3);
  animation: statPulse 3s ease-in-out infinite;
}

@keyframes statPulse {
  0%, 100% { 
    transform: scale(1); 
    text-shadow: 0 0 10px rgba(245, 179, 1, 0.3);
  }
  50% { 
    transform: scale(1.02); 
    text-shadow: 0 0 12px rgba(245, 179, 1, 0.4);
  }
}

.logo-text {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 16px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all var(--transition-med);
}

.header-logo:hover .logo-text {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main layout */

.app-main {
  flex: 1 1 auto;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 32px;
}

/* Hero */

.hero {
  margin-top: 20px;
  margin-bottom: 28px;
  position: relative;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.02em;
  font-weight: 700;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInScale 1s var(--bounce) both;
}

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

.hero-accent {
  display: inline-block;
  animation: bounce 1s ease-in-out infinite alternate 1.5s;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

.hero p {
  margin-top: 8px;
  margin-bottom: 16px;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.5;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: rgba(245, 179, 1, 0.05);
  border: 1px solid rgba(245, 179, 1, 0.1);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all var(--transition-med);
}

.hero-stat:hover {
  background: rgba(245, 179, 1, 0.08);
  border-color: rgba(245, 179, 1, 0.2);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* Controls (search + filters) */

.controls {
  position: sticky;
  top: calc(var(--header-height) + 0px);
  z-index: 1000;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 6, 1) 0%,
    rgba(5, 5, 6, 0.96) 40%,
    rgba(5, 5, 6, 0.9) 100%
  );
  padding-bottom: 12px;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 179, 1, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.search-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
}

#search-input {
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  background: rgba(16, 16, 21, 0.92);
  color: var(--color-text);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

#search-input::placeholder {
  color: #5e5e6b;
}

#search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 
    0 0 0 2px rgba(245, 179, 1, 0.4),
    0 6px 20px rgba(245, 179, 1, 0.2),
    0 0 30px rgba(245, 179, 1, 0.1);
  background: rgba(18, 18, 25, 0.98);
  transform: translateY(-2px);
  backdrop-filter: blur(16px);
}

.filters-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
  flex: 1 1 0;
}

.filter-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.filter-group input {
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  background: rgba(16, 16, 21, 0.92);
  color: var(--color-text);
  transition: border-color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.filter-group select {
  border-radius: 12px;
  border: 1px solid var(--color-border-subtle);
  padding: 10px 36px 10px 14px;
  font-size: 13px;
  outline: none;
  background: linear-gradient(135deg, 
    rgba(20, 20, 28, 0.95) 0%,
    rgba(16, 16, 21, 0.92) 100%);
  color: var(--color-text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5b301' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

.filter-group select:hover {
  border-color: rgba(245, 179, 1, 0.5);
  background: linear-gradient(135deg, 
    rgba(22, 22, 32, 0.98) 0%,
    rgba(18, 18, 25, 0.95) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: rgba(245, 179, 1, 0.8);
  box-shadow: 
    0 0 0 2px rgba(245, 179, 1, 0.3),
    0 4px 12px rgba(245, 179, 1, 0.15);
  background: rgba(18, 18, 25, 0.95);
  transform: translateY(-1px);
  backdrop-filter: blur(8px);
}

.filter-group select:focus {
  background: linear-gradient(135deg, 
    rgba(24, 24, 35, 0.98) 0%,
    rgba(20, 20, 28, 0.95) 100%);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5b301' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

/* Select option styling */
.filter-group select option {
  background: rgba(16, 16, 21, 0.95);
  color: var(--color-text);
  padding: 8px 12px;
  border: none;
}

.filter-group select option:checked,
.filter-group select option:hover {
  background: linear-gradient(135deg, 
    rgba(245, 179, 1, 0.2) 0%,
    rgba(245, 179, 1, 0.1) 100%);
  color: var(--color-primary);
}

/* Clear button */

.ghost-button {
  border-radius: 999px;
  border: 1px solid rgba(245, 179, 1, 0.28);
  background: transparent;
  padding: 8px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.ghost-button:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-hover);
  color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.65);
}

/* Map + list layout */

.layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr);
  gap: 14px;
  align-items: stretch;
}

/* Map */

.map {
  border-radius: var(--radius-lg);
  background: #000;
  min-height: 380px;
  box-shadow: 0 18px 38px var(--color-card-shadow);
  border: 1px solid rgba(245, 179, 1, 0.16);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

/* Leaflet overrides to fit dark theme */

.leaflet-container {
  background: #050506;
  font-family: inherit;
}

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.6) !important;
  color: #999 !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #101015;
  color: var(--color-text);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.7);
}

.leaflet-marker-icon.runners-marker {
  border-radius: 50%;
}

/* Custom popup styles */

.leaflet-popup.custom-popup .leaflet-popup-content-wrapper {
  background: linear-gradient(135deg, #15151e 0%, #101015 100%);
  border: 1px solid rgba(245, 179, 1, 0.2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
}

.leaflet-popup.custom-popup .leaflet-popup-tip {
  background: #15151e;
  border: 1px solid rgba(245, 179, 1, 0.2);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: 12px 16px !important;
}

/* Enhanced marker styles */

.runners-marker {
  transition: all var(--transition-fast) !important;
}

.runners-marker:hover {
  transform: scale(1.2) !important;
}

/* List panel */

.list-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 600px;
  min-height: 380px;
}

.results-summary {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 4px 4px 0 4px;
}

.workout-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* List panel enhancements */

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}

.view-toggles {
  display: flex;
  gap: 2px;
  background: rgba(16, 16, 21, 0.9);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.view-toggle {
  background: transparent;
  border: none;
  padding: 8px 12px;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-med);
  font-size: 16px;
  position: relative;
  overflow: hidden;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-med);
  border-radius: inherit;
}

.view-toggle span {
  position: relative;
  z-index: 2;
  transition: all var(--transition-med);
}

.view-toggle:hover {
  color: var(--color-text);
  background: rgba(245, 179, 1, 0.1);
  transform: translateY(-1px);
}

.view-toggle.active {
  color: #0b0905;
  background: var(--gradient-primary);
  box-shadow: 0 4px 12px rgba(245, 179, 1, 0.3);
  transform: translateY(-1px);
}

.view-toggle.active::before {
  opacity: 1;
}

.view-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(245, 179, 1, 0.2);
}

.list-footer {
  padding: 12px 4px 0;
  text-align: center;
}

/* Enhanced workout cards */

.workout-list {
  transition: all var(--transition-med);
}

/* Base workout card styles */
.workout-card {
  background: radial-gradient(circle at top left, #20202b 0%, #101015 45%, #050506 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 179, 1, 0.08);
  padding: 16px 18px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all var(--transition-med);
  backdrop-filter: blur(8px);
}

.workout-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(245, 179, 1, 0.1) 0%,
    transparent 50%,
    rgba(245, 179, 1, 0.05) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}

.workout-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 179, 1, 0.2);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(245, 179, 1, 0.1),
    0 0 20px rgba(245, 179, 1, 0.05);
  background: radial-gradient(circle at top left, #262636 0%, #12121a 45%, #070708 100%);
}

.workout-card:hover::before {
  opacity: 1;
}

.workout-card.active {
  border-color: rgba(245, 179, 1, 0.4);
  background: radial-gradient(circle at top left, #252534 0%, #141420 45%, #080809 100%);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(245, 179, 1, 0.3),
    0 0 25px rgba(245, 179, 1, 0.1);
}

.workout-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.workout-card-title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--color-text);
  margin: 0;
  flex: 1;
}

.workout-tag {
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(245, 179, 1, 0.12);
  color: var(--color-primary-hover);
  border: 1px solid rgba(245, 179, 1, 0.25);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.workout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition-fast);
}

.meta-pill:hover {
  background: rgba(245, 179, 1, 0.08);
  border-color: rgba(245, 179, 1, 0.2);
}

.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: #70707d;
  font-weight: 500;
}

.meta-value {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 500;
}

.workout-card-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.location-text {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.3;
  flex: 1;
}

.primary-button {
  border-radius: var(--radius-pill);
  border: none;
  padding: 10px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 650;
  cursor: pointer;
  background: var(--gradient-primary);
  color: #0b0905;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(245, 179, 1, 0.3);
  transition: all var(--transition-fast);
  min-width: 110px;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(245, 179, 1, 0.4),
    0 0 15px rgba(245, 179, 1, 0.2);
  filter: brightness(1.05);
}

.primary-button:active {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(245, 179, 1, 0.4);
}

.workout-list.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  align-items: start;
}

.workout-list.grid-view .workout-card {
  min-height: 360px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, 
    rgba(28, 28, 38, 0.95) 0%,
    rgba(20, 20, 28, 0.92) 50%,
    rgba(16, 16, 21, 0.9) 100%);
  border: 1px solid rgba(245, 179, 1, 0.12);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.workout-list.grid-view .workout-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0.6;
  transition: all var(--transition-fast);
}

.workout-list.grid-view .workout-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(245, 179, 1, 0.3);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(245, 179, 1, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: linear-gradient(145deg, 
    rgba(32, 32, 45, 0.98) 0%,
    rgba(24, 24, 35, 0.95) 50%,
    rgba(18, 18, 25, 0.92) 100%);
}

.workout-list.grid-view .workout-card::before {
  opacity: 0.3;
}

.workout-list.grid-view .workout-card:hover::before {
  opacity: 1;
  height: 6px;
  box-shadow: 0 2px 12px rgba(245, 179, 1, 0.4);
}

.workout-list.grid-view .workout-card-header {
  padding: 20px 20px 0 20px;
  margin-bottom: 16px;
  position: relative;
}

.workout-list.grid-view .workout-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.workout-list.grid-view .workout-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 12px;
  background: rgba(245, 179, 1, 0.15);
  border: 1px solid rgba(245, 179, 1, 0.3);
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.workout-list.grid-view .workout-meta {
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  flex: 1;
}

.workout-list.grid-view .meta-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}

.workout-list.grid-view .meta-pill:hover {
  background: rgba(245, 179, 1, 0.08);
  border-color: rgba(245, 179, 1, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.workout-list.grid-view .meta-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #70707d;
  font-weight: 600;
}

.workout-list.grid-view .meta-value {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
}

.workout-list.grid-view .difficulty-badge {
  margin: 0;
  align-self: stretch;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 11px;
}

.workout-list.grid-view .distance-indicator {
  margin: 0;
  padding: 10px 12px;
  background: rgba(78, 205, 196, 0.12);
  border: 1px solid rgba(78, 205, 196, 0.25);
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workout-list.grid-view .workout-card-footer {
  margin-top: auto;
  padding: 0 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workout-list.grid-view .location-text {
  font-size: 12px;
  margin: 0;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  line-height: 1.4;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.workout-list.grid-view .primary-button {
  width: 100%;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  background: var(--gradient-primary);
  box-shadow: 
    0 4px 16px rgba(245, 179, 1, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
}

.workout-list.grid-view .primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(245, 179, 1, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.4);
  filter: brightness(1.1);
}

/* Floating action styles */

.floating-actions {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  color: #0b0905;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-med);
  animation: fabEnter 0.5s var(--bounce);
}

.fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: var(--shadow-xl);
}

@keyframes fabEnter {
  from { opacity: 0; transform: scale(0) rotate(180deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Difficulty badges */

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.difficulty-beginner {
  background: rgba(81, 207, 102, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(81, 207, 102, 0.3);
}

.difficulty-intermediate {
  background: rgba(255, 212, 59, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(255, 212, 59, 0.3);
}

.difficulty-advanced {
  background: rgba(255, 107, 107, 0.15);
  color: var(--color-secondary);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Distance indicators */

.distance-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 500;
}

/* Loading animations */

.loading-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* Enhanced hover states */

.workout-card:hover .workout-tag {
  background: rgba(245, 179, 1, 0.2);
  border-color: rgba(245, 179, 1, 0.5);
  transform: scale(1.05);
}

.workout-card:hover .primary-button {
  animation: buttonPulse 0.6s ease-in-out;
}

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

/* Staggered animations */

.workout-card {
  animation: slideInCard 0.5s var(--bounce) both;
}

.workout-card:nth-child(1) { animation-delay: 0.1s; }
.workout-card:nth-child(2) { animation-delay: 0.2s; }
.workout-card:nth-child(3) { animation-delay: 0.3s; }
.workout-card:nth-child(4) { animation-delay: 0.4s; }
.workout-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInCard {
  from { opacity: 0; transform: translateX(-20px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* Count-up animation */

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

.stat-number.animating {
  animation: countUp 0.5s ease-out;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Enhanced mobile responsiveness */

@media (max-width: 640px) {
  .hero-stats {
    gap: 12px;
  }

  .hero-stat {
    padding: 8px 12px;
    min-width: 70px;
  }

  .stat-number {
    font-size: 16px;
  }

  .stat-text {
    font-size: 10px;
  }

  .floating-actions {
    bottom: 15px;
    right: 15px;
    gap: 8px;
  }

  .fab {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

/* Header mobile responsiveness */

@media (max-width: 768px) {
  .app-header {
    height: 60px;
    --header-height: 60px;
  }
  
  .header-inner {
    padding: 0 16px;
  }
  
  .header-logo {
    gap: 8px;
    padding: 6px 10px;
  }
  
  .logo-mark {
    width: 32px;
    height: 32px;
  }
  
  .logo-text {
    font-size: 14px;
  }
  
  .beta-badge {
    font-size: 8px;
    padding: 2px 6px;
    margin-left: 8px;
  }
  
  .stats-display {
    padding: 6px 10px;
  }
  
  .stat-label {
    font-size: 8px;
  }
  
  .stat-value {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .stats-display {
    display: none; /* Hide on very small screens */
  }
  
  .header-logo {
    gap: 6px;
    padding: 4px 8px;
  }
  
  .logo-text {
    font-size: 13px;
  }
  
  .beta-badge {
    margin-left: 6px;
  }
  
  .header-inner {
    padding-inline: 12px;
  }
  
  .filters-row {
    gap: 8px;
  }
  
  .filter-group {
    min-width: 48%;
    flex: 1 1 48%;
  }
  
  .layout {
    gap: 10px;
  }
  
  .workout-card {
    padding: 12px 14px;
  }
  
  .primary-button {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }
  
  .hero-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .hero-stat {
    flex: 1 1 30%;
    min-width: 85px;
  }
  
  .floating-actions {
    bottom: 16px;
    right: 16px;
  }
  
  .fab {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

/* Comprehensive Responsive Grid & Layout */

@media (max-width: 1024px) {
  .workout-list.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
  }
  
  .workout-list.grid-view .workout-card {
    min-height: 340px;
    max-height: 400px;
  }
  
  .layout {
    grid-template-columns: 1fr; /* Single column layout since map is hidden */
    gap: 16px;
  }
  
  .map {
    display: none; /* Hide map on tablet for cleaner experience */
  }
  
  .list-panel {
    order: 1; /* List takes priority and full width */
  }
  
  .fab {
    display: none; /* Hide map center button since map is hidden */
  }
}

@media (max-width: 768px) {
  .app-main {
    padding-inline: 12px;
  }
  
  .workout-list.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }
  
  .workout-list.grid-view .workout-card {
    min-height: 380px;
    max-height: 440px;
  }
  
  .workout-list.grid-view .workout-card-header {
    padding: 16px 16px 0 16px;
  }
  
  .workout-list.grid-view .workout-card-title {
    font-size: 16px;
  }
  
  .workout-list.grid-view .workout-tag {
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    font-size: 9px;
  }
  
  .workout-list.grid-view .workout-meta {
    padding: 0 16px;
    gap: 10px;
  }
  
  .workout-list.grid-view .meta-pill {
    padding: 6px 8px;
  }
  
  .workout-list.grid-view .workout-card-footer {
    padding: 0 16px 16px 16px;
  }
  
  .workout-list.grid-view .primary-button {
    padding: 11px 14px;
    font-size: 12px;
  }

  .workout-list.grid-view .workout-card {
    min-height: 300px;
    padding: 15px;
  }
  
  .workout-list.grid-view .workout-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .workout-list.grid-view .location-text {
    text-align: center;
    margin-bottom: 8px;
  }
  
  .workout-list.grid-view .primary-button {
    width: 100%;
    max-width: none;
    padding: 10px 16px;
    font-size: 12px;
    margin-left: 0;
  }
  
  .filters-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .filter-group {
    flex: 1 1 45%;
    min-width: 140px;
  }
  
  .map {
    display: none; /* Hide map on mobile for cleaner experience */
  }
  
  .fab {
    display: none; /* Hide map center button since map is hidden */
  }
}

@media (max-width: 480px) {
  .workout-list.grid-view {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .workout-list.grid-view .workout-card {
    min-height: 300px;
    padding: 16px;
    display: flex;
    flex-direction: column;
  }
  
  .workout-list.grid-view .workout-card-footer {
    margin-top: auto;
    padding-top: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .workout-list.grid-view .location-text {
    text-align: center;
    margin-bottom: 8px;
  }
  
  .workout-list.grid-view .primary-button {
    width: 100%;
    max-width: none;
    padding: 12px 16px;
    font-size: 13px;
    margin-left: 0;
    align-self: stretch;
  }
  
  .filter-group {
    flex: 1 1 100%;
    min-width: unset;
  }
  
  .hero-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .hero-stat {
    flex: 1 1 30%;
    min-width: 85px;
  }
  
  .list-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .results-summary {
    order: 2;
  }
  
  .view-toggles {
    order: 1;
    align-self: flex-end;
  }
}

/* Mobile Filter Toggle */

.search-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.search-input-wrapper #search-input {
  flex: 1;
}

.filters-toggle {
  display: none; /* Hidden on desktop */
  background: rgba(245, 179, 1, 0.1);
  border: 1px solid rgba(245, 179, 1, 0.3);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-width: 80px;
}

.filters-toggle:hover {
  background: rgba(245, 179, 1, 0.15);
  border-color: rgba(245, 179, 1, 0.5);
  transform: translateY(-1px);
}

.filters-toggle.active {
  background: var(--color-primary);
  color: #0b0905;
}

.toggle-icon {
  margin-right: 4px;
}

.toggle-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Mobile Filters Behavior */

@media (max-width: 768px) {
  .filters-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .filters-row {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-med);
    margin-top: 0;
  }
  
  .filters-row.expanded {
    max-height: 400px;
    opacity: 1;
    margin-top: 12px;
  }
  
  .controls {
    padding-bottom: 8px;
  }
  
  .search-row {
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .search-input-wrapper {
    flex-direction: column;
    gap: 8px;
  }
  
  .filters-toggle {
    align-self: stretch;
    justify-content: center;
    min-width: auto;
  }
  
  .filters-row.expanded {
    max-height: 500px;
    margin-top: 8px;
  }
}

/* App Footer */

.app-footer {
  margin-top: auto;
  padding: 24px 20px;
  text-align: center;
  background: linear-gradient(
    to top,
    rgba(5, 5, 6, 0.95) 0%,
    rgba(16, 16, 21, 0.8) 50%,
    transparent 100%
  );
  border-top: 1px solid rgba(245, 179, 1, 0.08);
  backdrop-filter: blur(12px);
}

.app-footer small {
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
  line-height: 1.4;
}

.app-footer:hover small {
  opacity: 1;
}

.footer-accent {
  color: var(--color-primary);
  font-weight: 600;
}

/* Enhanced List View Styles */

.workout-list:not(.grid-view) .workout-card {
  animation: listCardEnter 0.4s ease-out both;
  padding: 18px 20px;
  border-left: 3px solid transparent;
  transition: all var(--transition-med);
}

.workout-list:not(.grid-view) .workout-card:hover {
  border-left-color: var(--color-primary);
  padding-left: 22px;
  background: radial-gradient(circle at top left, #2a2a3a 0%, #15151f 50%, #070708 100%);
}

.workout-list:not(.grid-view) .workout-card.active {
  border-left-color: var(--color-primary);
  padding-left: 22px;
}

.workout-list:not(.grid-view) .workout-card-header {
  align-items: center;
  margin-bottom: 8px;
}

.workout-list:not(.grid-view) .workout-card-title {
  font-size: 17px;
  font-weight: 650;
}

.workout-list:not(.grid-view) .workout-meta {
  gap: 12px 20px;
  margin-bottom: 4px;
}

.workout-list:not(.grid-view) .meta-pill {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.workout-list:not(.grid-view) .difficulty-badge,
.workout-list:not(.grid-view) .distance-indicator {
  margin-left: auto;
  align-self: flex-start;
}

.workout-list:not(.grid-view) .workout-card-footer {
  margin-top: 12px;
  align-items: flex-end;
}

.workout-list:not(.grid-view) .location-text {
  font-size: 14px;
  line-height: 1.4;
}

.workout-list:not(.grid-view) .primary-button {
  padding: 12px 20px;
  font-size: 13px;
  min-width: 120px;
}

@keyframes listCardEnter {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Mobile Grid View Fix - Final Override */

@media (max-width: 768px) {
  .workout-list.grid-view .workout-card {
    min-height: 300px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .workout-list.grid-view .workout-meta {
    flex: 1;
    margin: 8px 0;
  }
  
  .workout-list.grid-view .workout-card-footer {
    margin-top: auto !important;
    padding-top: 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  
  .workout-list.grid-view .primary-button {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    align-self: stretch !important;
  }
}

@media (max-width: 480px) {
  .workout-list.grid-view .workout-card {
    min-height: 380px !important;
    padding: 16px !important;
  }
  
  .workout-list.grid-view {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .primary-button {
    width: 40%;
    justify-content: center;
    padding: 10px 16px;
  }
}
