:root {
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --accent-color: #0d6efd;
  --accent-secondary: #6610f2;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --glass-border: rgba(0, 0, 0, 0.1);
  --gradient-primary: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
  --shadow-premium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
.logo-container {
  font-family: 'Outfit', sans-serif;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 2rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

h1 span {
  font-weight: 300;
  color: var(--text-secondary);
}

nav {
  display: flex;
  gap: 0.5rem;
  background: var(--card-bg);
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

nav button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav button.active {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.stats-bar {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
}

.stat-item span {
  display: block;
  font-weight: 800;
  color: var(--accent-color);
  font-size: 1.1rem;
}

main {
  flex: 1;
  padding: 3rem 5%;
  width: 100%;
  min-width: 0; /* Prevents flex item from expanding beyond container */
}

section {
  display: none;
  animation: fadeIn 0.5s ease-out forwards;
}

section.active {
  display: block;
}

.hidden {
  display: none !important;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-premium);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.premium-card {
  border-left: 4px solid var(--accent-color);
}

.accent-card {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, rgba(5, 7, 10, 0) 100%);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

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

.data-list {
  list-style: none;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.data-item:last-child {
  border-bottom: none;
}

.data-item .name {
  font-weight: 600;
}

.data-item .val {
  font-family: 'Outfit', sans-serif;
  color: var(--accent-secondary);
  font-weight: 800;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.regatta-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.regatta-card .year {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-weight: 800;
  font-size: 2.5rem;
  opacity: 0.1;
}

.regatta-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.regatta-card .type-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-color);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.back-link {
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.back-link:hover {
  transform: translateX(-5px);
}

.section-header input[type="text"] {
  width: 100%;
  max-width: 500px;
  padding: 0.8rem 1.2rem;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.section-header input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sailor-item {
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sailor-item:hover {
  transform: translateX(5px);
  border-color: var(--accent-color);
  background: rgba(59, 130, 246, 0.05);
}

.sailor-item .view-results {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.sailor-item .view-results:hover {
  background: var(--accent-secondary);
  transform: scale(1.05);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-color);
  font-family: 'Outfit', sans-serif;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.regatta-link,
.sailor-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.regatta-link:hover,
.sailor-link:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.regatta-link:active,
.sailor-link:active {
  transform: scale(0.98);
}

.table-container {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  margin-top: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  text-align: left;
  padding: 1.2rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--glass-border);
}

td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.cell-name {
  color: var(--text-primary);
  min-width: 200px;
}

.cell-club {
  color: var(--text-secondary);
  font-size: 0.8rem;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-cell {
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
}

.score-cell.discard {
  text-decoration: line-through;
  opacity: 0.4;
  color: #ef4444;
}

.cell-net {
  font-weight: 800;
  color: var(--accent-color);
  text-align: right;
  font-size: 1.1rem;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.rank-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  font-weight: 800;
}

.rank-1 .rank-circle {
  background: #fbbf24;
  color: #78350f;
}

.rank-2 .rank-circle {
  background: #e2e8f0;
  color: #475569;
}

.rank-3 .rank-circle {
  background: #fb923c;
  color: #7c2d12;
}

footer {
  padding: 4rem 5% 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Loading helper */
.loading-shimmer {
  width: 100%;
  height: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

  to {
    background-position: -200% 0;
  }
}

/* Infinite Scrolling Graphic */
.scrolling-graphic-container {
  width: 100%;
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1rem 0;
}

.scrolling-track {
  display: flex;
  width: max-content;
  animation: scroll 30s linear infinite;
  gap: 3rem;
}

.scroll-item {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 2px;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Regatta Event Tabs */
.event-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-bottom: 1rem;
}

.event-tab {
  background-color: var(--card-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.event-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background-color: white;
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.event-tab.active {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* New Dashboard Layouts */
.dashboard-header-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-metric-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-premium);
}

.stat-metric-card .metric-val {
  font-size: 2rem;
  font-weight: 800;
  display: block;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

.stat-metric-card .metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-grid-regatta {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.card.wide-chart {
  grid-column: span 1;
  /* In 3 column layout, this might need adjustment if we want it wider */
}

/* For mobile/tablet, stack them */
@media (max-width: 1024px) {

  .dashboard-grid,
  .dashboard-grid-regatta,
  .split-grid {
    grid-template-columns: 1fr;
  }
}

.chart-wrapper {
  position: relative;
  height: 250px;
  width: 100%;
}

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-secondary);
}

.list-card {
  height: 100%;
}

.simple-list .list-item {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.simple-list .list-item:last-child {
  border-bottom: none;
}

.simple-list .date {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Regatta Stats Row */
.stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.stats-row .stat-card-small {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 1rem;
  min-width: 120px;
  text-align: center;
}

.stats-row .stat-card-small .val {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stats-row .stat-card-small .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Scrollable List for Clubs in Regatta view */
.scrollable-list {
  max-height: 300px;
  overflow-y: auto;
}

.scrollable-list .list-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

/* Buttons */
.action-bar {
  margin: 2rem 0;
}

.action-bar.centered {
  text-align: center;
}

.primary-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.primary-btn:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Profile Card Layout */
.profile-header-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-premium);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #ddd, #999);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #333;
  font-weight: bold;
}

.profile-info h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.profile-stats-row {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.profile-stat {
  text-align: center;
}

.profile-stat span {
  display: block;
}

.profile-stat .p-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-color);
}

.profile-stat .p-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.tab {
  padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}
/* Compatibility Styles for Public HTML Structure */

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

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-premium);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  display: block;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-trend {
    font-size: 0.75rem;
    color: var(--accent-color);
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Responsive Layouts for Analysis Grids */
@media (max-width: 900px) {
  .analysis-grid,
  .donuts-row,
  .awards-row,
  .info-badges-grid,
  .club-detail-grid {
      grid-template-columns: 1fr !important;
  }
}

/* Fix table styles from clean-table to match theme */
.clean-table {
    width: 100%;
    margin: 0;
}

.clean-table td {
    color: var(--text-primary);
}
.clean-table td:not(:first-child) {
    color: var(--text-secondary);
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active {
   color: white;
   /* Assuming they are inside nav which has bg styles, but specific active text color helps */
}

/* Info badges grid compatibility */
.info-badges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-badge {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-badge.blue, .info-badge.green, .info-badge.red, .info-badge.yellow {
    /* Override old colors with glass style, maybe use left border for color */
    background: var(--card-bg);
    border-left: 3px solid;
}
.info-badge.blue { border-left-color: #3b82f6; }
.info-badge.green { border-left-color: #10b981; }
.info-badge.red { border-left-color: #ef4444; }
.info-badge.yellow { border-left-color: #f59e0b; }

.badge-text strong {
    color: var(--text-primary);
    display: block;
}
.badge-text span {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.donuts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.awards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.big-dash {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    font-family: 'Outfit', sans-serif;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
}
.source-toggle select {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}
.col-left, .col-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Additional Compatibility for JS generated content */
.simple-table-body .row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-primary);
}
.simple-table-body .row span a {
    color: var(--text-primary);
    text-decoration: none;
}
.simple-table-body .row .val {
    font-weight: 700;
    color: var(--accent-color);
}

.text-primary {
    color: var(--accent-color) !important;
}

.hover-underline:hover {
    text-decoration: underline;
}

/* Ensure chart containers have size */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}
.chart-container.small {
    height: 200px;
}

.section-search input {
    color: var(--text-primary) !important;
}

/* Ensure nav items are visible in light theme */
.nav-item:hover {
    color: var(--accent-color);
    background: rgba(0,0,0,0.05);
}
/* Logo Styling Updates */
.logo-icon.demo-icon { font-size: 1.5rem; }
.logo-icon.aoa-icon { font-size: 1.5rem; }

/* Mobile Visibility Utilities */
@media (max-width: 768px) {
  .mobile-hidden {
    display: none !important;
  }
}

/* Responsive Table Wrapper */
.table-wrapper {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: 8px; /* Optional, matches card feel */
}

/* Ensure tables inside wrapper don't force width */
.table-wrapper table {
  margin-bottom: 0;
}

/* Head to Head Button */
.button-back-to-back {
    display: inline-block;
    margin-top: 2.5rem; /* Increased margin */
    padding: 0.8rem 2rem;
    background: var(--gradient-primary);
    color: white !important;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
}

.button-back-to-back:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.4);
}

/* Extracted from aoa/club_detail.html */

.club-detail-grid {
            display: grid;
            grid-template-columns: 2fr 1.2fr;
            gap: 2rem;
            margin-top: 2rem;
        }

        @media (max-width: 1000px) {
            .club-detail-grid {
                grid-template-columns: 1fr;
            }
        }

        .stats-row {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .stat-box {
            background: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            flex: 1;
            text-align: center;
        }

        .stat-box h3 {
            font-size: 2rem;
            margin: 0;
            color: #1e293b;
        }

        .stat-box p {
            font-size: 0.8rem;
            color: #64748b;
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .year-selector {
            background: #fecaca;
            /* Light red background from screenshot */
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 2rem;
            display: flex;
            flex-direction: column;
        }

        .year-selector h4 {
            margin: 0 0 0.5rem 0;
            color: #7f1d1d;
            font-size: 0.9rem;
            text-transform: uppercase;
        }

        .year-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .year-btn {
            background: #3b82f6;
            color: white;
            border: none;
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            font-size: 0.8rem;
            cursor: pointer;
            opacity: 0.8;
        }

        .year-btn:hover,
        .year-btn.active {
            opacity: 1;
            font-weight: bold;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .charts-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .chart-container-local {
            background: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .chart-title {
            font-size: 0.9rem;
            margin-bottom: 1rem;
            color: #64748b;
        }

        .roster-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        .roster-table th {
            text-align: left;
            padding: 0.75rem;
            color: #94a3b8;
            font-weight: 600;
            font-size: 0.75rem;
            text-transform: uppercase;
            border-bottom: 1px solid #e2e8f0;
        }

        .roster-table td {
            padding: 0.75rem;
            border-bottom: 1px solid #f1f5f9;
            color: #334155;
        }

        .roster-table tr:hover td {
            background: #f8fafc;
        }

/* Extracted from aoa/event_detail.html */

th, td {
            white-space: nowrap;
        }

        .race-cell {
            text-align: center;
            width: 30px;
        }

        .score-box {
            display: inline-block;
            width: 24px;
            height: 24px;
            line-height: 24px;
            text-align: center;
            border-radius: 4px;
            font-size: 0.8rem;
        }

        .discard {
            text-decoration: line-through;
            opacity: 0.6;
            background-color: #f1f3f5;
        }

        /* Color coding for scores */
        .score-1 {
            background-color: #ffe69c;
            /* Yellow */
        }

        .score-2 {
            background-color: #b6d4fe;
            /* Light Blue */
        }

        .score-3 {
            background-color: #f8d7da;
            /* Light Red */
        }

/* Extracted from aoa/regatta_detail.html */

.page-header.column {
            flex-direction: column;
            align-items: flex-start;
        }

        .btn-event-tab {
            background: #e9ecef;
            border: 1px solid #dee2e6;
            padding: 0.5rem 1rem;
            margin-right: 0.5rem;
            border-radius: 4px;
            color: #495057;
            font-weight: 500;
            cursor: default;
            /* Just labels for now until we have breakdown per event in dashboard */
        }

        .kpi-trend {
            display: block !important;
            position: relative !important;
            margin-top: 0.5rem;
            width: 100%;
        }

/* Extracted from aoa/compare.html */

.comparison-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            margin-top: 2rem;
        }

        .sailor-column {
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 1.5rem;
        }

        .sailor-header {
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--glass-border);
        }

        .matchup-row {
            display: grid;
            grid-template-columns: 1fr 100px 1fr;
            align-items: center;
            padding: 1rem 0;
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }
        
        .matchup-middle {
            text-align: center;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .result-cell {
            padding: 0.5rem;
            border-radius: 8px;
            text-align: center;
        }

        .winner {
            background: #d1fae5;
            color: #065f46;
            font-weight: bold;
        }

        .loser {
            background: #fee2e2;
            color: #991b1b;
        }
        
        .tie {
            background: #f3f4f6;
            color: #4b5563;
        }

/* Extracted from usoda/club_detail.html */

.club-detail-grid {
            display: grid;
            grid-template-columns: 2fr 1.2fr;
            gap: 2rem;
            margin-top: 2rem;
        }

        @media (max-width: 1000px) {
            .club-detail-grid {
                grid-template-columns: 1fr;
            }
        }

        .stats-row {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .stat-box {
            background: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            flex: 1;
            text-align: center;
        }

        .stat-box h3 {
            font-size: 2rem;
            margin: 0;
            color: #1e293b;
        }

        .stat-box p {
            font-size: 0.8rem;
            color: #64748b;
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .year-selector {
            background: #fecaca;
            /* Light red background from screenshot */
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 2rem;
            display: flex;
            flex-direction: column;
        }

        .year-selector h4 {
            margin: 0 0 0.5rem 0;
            color: #7f1d1d;
            font-size: 0.9rem;
            text-transform: uppercase;
        }

        .year-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .year-btn {
            background: #3b82f6;
            color: white;
            border: none;
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            font-size: 0.8rem;
            cursor: pointer;
            opacity: 0.8;
        }

        .year-btn:hover,
        .year-btn.active {
            opacity: 1;
            font-weight: bold;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .charts-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .chart-container-local {
            background: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .chart-title {
            font-size: 0.9rem;
            margin-bottom: 1rem;
            color: #64748b;
        }

        .roster-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        .roster-table th {
            text-align: left;
            padding: 0.75rem;
            color: #94a3b8;
            font-weight: 600;
            font-size: 0.75rem;
            text-transform: uppercase;
            border-bottom: 1px solid #e2e8f0;
        }

        .roster-table td {
            padding: 0.75rem;
            border-bottom: 1px solid #f1f5f9;
            color: #334155;
        }

        .roster-table tr:hover td {
            background: #f8fafc;
        }

        .btn-event-tab {
            background: #e9ecef;
            border: 1px solid #dee2e6;
            padding: 0.5rem 1rem;
            margin-right: 0.5rem;
            border-radius: 4px;
            color: #495057;
            font-weight: 500;
            cursor: default;
            /* Just labels for now until we have breakdown per event in dashboard */
        }

        .kpi-trend {
            display: block !important;
            position: relative !important;
            margin-top: 0.5rem;
            width: 100%;
        }

/* Extracted from aoa/compare.html */

.comparison-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            margin-top: 2rem;
        }

        .sailor-column {
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 1.5rem;
        }

        .sailor-header {
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--glass-border);
        }

        .matchup-row {
            display: grid;
            grid-template-columns: 1fr 100px 1fr;
            align-items: center;
            padding: 1rem 0;
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }
        
        .matchup-middle {
            text-align: center;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .result-cell {
            padding: 0.5rem;
            border-radius: 8px;
            text-align: center;
        }

        .winner {
            background: #d1fae5;
            color: #065f46;
            font-weight: bold;
        }

        .loser {
            background: #fee2e2;
            color: #991b1b;
        }
        
        .tie {
            background: #f3f4f6;
            color: #4b5563;
        }

/* Extracted from usoda/index.html */

body.landing-page {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            margin: 0;
            background: url('/static/static/CAPIZZANO_2310.jpg') no-repeat center center fixed;
            background-size: cover;
            font-family: 'Inter', sans-serif;
            position: relative;
        }

        /* Overlay to ensure readability */
        body.landing-page::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1;
        }

        .landing-container {
            position: relative;
            z-index: 2;
            text-align: center;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 4rem;
            border-radius: 32px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            max-width: 500px;
            width: 90%;
            animation: fadeInScale 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

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

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .landing-logo h1 {
            font-size: 3rem;
            margin-bottom: 0.5rem;
            color: #ffffff;
            font-family: 'Outfit', sans-serif;
            font-weight: 800;
            letter-spacing: -1px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .landing-logo span {
            color: #60a5fa;
            font-weight: 400;
        }

        .tagline {
            color: rgba(255, 255, 255, 0.8);
            font-size: 1.1rem;
            margin-bottom: 3rem;
            font-weight: 400;
        }

        .source-grid {
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }

        .source-card {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            text-decoration: none;
            color: white;
            font-family: 'Outfit', sans-serif;
            font-weight: 700;
            font-size: 1.5rem;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        .source-card:hover {
            background: rgba(255, 255, 255, 0.9);
            color: #1e293b;
            transform: translateY(-4px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }

        .source-card:active {
            transform: translateY(0);
        }
/* Safety overrides to ensure non-landing pages do not inherit landing styles */
body:not(.landing-page) {
    background-image: none !important;
}

body:not(.landing-page)::before {
    content: none !important;
    display: none !important;
    background: none !important;
}
