/* COOMA CAR CLUB LIVE TIMING - HYBRID 1080P HUD OPTIMIZATION
   Combines: Compact row density + Enhanced Record/Leaderboard Pills
*/

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  background: #111;
  color: #eee;
  margin: 0;
  padding: 0;
  overflow: hidden; 
}

#app-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: #111;
  color: #fff;
  box-sizing: border-box;
  padding: 0.4rem;
}

h1 { display: none; } /* Header removed for vertical space */

/* RECORDS BAR - TIGHTENED */
#records-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
  padding: 0.2em 0.5em;
  font-size: 0.75vw;
  margin-bottom: 0.3rem;
}

/* LEADERBOARD CHIPS - INTEGRATED GRADIENTS */
#leaderboard-bar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3em 0.6em;
  background: #1e1e1e;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  font-size: 0.75vw;
}

.leaderboard-section h3 {
  margin: 0 0 0.1em 0;
  font-size: 0.9em;
  font-weight: 600;
  color: #ffcc00;
}

.lb-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px; /* Compacted from 6px 14px */
  border-radius: 9999px;
  font-weight: 600;
  margin: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.lb-chip.gold { background: linear-gradient(135deg, #ffe082, #ffca28); color: #5d4037; }
.lb-chip.silver { background: linear-gradient(135deg, #e0e0e0, #bdbdbd); color: #424242; }
.lb-chip.bronze { background: linear-gradient(135deg, #ffcc80, #fb8c00); color: #4e342e; }

/* MAIN TIMING TABLE */
.timing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75vw; 
  table-layout: auto;
}

.timing-table th, .timing-table td {
  border: 1px solid #333;
  padding: 2px 4px; /* Ultra-tight padding */
  white-space: nowrap;
  text-align: center;
  line-height: 1.1;
}

/* Class header row */
tr.class-header-row td.class-header {
  background: #222 !important;
  color: #ffd700 !important;
  font-size: 0.9vw;
  font-weight: bold;
  text-align: left;
  padding: 3px 6px;
}

/* ENHANCED RECORD PILLS - SCALED FOR HUD */
.record-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px; /* Reduced from original to fit table row height */
  border-radius: 9999px;
  font-size: 0.65vw;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

.record-pill.outright-record, 
.record-pill.class-record {
   background-color: #e3f2fd; 
   color: #1565c0;
}

.record-pill.new-record {
  background-color: #fff3e0;
  color: #ef6c00;
  animation: flash 1s ease-in-out 2;
}

/* Zebra striping */
.timing-table tbody tr:nth-child(even):not(.class-header-row) td { background: #1a1a1a; }
.timing-table tbody tr:nth-child(odd):not(.class-header-row) td { background: #000000; }

/* Text Highlights */
.best-run { color: #00ff00; font-weight: bold; }
.best-split { color: #ffff00; font-weight: bold; }

/* Column Alignment */
.timing-table td:nth-child(2), .timing-table th:nth-child(2),
.timing-table td:nth-child(3), .timing-table th:nth-child(3) {
  text-align: left;
}
.timing-table tbody td:nth-child(1) { color: #4da6ff; font-weight: 600; }

/* Scroll Container */
.table-scroll-container {
  flex: 1;
  overflow-y: auto;
}

/* Animations & Status */
.update-icon { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background-color: #4caf50; }
.update-text { font-weight: 600; color: #4caf50; font-size: 0.9em; }
.pulse .update-icon { animation: pulse 0.8s ease; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } }
@keyframes flash { 0%, 100% { opacity: 1; } 50% { background-color: #ffe0b2; } }