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

/* Font Awesome icon styling */
.fas.fa-trophy {
  color: #ffc107; /* Bootstrap warning color */
}

.fas.fa-medal {
  color: #6c757d; /* Bootstrap secondary color */
}

.fas.fa-award {
  color: #dc3545; /* Bootstrap danger color */
}

.fas.fa-star {
  color: #0d6efd; /* Bootstrap primary color */
}

/* Custom button styles for better visibility */
.btn-outline-info {
  color: #6f42c1 !important;
  border-color: #6f42c1 !important;
  background-color: rgba(111, 66, 193, 0.1) !important;
}

.btn-outline-info:hover {
  color: #fff !important;
  background-color: #6f42c1 !important;
  border-color: #6f42c1 !important;
}

.btn-outline-warning {
  color: #198754 !important;
  border-color: #198754 !important;
  background-color: rgba(25, 135, 84, 0.1) !important;
}

.btn-outline-warning:hover {
  color: #fff !important;
  background-color: #198754 !important;
  border-color: #198754 !important;
}

/* Add faded background to View Details button */
.btn-outline-primary {
  background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Race actions layout */
.race-actions-container {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-left: 2rem;
}

.race-info-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.race-buttons-section {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.race-action-btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f8f9fa;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Main Content */
.main-content {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* File Uploader */
.file-uploader {
  margin-bottom: 2rem;
}

.upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.upload-area.dragover {
  border-color: #0d6efd;
  background: #e7f3ff;
}

.upload-area:hover {
  border-color: #0d6efd;
  background: #f8f9fa;
}

.file-input {
  display: none;
}

.upload-content {
  pointer-events: none;
}

.upload-content h3 {
  margin-bottom: 1rem;
  color: #333;
}

.upload-content p {
  color: #666;
  margin-bottom: 1.5rem;
}

.upload-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.upload-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.upload-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.selected-file {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.selected-file p {
  margin-bottom: 1rem;
  color: #333;
}

/* Race List */
.race-list {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.race-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.race-list-header h2 {
  color: #333;
  font-size: 1.8rem;
}

.export-button {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Race Summary */
.race-summary h3 {
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 1.5rem;
}

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

.summary-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.race-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e9ecef;
}

.race-title {
  font-size: 1.8em;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.race-details {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.race-detail {
  background: #e9ecef;
  padding: 6px 12px;
  border-radius: 6px;
  color: #495057;
  font-size: 0.9em;
  font-weight: 500;
}

.race-text {
  margin-top: 8px;
  padding: 12px;
  background: #f0f8ff;
  border-radius: 6px;
  border-left: 4px solid #0d6efd;
}

.race-text-label {
  font-weight: 600;
  color: #0d6efd;
  margin-right: 8px;
  font-size: 0.9rem;
}

.race-text-content {
  color: #333;
  font-size: 0.9rem;
  line-height: 1.4;
}

.betting-options {
  margin-top: 8px;
  padding: 12px;
  background: #fff3cd;
  border-radius: 6px;
  border-left: 4px solid #ffc107;
}

.betting-options-label {
  font-weight: 600;
  color: #856404;
  margin-right: 8px;
  font-size: 0.9rem;
}

.betting-options-content {
  color: #333;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Scratches */
.scratches-section {
  margin-bottom: 1rem;
}

.scratches-section h5 {
  color: #dc3545;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.scratches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scratch-badge {
  background: #fff3cd;
  color: #856404;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid #ffeaa7;
}

/* Scratched Horse Warning */
.scratched-warning {
  margin-bottom: 10px;
}

.alert-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

/* Scratched Pick Styling */
.pick-item.scratched-pick {
  opacity: 0.6;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
}

.pick-item.scratched-pick .horse-name {
  text-decoration: line-through;
  color: #856404;
}

.pick-item.scratched-pick .pick-number-badge {
  background: #dc3545 !important;
  color: white !important;
}

/* Completed Race Styling */
.summary-item.completed-race {
  opacity: 0.8;
  background: #f8f9fa;
  border-left: 4px solid #6c757d;
}

.summary-item.completed-race .summary-header {
  background: #e9ecef;
}

.summary-item.completed-race .summary-race-title {
  color: #6c757d;
}

/* Collapsed Race Message */
.collapsed-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 0;
  font-size: 0.9rem;
}

/* Top Horses */
.top-horses h5 {
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.horse-picks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.horse-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: white;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.post-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  color: white;
  border: 1px solid #000;
}

/* Use black text for light background colors */
.post-number[style*="backgroundColor: #FFFFFF"],
.post-number[style*="backgroundColor: #FFD700"],
.post-number[style*="backgroundColor: #FFC0CB"],
.post-number[style*="backgroundColor: #ffffff"],
.post-number[style*="backgroundColor: #ffd700"],
.post-number[style*="backgroundColor: #ffc0cb"],
.post-number[style*="background-color: #FFFFFF"],
.post-number[style*="background-color: #FFD700"],
.post-number[style*="background-color: #FFC0CB"],
.post-number[style*="background-color: #ffffff"],
.post-number[style*="background-color: #ffd700"],
.post-number[style*="background-color: #ffc0cb"] {
    color: black !important;
}

.horse-name {
  flex: 1;
  font-weight: 500;
}

.odds {
  background: #28a745;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: bold;
}

.view-details-button {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.view-details-button:hover {
  background: #5a6268;
}

/* Detailed Race View */
.detailed-race {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.detailed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.detailed-header h3 {
  color: #333;
  font-size: 1.5rem;
}

.close-button {
  background: #dc3545;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-button:hover {
  background: #c82333;
}

/* Race Info */
.race-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.race-info p {
  margin: 0;
  color: #333;
}

/* Track Changes */
.track-changes {
  margin-bottom: 2rem;
}

.track-changes h4 {
  color: #333;
  margin-bottom: 1rem;
}

.track-change {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.change-type {
  background: #ffc107;
  color: #856404;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.change-details {
  color: #856404;
  font-size: 0.9rem;
}

/* Betting Options */
.betting-options {
  margin-bottom: 2rem;
}

.betting-options h4 {
  color: #333;
  margin-bottom: 1rem;
}

.betting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.betting-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 4px;
}

.bet-type {
  color: #1976d2;
  font-weight: 500;
}

.bet-minimum {
  background: #1976d2;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: bold;
}

/* Horses Table */
.all-horses h4 {
  color: #333;
  margin-bottom: 1rem;
}

.horses-table {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 60px 2fr 1fr 80px 80px 80px 80px;
  background: #f8f9fa;
  padding: 1rem;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #dee2e6;
}

.horse-row {
  display: grid;
  grid-template-columns: 60px 2fr 1fr 80px 80px 80px 80px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #dee2e6;
  transition: background-color 0.2s ease;
}

.horse-row:hover {
  background-color: #f8f9fa;
}

.horse-row:last-child {
  border-bottom: none;
}

/* Loading */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
}

.notification-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-message {
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin-left: 1rem;
  font-size: 1.2rem;
}

/* No Races */
.no-races {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.no-races p {
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .table-header,
  .horse-row {
    grid-template-columns: 50px 1fr 80px 60px;
    font-size: 0.9rem;
  }
  
  .table-header span:nth-child(5),
  .table-header span:nth-child(6),
  .table-header span:nth-child(7),
  .horse-row span:nth-child(5),
  .horse-row span:nth-child(6),
  .horse-row span:nth-child(7) {
    display: none;
  }
  
  .race-list-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .detailed-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .race-header {
    padding: 0.75rem;
  }
  
  .race-title {
    font-size: 1.3rem;
  }
  
  .race-info {
    margin-top: 0.75rem;
  }
  
  .race-info .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }
  
  .race-info .d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Responsive horse grid */
  .horses-grid {
    gap: 15px;
  }

  .horse-details {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .horse-card {
    padding: 12px;
  }

  .detail-section {
    padding: 10px;
  }
}

/* PDF Exporter */
.pdf-exporter {
  display: none;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
  color: #333;
  margin: 0;
}

.modal-close {
  background: #dc3545;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scratch-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.scratch-post {
  background: #ffc107;
  color: #856404;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.scratch-horse {
  flex: 1;
  font-weight: 500;
  color: #856404;
}

.scratch-reason {
  color: #856404;
  font-size: 0.9rem;
  font-style: italic;
}

/* Additional styles moved from index.cfm */
.horse-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  border-left: 4px solid #6f42c1 !important;
  transition: all 0.2s ease;
}

/* Ensure horse-card purple border is applied */
div.horse-card {
  border-left-color: #6f42c1 !important;
}

.horse-card:hover {
  background: #e9ecef;
  transform: translateX(2px);
}

.horse-card.top-pick {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.horse-card.scratched {
    opacity: 0.6;
    background: #f8f9fa;
    border-left-color: #dc3545;
}

.horse-card.scratched .horse-title {
    text-decoration: line-through;
    color: #6c757d;
}

.horse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.horse-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1em;
  font-weight: 600;
  color: #2c3e50;
}

.horse-score {
  font-weight: bold;
  color: #28a745;
  font-size: 1.1em;
}

.horses-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 15px;
}

.horse-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 12px;
}

.horse-detail {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.85em;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.95em;
}

.pedigree-link {
  color: inherit;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

.pedigree-link:hover {
  opacity: 0.7;
}

.detail-section {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  border-left: 3px solid #dee2e6;
}

.detail-section:hover {
  background: #e9ecef;
  border-left-color: #6c757d;
}

.section-title {
  font-size: 0.9em;
  font-weight: 700;
  color: #495057;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.detail-grid .horse-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-grid .detail-label {
  font-size: 0.75em;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-grid .detail-value {
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.85em;
}

.race-picks-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.picks-section {
  border-radius: 6px;
  padding: 12px;
  min-height: 300px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

/* Background colors for each picks section */
.program-picks-section {
  background: #e3f2fd; /* (light blue) for Program Picks */
}

.top-picks-section {
  background: #fff3e0; /* (light orange)for Top Picks */
}

.ai-picks-section {
  background: #f3e5f5; /* (light purple) for AI Picks */
}

.picks-title {
  font-weight: bold;
  color: #495057;
  margin-bottom: 10px;
  font-size: 14px;
  text-align: center;
}

.picks-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  overflow-y: auto;
  max-height: calc(100% - 40px); /* Account for picks-title height */
}

.no-picks {
  text-align: center;
  padding: 10px;
  color: #6c757d;
}

.top-picks-section {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  margin-top: 5px;
}

.top-picks-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.top-picks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
}

.top-pick-item {
  background: rgba(255,255,255,0.2);
  padding: 8px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.top-pick-item .pick-label {
  font-weight: 600;
  color: white;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  text-align: center;
}

.top-pick-item .horse-details {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compact Pick Design for Expanded View */
.top-pick-item.compact-pick {
  position: relative;
  padding: 0.75rem;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.top-pick-item.compact-pick .pick-number-badge {
  position: static;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 1;
  margin-bottom: 0.25rem;
}

.top-pick-item.compact-pick .horse-position-name {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  min-width: 0;
}

.top-pick-item.compact-pick .horse-position-name .post-number {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  margin-left: auto;
}

.top-pick-item.compact-pick .horse-position-name .horse-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #333;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0%;
  word-break: break-word;
}

.top-pick-item.compact-pick .horse-position-name .horse-score {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
  margin-left: 0.25rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Enhanced top pick styling for better readability */
.top-pick-item .pick-rank {
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  text-align: center;
  margin-bottom: 0.25rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.top-pick-item .pick-name {
  font-weight: 700;
  font-size: 1rem;
  color: white;
  text-align: center;
  margin-bottom: 0.25rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  line-height: 1.2;
}

.top-pick-item .pick-score {
  font-weight: 700;
  font-size: 1rem;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.summary-section {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.summary-title {
  font-size: 1.5em;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
}

.summary-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid #007bff;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.summary-header .d-flex {
  align-items: center;
}

.summary-race-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  line-height: 1;
  margin: 0;
}

.race-performance-badge {
  display: flex;
  align-items: center;
}

.race-performance-badge .badge {
  line-height: 1;
  display: flex;
  align-items: center;
}

.summary-race-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1;
}

.summary-race-details .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.race-summary-details {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: right;
  min-width: 200px;
}

.race-summary-details span {
  display: inline-block;
  margin-left: 15px;
}

.race-summary-details span:first-child {
  margin-left: 0;
}

.race-summary-details span:last-child {
  margin-left: 0;
}

.summary-horses {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
  width: 100%;
}

.top-picks-summary {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.race-results-summary {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border: 2px solid #28a745;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.summary-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.375rem;
  padding: 0.125rem 0;
  border-bottom: 1px solid #e9ecef;
  width: 100%;
  grid-column: 1 / -1;
}

.summary-horse {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.375rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  font-size: 0.8rem;
  min-height: auto;
}

.summary-horse .horse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.125rem;
}

.summary-horse .pick-label {
  font-weight: 600;
  color: #666;
  font-size: 0.8rem;
}

.summary-horse .horse-details {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  width: 100%;
  overflow: hidden;
}

.summary-horse .horse-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-horse .horse-score {
  color: #6c757d;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Compact Pick Design */
.summary-horse.compact-pick {
  position: relative;
  padding: 0.5rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.pick-number-badge {
  position: static;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  z-index: 1;
  margin-bottom: 0.25rem;
}

.horse-position-name {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  width: 100%;
}

.horse-position-name .post-number {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  margin-left: auto;
}

.horse-position-name .horse-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #333;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0%;
}

.horse-position-name .horse-score {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
  margin-left: 0.25rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Winning Bets Section */
.summary-winning-bets {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border-radius: 8px;
  border: 2px solid #ffc107;
}

.race-performance-summary {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
  border: 2px solid #28a745;
}

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

.performance-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.stat-label {
  font-weight: 500;
  color: #666;
  font-size: 0.9rem;
}

.stat-value {
  font-weight: 600;
  font-size: 1rem;
}

.winning-bets-list {
  margin-bottom: 10px;
}

.winning-bet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: white;
  border-radius: 4px;
  margin-bottom: 4px;
  border: 1px solid #dee2e6;
  font-size: 0.85em;
}

.winning-bet-item:last-child {
  margin-bottom: 0;
}

.bet-type {
  font-weight: 600;
  color: #495057;
  min-width: 80px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.correct-picks-badge {
  background: #28a745;
  color: white;
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.bet-runners {
  flex: 1;
  text-align: center;
  color: #6c757d;
  font-family: monospace;
}

.bet-payout {
  font-weight: 600;
  min-width: 80px;
  text-align: right;
}

.winning-bets-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #e8f5e8;
  border-radius: 4px;
  border: 1px solid #28a745;
  font-weight: 600;
  font-size: 0.9em;
}

.total-label {
  color: #155724;
}

.total-amount {
  color: #155724;
}

.file-selector {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-selector select {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.95em;
}

.file-selector select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Program Changes Status */
.program-changes-card {
  border-left: 4px solid #007bff;
}

.program-changes-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.program-changes-card .alert {
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.program-changes-card .alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.program-changes-card .alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.program-changes-card .alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

.program-changes-card .alert-secondary {
  background-color: #e2e3e5;
  border-color: #d6d8db;
  color: #383d41;
}

/* Horse Changes */
.horse-changes {
  margin-top: 10px;
  padding: 10px;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 5px;
}

.change-item {
  margin-bottom: 8px;
  padding: 5px;
  background-color: #fff;
  border-radius: 3px;
}

.change-description {
  font-weight: 500;
  color: #856404;
}

/* Footer Styles */
.footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #495057;
  text-decoration: underline;
}

.footer-separator {
  color: #6c757d;
  font-size: 0.9rem;
}

.footer-copyright {
  color: #6c757d;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    order: 1;
  }
  
  .footer-copyright {
    order: 2;
  }
}

/* Collapsible Sections */
.collapse-button {
  transition: transform 0.3s ease;
}

.collapse-button:hover {
  transform: scale(1.1);
}

.collapsible-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.collapsible-content.expanded {
  max-height: none;
  opacity: 1;
}

/* Race Card Styling */
.race-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid #dee2e6;
}

/* Race Content Layout */
.race-content {
  width: 100%;
  clear: both;
}

.race-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  width: 100%;
}

.race-header .d-flex {
  width: 100%;
}

.race-header .d-flex:last-child {
  justify-content: flex-end;
}

.race-details-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.race-details-right .badge {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}

.race-info {
  margin-top: 0.5rem;
}

.race-info .badge {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
}

.race-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
}

/* Results Section */
.results-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e9ecef;
}

.results-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.finish-order {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid #dee2e6;
}

.finish-positions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.finish-position {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
}

.position-number {
  background: #28a745;
  color: white;
  min-width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 4px;
  gap: 2px;
}

.position-number i {
  font-size: 0.7rem;
}

.finish-position:nth-child(1) .position-number {
  background: #ffd700;
  color: #333;
}

.finish-position:nth-child(2) .position-number {
  background: #c0c0c0;
  color: #333;
}

.finish-position:nth-child(3) .position-number {
  background: #cd7f32;
  color: white;
}

.horse-name {
  font-weight: 500;
  color: #333;
}

.horse-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.horse-info {
  margin-top: 0.25rem;
}

.betting-results {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid #dee2e6;
  margin-top: 1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
}

.result-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.result-item.winning-bet {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 2px solid #ffc107;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.result-item.selected-bet {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border: 2px solid #28a745;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.result-item.losing-bet {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border: 2px solid #dc3545;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.selected-indicator {
  animation: pulse 1.5s infinite;
}

.winning-star {
  animation: pulse 1.5s infinite;
}

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

/* Betting Summary */
.betting-summary {
  margin-top: 1.5rem;
}

.summary-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
  padding: 1.5rem;
  border: 2px solid #28a745;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.summary-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.stat-label {
  font-weight: 500;
  color: #666;
}

.stat-value {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Betting Options */
.form-check {
  margin-bottom: 0.5rem;
}

.form-check-input:checked {
  background-color: #28a745;
  border-color: #28a745;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

.form-check-label:hover {
  color: #28a745;
}

/* Overall Performance Summary */
.overall-summary {
  margin-bottom: 2rem;
}

.overall-summary-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 2rem;
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid #28a745;
}

.overall-summary-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.overall-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.overall-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.overall-stat-label {
  font-weight: 500;
  opacity: 0.9;
}

.overall-stat-value {
  font-weight: 700;
  font-size: 1.2rem;
}

.race-performance-badge {
  margin-left: auto;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.bet-type {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}

.bet-amount {
  background: #007bff;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.runners {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.bet-cost-payout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.bet-cost {
  font-size: 0.9rem;
  color: #dc3545;
  font-weight: 600;
}

.payout {
  font-size: 0.9rem;
  color: #28a745;
  font-weight: 600;
}

/* Favorites Section */
.favorites-section {
  background: #fff3cd;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ffeaa7;
}

.favorites-title {
  font-size: 1rem;
  font-weight: 600;
  color: #856404;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.favorite-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #ffeaa7;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.favorite-item .pick-label {
  font-weight: 600;
  color: #856404;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  text-align: center;
}

.favorite-item .horse-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.favorite-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

/* Scoring configuration styling */
.scoring-config-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scoring-config-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid #5a6fd8;
}

.scoring-config-header:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.scoring-config-header h6 {
  color: white;
  font-weight: 600;
}

.scoring-config-header .text-muted {
  color: rgba(255, 255, 255, 0.8) !important;
}

.scoring-toggle-icon {
  transition: transform 0.3s ease;
  font-size: 0.9rem;
}

.scoring-toggle-icon.rotated {
  transform: rotate(180deg);
}

.scoring-config .card-body {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-top: 1px solid #e9ecef;
}

.scoring-config .form-range {
  height: 8px;
  background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
  border-radius: 4px;
}

.scoring-config .form-range::-webkit-slider-thumb {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.scoring-config .form-range::-moz-range-thumb {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.scoring-config .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.scoring-config .fw-bold {
  color: #007bff;
  font-weight: 700;
}

.scoring-config .alert-info {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 2px solid #2196f3;
  color: #1565c0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.scoring-config .text-warning {
  color: #ff9800 !important;
  font-weight: 600;
}

.scoring-config .btn-outline-secondary {
  border: 2px solid #6c757d;
  color: #6c757d;
  font-weight: 500;
  transition: all 0.3s ease;
}

.scoring-config .btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.scoring-config .row {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0;
  border: 1px solid #e9ecef;
}

.scoring-config h6 {
  color: #495057;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
}

.scoring-config .text-success {
  color: #28a745 !important;
  font-weight: 600;
}

.scoring-config .btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: 2px solid #007bff;
  font-weight: 500;
  transition: all 0.3s ease;
}

.scoring-config .btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  border-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.scoring-config .btn-primary:disabled {
  background: #6c757d;
  border-color: #6c757d;
  opacity: 0.6;
  cursor: not-allowed;
}

.scoring-config .gap-2 {
  gap: 0.5rem;
}

/* Betting options within scoring config */
.scoring-config .form-check {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.scoring-config .form-check:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scoring-config .form-check-input:checked {
  background-color: #28a745;
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.scoring-config .form-check-label {
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  user-select: none;
}

.scoring-config .form-check-label:hover {
  color: #28a745;
}

.scoring-config .text-muted {
  color: #6c757d !important;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Official race badge styling */
.race-title .badge.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  border: 1px solid #1e7e34;
  font-weight: 500;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
}

/* User Dropdown in Header */
#userDropdownContainer {
    position: relative;
}

#userDropdownContainer .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    min-width: 200px;
}

/* Ensure navbar stays fixed at top */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Responsive adjustments for picks */
@media (max-width: 768px) {
  .favorites-grid,
  .top-picks-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .picks-section {
    min-height: 150px;
    max-height: 250px;
    padding: 8px;
  }
  
  .picks-grid {
    max-height: calc(100% - 30px);
  }
  
  .top-pick-item.compact-pick {
    padding: 0.5rem;
    min-height: 60px;
  }
  
  .top-pick-item.compact-pick .horse-position-name .horse-name {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .favorites-grid,
  .top-picks-grid {
    grid-template-columns: 1fr;
  }
}

/* Walkthrough Styles */
.customTooltip {
  background: #ffffff !important;
  color: #333;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  line-height: 1.5;
  max-width: 450px;
  padding: 20px;
  border: 2px solid #667eea;
}

/* Override any Intro.js default backgrounds */
.introjs-tooltip {
  background: #ffffff !important;
  color: #333 !important;
}

.introjs-tooltip .introjs-tooltiptext {
  background: #ffffff !important;
  color: #555 !important;
}

/* Override any potential overlay or shadow effects */
.introjs-tooltip,
.introjs-tooltip * {
  background: #ffffff !important;
  filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/* Remove any potential overlays */
.introjs-tooltip::before,
.introjs-tooltip::after {
  display: none !important;
}

/* Ensure no dark overlays affect the tooltip */
.introjs-tooltipReferenceLayer {
  filter: none !important;
  backdrop-filter: none !important;
}

/* Override any Intro.js default styling that might add overlays */
.introjs-tooltip {
  background: #ffffff !important;
  color: #333 !important;
  filter: none !important;
  backdrop-filter: none !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

.introjs-tooltip .introjs-tooltip-title {
  background: #ffffff !important;
}

.customTooltip .introjs-tooltip-title {
  color: #333;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.customTooltip .introjs-tooltiptext {
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.customTooltip .introjs-button {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #333 !important;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 0 5px;
  float: none;
  display: inline-block;
}

.customTooltip .introjs-button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
  color: #333 !important;
}

.customTooltip .introjs-button.introjs-skipbutton {
  background: #6c757d;
  color: white !important;
  float: left;
  margin-left: 0;
}

.customTooltip .introjs-button.introjs-skipbutton:hover {
  background: #5a6268;
  color: white !important;
}

.customTooltip .introjs-button.introjs-donebutton {
  background: #28a745;
  border-color: #1e7e34;
  color: white !important;
}

.customTooltip .introjs-button.introjs-donebutton:hover {
  background: #218838;
  color: white !important;
}

.customHighlight {
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3), 0 0 0 8px rgba(102, 126, 234, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.introjs-overlay {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.introjs-helperLayer {
  border: 2px solid #667eea;
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3), 0 0 0 8px rgba(102, 126, 234, 0.2);
}

.introjs-tooltipReferenceLayer {
  z-index: 999999;
}

.introjs-tooltip {
  text-align: left;
}

.introjs-tooltip .introjs-tooltiptext {
  text-align: left;
}

/* Walkthrough step indicators */
.introjs-progress {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  height: 4px;
  margin: 15px 0;
}

.introjs-progressbar {
  background: linear-gradient(90deg, #28a745, #20c997);
  border-radius: 10px;
  height: 100%;
  transition: width 0.3s ease;
}

.introjs-bullets {
  margin: 15px 0;
}

.introjs-bullets ul li {
  margin: 0 3px;
}

.introjs-bullets ul li a {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 12px;
  height: 12px;
  transition: all 0.3s ease;
}

.introjs-bullets ul li a.active {
  background: white;
  border-color: white;
  transform: scale(1.2);
}

.introjs-bullets ul li a:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.7);
}

/* Responsive walkthrough adjustments */
@media (max-width: 768px) {
  .customTooltip {
    max-width: 350px;
    padding: 15px;
    font-size: 13px;
  }
  
  .customTooltip .introjs-tooltip-title {
    font-size: 16px;
  }
  
  .customTooltip .introjs-button {
    padding: 6px 12px;
    font-size: 12px;
    margin: 0 3px;
  }
}

/* Picks Summary Section */
.picks-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #e9ecef;
  margin-bottom: 1rem;
}

.picks-summary h6 {
  color: #495057;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.picks-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.picks-summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  min-width: 120px;
}

.picks-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  min-width: 60px;
}

.picks-numbers {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.pick-number {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #e9ecef;
  color: #495057;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
}

.pick-number.winner {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
  box-shadow: 0 1px 3px rgba(255, 193, 7, 0.3);
}

.pick-number.winner i {
  color: #ffc107;
}

.pick-number.winner-exact {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
  box-shadow: 0 1px 3px rgba(40, 167, 69, 0.3);
}

.pick-number.winner-exact i {
  color: #28a745;
}

.pick-number.winner-top4 {
  background: #ffe6cc;
  color: #cc7000;
  border-color: #ffd699;
  box-shadow: 0 1px 3px rgba(255, 140, 0, 0.3);
}

.pick-number.winner-top4 i {
  color: #ff8c00;
}

.pick-number.pick-outside-top4 {
  background: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
  box-shadow: 0 1px 3px rgba(108, 117, 125, 0.3);
}

.pick-number.pick-outside-top4 i {
  color: #6c757d;
}

.ai-generate-section {
  display: flex;
  align-items: center;
}

.ai-generate-section .btn {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* Responsive adjustments for picks summary */
@media (max-width: 768px) {
  .picks-summary-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .picks-summary-item {
    min-width: auto;
    justify-content: space-between;
  }
  
  .picks-label {
    min-width: 50px;
    font-size: 0.85rem;
  }
  
  .picks-numbers {
    justify-content: flex-end;
  }
  
  .pick-number {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Top Picks Display in Weight Analysis Table */
.top-picks-display {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.9rem;
}

.pick-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.pick-number {
  font-weight: 700;
  color: #495057;
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  min-width: 24px;
  text-align: center;
}

.pick-score {
  color: #495057;
  font-size: 0.8rem;
  font-weight: 600;
}

.pick-more {
  color: #6c757d;
  font-size: 0.7rem;
  font-style: italic;
  text-align: center;
  padding: 1px 0;
}

/* Responsive adjustments for top picks */
@media (max-width: 768px) {
  .top-picks-display {
    font-size: 0.75rem;
  }
  
  .pick-item {
    padding: 1px 2px;
  }
  
  .pick-number {
    font-size: 0.7rem;
    min-width: 18px;
  }
  
  .pick-score {
    font-size: 0.7rem;
  }
  
  .pick-more {
    font-size: 0.75rem;
    color: #6c757d;
  }
}

/* Navigation Buttons */
.summary-navigation {
  text-align: center;
  padding: 0.5rem 0;
}

.summary-navigation .btn {
  transition: all 0.3s ease;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.summary-navigation .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.race-navigation {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid #e9ecef;
  margin-top: 1rem;
}

.race-navigation .btn {
  transition: all 0.3s ease;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.race-navigation .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Embedded Race Details */
.embedded-race-details {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.embedded-race-details .race-details {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.embedded-race-details .race-detail {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.embedded-race-details .favorites-section,
.embedded-race-details .top-picks-section,
.embedded-race-details .results-section {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.embedded-race-details .favorites-section {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
}

.embedded-race-details .top-picks-section {
  background: #75bbe9;
  border: 1px solid #5aa3d1;
}

.embedded-race-details .results-section {
  background: #d4edda;
  border: 1px solid #c3e6cb;
}

.embedded-race-details .weight-analysis-section {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.embedded-race-details .weight-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.embedded-race-details .weight-analysis-header h6 {
  margin-bottom: 0;
}

.embedded-race-details .horse-analysis {
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
}

.embedded-race-details .horse-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.embedded-race-details .table {
  font-size: 0.875rem;
}

.embedded-race-details .table th,
.embedded-race-details .table td {
  padding: 0.5rem;
  vertical-align: middle;
}

.embedded-race-details .top-picks-display {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.9rem;
}

.embedded-race-details .pick-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.embedded-race-details .pick-number {
  font-weight: 700;
  color: #495057;
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  min-width: 24px;
  text-align: center;
}

.embedded-race-details .pick-score {
  color: #495057;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Detailed Analysis Modal Styles */
.detailed-analysis-content {
    max-height: 70vh;
    overflow-y: auto;
}

.race-overview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.race-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.info-label {
    font-weight: 600;
    color: #495057;
}

.info-value {
    font-weight: 500;
    color: #212529;
}

.weights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.weight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.weight-label {
    font-weight: 500;
    color: #495057;
}

.weight-value {
    font-weight: 600;
    color: #0d6efd;
}

.horses-analysis {
    margin-bottom: 2rem;
}

.horses-analysis h6 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.score-component {
    text-align: center;
}

.score-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.score-details {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.component-breakdown {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.component-breakdown h6 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.component-card {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.component-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.component-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.component-weight {
    color: #0d6efd;
    font-weight: 500;
}

/* Post number styling for analysis table */
.post-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
}

/* Score color classes */
.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #fd7e14 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Modal specific styles - High specificity override */
:root {
    --modal-width: 75vw;
}

body #detailedAnalysisModal .modal-dialog.modal-xl,
body #detailedAnalysisModal .modal-dialog,
#detailedAnalysisModal .modal-dialog.modal-xl,
#detailedAnalysisModal .modal-dialog {
    max-width: var(--modal-width) !important;
    width: var(--modal-width) !important;
    min-width: var(--modal-width) !important;
    margin: 1.75rem auto !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
}

#detailedAnalysisModal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
}

#detailedAnalysisModal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

/* Additional override for any Bootstrap constraints */
.modal-dialog.modal-xl {
    max-width: 75vw !important;
    width: 75vw !important;
}

/* Table styles for the analysis modal */
#detailedAnalysisModal .table th {
    background-color: #343a40;
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem;
    text-align: center;
}

#detailedAnalysisModal .table td {
    padding: 0.5rem;
    font-size: 0.85rem;
    vertical-align: middle;
}

#detailedAnalysisModal .table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .race-info-grid,
    .weights-grid {
        grid-template-columns: 1fr;
    }
    
    .horses-analysis .table-responsive {
        font-size: 0.75rem;
    }
    
    .score-component {
        min-width: 60px;
    }
    
    .score-value {
        font-size: 0.8rem;
    }
    
    .score-details {
        font-size: 0.7rem;
    }
}

/* Public Homepage Styles */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
}

.feature-icon {
    margin-bottom: 1.5rem;
}

.step-number .badge {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Enhanced card styles for homepage */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

/* Responsive adjustments for homepage */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .step-number .badge {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* AI Analysis Styles */
.ai-analysis-content {
    max-width: 100%;
}

.race-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.race-summary h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.info-label {
    font-weight: 600;
    color: #495057;
}

.info-value {
    color: #6c757d;
}

.race-description {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.top-picks-analysis {
    margin-bottom: 1.5rem;
}

.top-picks-analysis h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

.picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.picks-grid-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.pick-analysis-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.pick-analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pick-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.pick-rank {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.pick-name {
    font-weight: 600;
    color: #495057;
    flex: 1;
}



.pick-stats {
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.stat-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.stat-value {
    color: #6c757d;
    font-size: 0.9rem;
}

.pick-reasoning {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.pick-reasoning strong {
    color: #495057;
    display: block;
    margin-bottom: 0.5rem;
}

.pick-reasoning p {
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.race-analysis-summary {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.race-analysis-summary h6 {
    color: #0056b3;
    font-weight: 600;
    margin-bottom: 1rem;
}

.analysis-text {
    color: #0056b3;
    line-height: 1.6;
    font-size: 0.95rem;
}

.ai-analysis-text {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    line-height: 1.6;
    color: #495057;
}

@media (max-width: 768px) {
    .picks-grid {
        grid-template-columns: 1fr;
    }
    
    .race-info-grid {
        grid-template-columns: 1fr;
    }
    
    .pick-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Mobile-first responsive design for iPhone 14 and small screens */
@media (max-width: 430px) {
    /* Navigation adjustments */
    .navbar .container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .navbar .d-flex.align-items-center.gap-3 {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .navbar .btn {
        width: 100%;
        margin: 0;
    }
    
    .navbar-text {
        text-align: center;
        margin: 0 !important;
    }
    
    /* Live Race Controls */
    .live-race-controls .card-header .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .live-race-controls .refresh-controls {
        justify-content: center;
        gap: 8px;
    }
    
    .live-race-controls .refresh-controls .btn {
        flex: 1;
        min-width: 0;
    }
    
    .live-race-controls .row > [class*='col-'] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    /* Scoring Configuration */
    .scoring-config-card .card-header h6 {
        font-size: 0.9rem;
    }
    
    .scoring-config-card .row > [class*='col-'] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .scoring-config-card .alert .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .scoring-config-card .alert .d-flex .d-flex {
        justify-content: center;
        gap: 8px;
    }
    
    .scoring-config-card .alert .d-flex .d-flex .btn {
        flex: 1;
        min-width: 0;
    }
    
    /* Race display adjustments */
    .race-actions-container {
        flex-direction: column;
        gap: 10px;
        margin-left: 0;
    }
    
    .race-info-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .race-buttons-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .race-action-btn {
        width: 100%;
        margin: 0;
    }
    
    /* Embedded race details */
    .embedded-race-details .race-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .embedded-race-details .race-detail {
        font-size: 0.8rem;
    }
    
    .embedded-race-details .favorites-grid,
    .embedded-race-details .top-picks-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .embedded-race-details .favorite-item,
    .embedded-race-details .top-pick-item {
        padding: 8px;
    }
    
    /* Results section */
    .embedded-race-details .finish-positions {
        flex-direction: column;
        gap: 8px;
    }
    
    .embedded-race-details .finish-position {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .embedded-race-details .results-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .embedded-race-details .result-item {
        padding: 8px;
    }
    
    .embedded-race-details .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
    
    /* Cards and sections */
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-header {
        padding: 10px 15px;
    }
    
    /* Form elements */
    .form-select,
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .btn-sm {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Top picks display */
    .top-picks-display {
        flex-direction: column;
        gap: 8px;
    }
    
    .pick-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* User dropdown */
    #userDropdownContainer .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 10px;
    }
    
    /* General spacing */
    .mt-4 {
        margin-top: 1rem !important;
    }
    
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Text adjustments */
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Badge adjustments */
    .badge {
        font-size: 0.7rem;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Tab navigation */
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tabs .nav-item {
        width: 100%;
    }
    
    .nav-tabs .nav-link {
        text-align: center;
        border-radius: 0;
    }
    
    /* Form check layouts */
    .form-check {
        margin-bottom: 8px;
    }
    
    /* Alert adjustments */
    .alert {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    /* Horse cards */
    .horse-card {
        margin-bottom: 10px;
    }
    
    .horse-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Summary sections */
    .summary-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    /* Top Picks Section - Mobile Improvements */
    .top-picks-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .top-picks-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .top-picks-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    .top-pick-item {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .top-pick-item.compact-pick {
        min-height: auto;
        padding: 8px;
    }
    
    .top-pick-item.compact-pick .horse-position-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
    }
    
    .top-pick-item.compact-pick .horse-position-name .post-number {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .top-pick-item.compact-pick .horse-position-name .horse-name {
        font-size: 0.9rem;
        white-space: normal;
        word-break: break-word;
        width: 100%;
    }
    
    .top-pick-item.compact-pick .horse-position-name .horse-score {
        align-self: flex-start;
        margin-left: 0;
    }
    
    /* Results Section - Mobile Improvements */
    .results-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .results-title {
        font-size: 1rem;
        margin-bottom: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .finish-order {
        padding: 8px;
    }
    
    .finish-positions {
        gap: 6px;
    }
    
    .finish-position {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px;
    }
    
    .finish-position .horse-details {
        width: 100%;
    }
    
    .finish-position .horse-name {
        font-size: 0.9rem;
        word-break: break-word;
    }
    
    .finish-position .horse-info {
        font-size: 0.8rem;
    }
    
    .betting-results {
        padding: 8px;
        margin-top: 8px;
    }
    
    .results-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    .result-item {
        padding: 8px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .result-header .bet-type {
        font-size: 0.9rem;
        word-break: break-word;
    }
    
    .result-header .bet-amount {
        font-size: 0.8rem;
    }
    
    .result-details {
        flex-direction: column;
        gap: 4px;
    }
    
    .result-details .runners {
        font-size: 0.8rem;
        word-break: break-word;
    }
    
    .result-details .bet-cost-payout {
        font-size: 0.8rem;
    }
    
    /* Betting Summary - Mobile Improvements */
    .betting-summary {
        margin-top: 10px;
    }
    
    .summary-card {
        padding: 10px;
    }
    
    .summary-title {
        font-size: 1rem;
        margin-bottom: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    .stat-item {
        padding: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    /* Favorites Section - Mobile Improvements */
    .favorites-section {
        margin-bottom: 10px;
    }
    
    .favorites-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .favorites-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    .favorite-item {
        padding: 8px;
    }
    
    .favorite-item .pick-label {
        font-size: 0.8rem;
    }
    
    .favorite-item .horse-details {
        font-size: 0.9rem;
        word-break: break-word;
    }
}

/* Track Research Styles */
.track-research-card {
    border-left: 4px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1);
}

.track-research-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.track-research-card .card-header h6 {
    color: #495057;
    font-weight: 600;
}

.track-research-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

.track-research-content .alert-primary {
    background: linear-gradient(135deg, #e7f3ff 0%, #d1ecf1 100%);
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.track-research-content .card {
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.track-research-content .card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.track-research-content .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
}

.track-research-content .card-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.track-research-content .card-body {
    padding: 1rem;
}

.track-research-content .card-body p {
    margin: 0;
    line-height: 1.5;
    color: #6c757d;
}

.track-research-content .alert-light {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
}

.track-research-content .alert-light h6 {
    color: #495057;
    font-weight: 600;
}

.track-research-content .alert-light small {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Mobile responsive adjustments for track research */
@media (max-width: 768px) {
    .track-research-card .card-header .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .track-research-card .card-header .d-flex .d-flex {
        width: 100%;
        justify-content: space-between;
    }
    
    .track-research-content .row {
        margin: 0;
    }
    
    .track-research-content .col-md-6 {
        padding: 0 0.5rem;
    }
    
    .track-research-content .card {
        margin-bottom: 1rem;
    }
    
    .track-research-content .alert-primary {
        font-size: 0.9rem;
    }
}

/* Enhanced AI Analysis Styles */
.pace-scenario, .class-level {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid;
    margin-top: 1rem;
}

.pace-scenario {
    border-left-color: #0d6efd;
}

.class-level {
    border-left-color: #6f42c1;
}

.pace-scenario h6, .class-level h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.pace-analysis {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #198754;
    margin-top: 1rem;
}

.pace-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.pace-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.pace-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.pace-value {
    font-weight: 600;
    color: #198754;
    font-size: 1.1rem;
}

.lifetime-stats {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    margin-top: 1rem;
}

.lifetime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.lifetime-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.lifetime-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.lifetime-value {
    font-weight: 600;
    font-size: 1rem;
    color: #ffc107 !important;
}

.class-assessment {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #6f42c1;
    margin-top: 1rem;
}

.key-advantages, .concerns {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid;
    margin-top: 1rem;
}

.key-advantages {
    border-left-color: #198754;
}

.concerns {
    border-left-color: #ffc107;
}

.advantages-list, .concerns-list {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.advantages-list li, .concerns-list li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.betting-recommendations {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 2px solid #dee2e6;
    margin-top: 1.5rem;
}

.betting-recommendations h6 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.betting-grid {
    display: grid;
    gap: 1rem;
}

.betting-section {
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.betting-section h6 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.candidates-list, .combinations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trifecta-key {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.trifecta-key li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.value-play, .longshot {
    display: flex;
    gap: 0.5rem;
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
    .pace-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pace-item {
        flex-direction: row;
        justify-content: space-between;
        min-width: auto;
    }
    
    .lifetime-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .betting-grid {
        gap: 0.75rem;
    }
    
    .candidates-list, .combinations-list {
        flex-direction: column;
    }
    
    .candidates-list .badge, .combinations-list .badge {
        align-self: flex-start;
    }
}

/* Race Loading Overlay */
.race-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

.race-loading-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.race-loading-content .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

.race-loading-content p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 1rem;
}

.race-loading-content small {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Make sure summary-item has relative positioning for overlay */
.summary-item {
    position: relative;
}

/* Responsive adjustments for race loading overlay */
@media (max-width: 768px) {
    .race-loading-content {
        padding: 1.5rem;
    }
    
    .race-loading-content .spinner-border {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .race-loading-content p {
        font-size: 1rem;
    }
    
    .race-loading-content small {
        font-size: 0.8rem;
    }
}

/* Track Analysis Card Styles */
.track-analysis-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.track-analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.track-analysis-card .card-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.75rem 1rem;
}

.track-analysis-card .card-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.track-analysis-card .card-body {
    padding: 1rem;
}

.track-analysis-card .card-subtitle {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.track-analysis-card .card-text {
    font-size: 0.875rem;
    line-height: 1.4;
    color: #495057;
}

.track-analysis-card .badge {
    font-size: 0.75rem;
}

.track-analysis-card .btn-outline-primary {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Blog Card Styles */
.blog-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.blog-card .card-title a {
    color: #333;
    text-decoration: none;
}

.blog-card .card-title a:hover {
    color: #0d6efd;
}

/* Track Analysis Modal Styles */
#trackAnalysisModal .modal-75 {
    max-width: 75% !important;
    width: 75% !important;
}

#trackAnalysisModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#trackAnalysisModal .track-research-content {
    animation: fadeIn 0.3s ease-in;
}

#trackAnalysisModal .alert-primary {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    color: #1565c0;
}

#trackAnalysisModal .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

#trackAnalysisModal .alert-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

/* Mobile Navigation Styles */
@media (max-width: 991.98px) {
    /* Mobile page title */
    .navbar .navbar-text.d-lg-none {
        font-size: 0.9rem;
        font-weight: 500;
        margin: 0;
        padding: 0;
    }
    
    /* Hamburger button styling */
    .navbar-toggler {
        border: 1px solid rgba(255, 255, 255, 0.3);
        padding: 0.375rem 0.75rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    }
    
    /* Mobile navigation menu */
    .navbar-collapse {
        background-color: rgba(13, 110, 253, 0.95);
        border-radius: 0.375rem;
        margin-top: 0.5rem;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .nav-item:last-child {
        margin-bottom: 0;
    }
    
    .navbar-nav .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        transition: all 0.2s ease;
    }
    
    .navbar-nav .nav-link:hover {
        color: white !important;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        color: white !important;
    }
    
    /* Mobile dropdown styling */
    .navbar-nav .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        margin-top: 0.25rem;
    }
    
    .navbar-nav .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.75rem 1rem;
    }
    
    .navbar-nav .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    .navbar-nav .dropdown-item.text-danger {
        color: #ff6b6b !important;
    }
    
    .navbar-nav .dropdown-item.text-danger:hover {
        background-color: rgba(255, 107, 107, 0.1);
        color: #ff6b6b !important;
    }
    
    /* Hide desktop elements on mobile */
    .navbar .d-none.d-lg-block {
        display: none !important;
    }
    
    /* Brand adjustments for mobile */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand img {
        height: 32px !important;
    }
    
    /* Register button styling on mobile */
    .navbar-nav .nav-link.btn {
        background-color: white;
        color: #0d6efd !important;
        border: 1px solid white;
        font-weight: 500;
    }
    
    .navbar-nav .nav-link.btn:hover {
        background-color: #f8f9fa;
        color: #0d6efd !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 575.98px) {
    .navbar .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 28px !important;
    }
    
    .navbar .navbar-text.d-lg-none {
        font-size: 0.8rem;
    }
    
    .navbar-collapse {
        margin-top: 0.25rem;
        padding: 0.75rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}