:root {
    --bg-color: #000000;
    --surface-color-rgb: 10, 10, 10;
    --primary-text-color: #ffffff;
    --secondary-text-color: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --bright-yellow: #38bdf8; /* Changed from #FFD700 */
    --cool-violet: #8b5cf6;
    --light-blue: #38bdf8;
    --bright-red: #f43f5e; /* Red for ideal line */
    --green: #22c55e;
    
    --gradient-primary: linear-gradient(135deg, var(--light-blue) 0%, #00a8f8 100%); /* Changed from yellow gradient */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.header, .main-content {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.header {
    background: rgba(var(--surface-color-rgb), 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem; /* More padding for larger heading */
    text-align: center;
}

.header::before {
    content: '';
    position: absolute;
    top: -2px; left: 0; right: 0;
    height: 4px;
    background: var(--gradient-primary);
    filter: blur(8px);
}

.header h1 {
    margin: 0;
    font-size: 2.75rem; /* Larger font size */
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--light-blue); /* Changed from --bright-yellow */
    text-shadow: 0 0 25px rgba(56, 189, 248, 0.5); /* Changed from yellow shadow */
    text-transform: uppercase;
}

.main-content {
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow scrolling for main content */
}

.controls {
    background: rgba(var(--surface-color-rgb), 0.8);
    backdrop-filter: blur(20px);
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.7);
}

select {
    background-color: rgba(20, 20, 20, 0.9);
    color: var(--primary-text-color);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.8rem 1.3rem;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-width: 200px;
}

select:hover {
    border-color: rgba(56, 189, 248, 0.5); /* Changed from yellow */
}

select:focus {
    outline: none;
    border-color: var(--light-blue); /* Changed from --bright-yellow */
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3); /* Changed from yellow shadow */
}

.chart-container {
    background: rgba(var(--surface-color-rgb), 0.7);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    position: relative;
    /* Let the container size itself naturally now */
    min-height: 700px; /* MODIFICATION: Increased height for better aspect ratio */
    flex-shrink: 0; /* Prevent chart from shrinking */
}

.filter-group { display: flex; align-items: center; gap: 0.75rem; }
#sprintControls { display: flex; gap: 2.5rem; flex-wrap: wrap; }


.header {
    position: relative; 
}

.music-button {
    position: absolute;
    top: 50%;
    left: 2rem; 
    transform: translateY(-50%);
    background-color: transparent;
    border: 2px solid rgba(56, 189, 248, 0.6); 
    color: #38bdf8; 
    border-radius: 50%; 
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 0;
}

.music-button:hover {
    background-color: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.music-button svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

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

.music-button .icon-play {
    margin-left: 3px; 
}

.music-button .icon-pause {
    display: none;
}

#metrics-container,
#weekly-metrics-container { /* Apply styling to both containers */
    background: rgba(var(--surface-color-rgb), 0.7);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.metrics-table th, .metrics-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap; /* Prevent table headers from wrapping */
}

.metrics-table th {
    color: var(--secondary-text-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metrics-table td {
    font-size: 1.1rem;
}

.metrics-table tbody tr:last-child td {
    border-bottom: none;
}

.metrics-table .positive {
    color: var(--green);
    font-weight: bold;
}

.metrics-table .negative {
    color: var(--bright-red);
    font-weight: bold;
}

#velocity-metrics-container {
    background: rgba(var(--surface-color-rgb), 0.7);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}

#velocity-metrics-container h2, #velocity-metrics-container h3 {
    color: var(--light-blue);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

#velocity-metrics-container h3 {
    margin-top: 2rem;
}

.velocity-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.velocity-table th, .velocity-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.velocity-table th {
    color: var(--secondary-text-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.velocity-table td {
    font-size: 1.1rem;
}

.velocity-table tbody tr:last-child td {
    border-bottom: none;
}

.progress-bar-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    position: relative;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-primary);
    height: 100%;
    border-radius: 5px;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.5s ease-in-out;
}

.progress-bar-container span {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

/* Make the weekly table scrollable on small screens */
#weekly-metrics-container {
    overflow-x: auto;
}
