#chart {
    width: 100%;
    height: 400px;
}

body {
    font-family: Arial, sans-serif;
    padding: 10px;
    box-sizing: border-box;
}

html {
    font-size: 12px;
}

#routeProfile {
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    height: 400px;
    margin: 5px 0px;
    background-color: #f8f9fa;
}

#routeProfile h5 {
    text-align: center;
    margin-top: 190px;
    color: #6c757d;
}

#routeProfile > h5:first-child,
#routeGPXProfile > h5:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    margin: 0 0 10px 0;
    border-radius: 5px 5px 0 0;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

#routeGPXProfile h5 {
    text-align: center;
    margin-top: 190px;
    color: #6c757d;
}

/* Placeholder text styling for empty charts */
#routeProfile h5.text-muted,
#routeGPXProfile h5.text-muted {
    background: none;
    color: #6c757d;
    padding: 0;
    margin-top: 170px;
    font-weight: normal;
}

#routeGPXProfile {
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    height: 400px;
    margin: 5px 0px;
    background-color: #f8f9fa;
}

#routeGPXProfile h5 {
    text-align: center;
    margin-top: 190px;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 400px;
}

.chart-container h5 {
    color: #6c757d;
    font-size: 1rem;
}

.speedTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.speedTable td,
.speedTable th {
    text-align: center;
    font-weight: bold;
}

.tfoot {
    border-top: 2px double black;
    font-style: italic;
}

#veloTable th,
#veloTable td,
#phenotypeTable th,
#phenotypeTable td {
    text-align: center;
    font-weight: 700;
}

.tableTitle {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 10px;
    margin-bottom: 0px;
    padding: 5px;
    background-color: #b6f6ff;
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    font-size: 1.0rem;
    color: #555;
    padding: 10px;
    border-top: 1px solid #ccc;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0;
    text-align:center;
    font-weight:bold;
}

h2.title {
    margin-bottom:0px !important;
}

h6.subTitle {
    margin-bottom:10px;
    font-style:italic;
}

#analysisArea {
    padding:5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-height:300px;
    width: 100%;
}

/* Editable weight and height styling */
.editable-weight, .editable-height {
    cursor: pointer;
    transition: background-color 0.2s;
}

.editable-weight:hover, .editable-height:hover {
    background-color: #e9ecef !important;
}

.editable-zero {
    background-color: #fff3cd !important;
    border: 1px dashed #856404 !important;
    color: #dc3545 !important;
    font-style: italic;
    font-weight: bold;
}

.editable-zero:hover {
    background-color: #ffeaa7 !important;
}

.route-discovery {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.course-filter-card,
.team-ranking-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(31, 45, 61, 0.08);
}

.course-filter-card h6,
.team-ranking-card h6 {
    font-size: 1.1rem;
}

.course-filter-card .form-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.course-filter-card input.form-control {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.course-filter-card input.form-control:focus {
    border-color: #00A3E0;
    box-shadow: 0 0 0 0.2rem rgba(0, 163, 224, 0.15);
}

.terrain-toggle {
    flex-wrap: wrap;
    gap: 6px;
}

.terrain-toggle .btn {
    flex: 1 1 calc(33% - 6px);
    min-width: 90px;
    font-size: 0.8rem;
    font-weight: 500;
}

.terrain-toggle .btn-check:checked + .btn-outline-secondary {
    background-color: #00A3E0;
    border-color: #00A3E0;
    color: #ffffff;
}

.course-ranking-wrapper {
    max-height: 520px;
    overflow-y: auto;
}

/* Responsive adjustments for two-column layout */
@media (min-width: 992px) {
    .course-ranking-wrapper {
        max-height: 600px;
    }
    
    .chart-container {
        min-height: 350px;
    }
    
    #routeProfile,
    #routeGPXProfile {
        height: 350px;
    }
    
    #routeProfile h5,
    #routeGPXProfile h5 {
        margin-top: 160px;
    }
}

.course-ranking-wrapper::-webkit-scrollbar {
    width: 8px;
}

.course-ranking-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.course-ranking-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.course-ranking-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.course-ranking-wrapper .course-result {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 14px 16px;
    background: #ffffff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.course-ranking-wrapper .course-result:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(31, 45, 61, 0.14);
    border-color: #00A3E0;
    background: linear-gradient(135deg, #ffffff 0%, rgba(0, 163, 224, 0.05) 100%);
}

.course-ranking-wrapper .course-result.active {
    border-color: #FC6719;
    box-shadow: 0 10px 24px rgba(252, 103, 25, 0.18);
}

.course-ranking-wrapper .course-result .fw-bold {
    font-size: 1rem;
    color: #1a1a1a;
}

.course-ranking-wrapper .course-result .text-muted {
    font-size: 0.85rem;
}

.terrain-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terrain-badge.pan-flat {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #ffffff;
}

.terrain-badge.flat {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: #ffffff;
}

.terrain-badge.rolling {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: #ffffff;
}

.terrain-badge.hilly {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: #ffffff;
}

.terrain-badge.mountainous {
    background-color: #8b4513;
    color: white;
}

/* jQuery UI Slider Overrides */
.ui-slider {
    height: 8px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 8px;
}

.ui-slider-range {
    background: #0d6efd;
}

.ui-slider-handle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0d6efd;
    cursor: pointer;
    top: -6px;
}

.ui-slider-handle:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.ui-slider-handle:hover {
    background: #f8f9fa;
}

#climbDurationSlider {
    margin: 12px 8px;
}

.ui-slider {
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    height: 8px;
}

.ui-slider-range {
    background: #00A3E0;
    border-radius: 8px;
}

.ui-slider-handle {
    background: #ffffff;
    border: 3px solid #00A3E0;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    top: -7px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ui-slider-handle:hover,
.ui-slider-handle:focus {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(0, 163, 224, 0.15);
    outline: none;
}

#climbDurationRange {
    font-weight: 600;
    color: #00A3E0;
}

.team-ranking-card table tr:hover td {
    background-color: #b6f6ff !important;
}

.team-ranking-card table tr {
    cursor: pointer;
}

#climbBiasRange {
    accent-color: #FC6719;
}