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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #64B5F6 0%, #42A5F5 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.input-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    height: fit-content;
}

.input-group {
    margin-bottom: 25px;
}

.input-group h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #2196F3;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    margin-bottom: 10px;
    font-family: inherit;
}

select {
    width: auto;
    cursor: pointer;
    background-color: white;
}

#wheelSizeLabel {
    transition: opacity 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 8px 14px;
    background: white;
    border: 2px solid #2196F3;
    border-radius: 6px;
    color: #2196F3;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    font-weight: 600;
}

.preset-btn:hover {
    background: #2196F3;
    color: white;
    transform: translateY(-2px);
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.calculate-btn:active {
    transform: translateY(0);
}

.results-section {
    background: white;
}

.results-section h2,
.results-section h3 {
    color: #2196F3;
    margin-bottom: 20px;
}

.results-section h2 {
    font-size: 1.8rem;
}

.results-section h3 {
    font-size: 1.3rem;
    margin-top: 30px;
}

#gearTable {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

th {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
}

td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

tr:hover {
    background: #f8f9fa;
}

.gear-cell {
    position: relative;
    font-weight: 600;
}

.gear-ratio {
    display: block;
    font-size: 1rem;
    color: #333;
}

.stats-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

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

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.stat-item-bike1 {
    border-left-color: #2196F3;
}

.stat-item-bike2 {
    border-left-color: #FF9800;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.visualization-section {
    margin-top: 30px;
}

.gear-bar-container {
    margin-bottom: 15px;
}

.gear-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.gear-bar-label-left {
    font-weight: 600;
    color: #2196F3;
}

.gear-bar-label-right {
    color: #888;
}

.gear-bar-wrapper {
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    height: 30px;
    position: relative;
}

.gear-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.viz-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.viz-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viz-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

.viz-legend-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

/* Scatter Plot Styles */
.scatter-plot-container {
    position: relative;
    margin-top: 20px;
    margin-bottom: 40px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px 20px 40px 60px;
}

.scatter-y-axis {
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 40px;
    width: 60px;
}

.scatter-y-label {
    position: absolute;
    right: 10px;
    transform: translateY(-50%);
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.scatter-plot-area {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fafafa;
    border-radius: 8px;
}

.scatter-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e0e0e0;
}

.scatter-h-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #e8e8e8;
}

.scatter-x-label {
    position: absolute;
    bottom: -30px;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #666;
}

.scatter-point-wrapper {
    position: absolute;
    z-index: 1;
}

.scatter-point {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scatter-point:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.scatter-point-wrapper .scatter-point {
    position: relative;
    transform: none;
}

.scatter-point-wrapper .scatter-point:hover {
    transform: scale(1.5);
}

.scatter-value {
    position: absolute;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

.scatter-value-bike1 {
    background: #2196F3;
}

.scatter-value-bike2 {
    background: #FF9800;
}

.scatter-value-top {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
}

.scatter-value-bottom {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
}

.scatter-point-wrapper:hover {
    z-index: 20;
}

.scatter-point-wrapper:hover .scatter-value {
    z-index: 21;
}

.scatter-axis-labels {
    position: relative;
    margin-top: 10px;
}

.scatter-x-axis-label {
    text-align: center;
    font-weight: 600;
    color: #2196F3;
    font-size: 0.95rem;
    margin-top: 15px;
}

.scatter-y-axis-label {
    position: absolute;
    left: -125px;
    top: 50%;
    transform: rotate(-90deg) translateY(-50%);
    transform-origin: center center;
    font-weight: 600;
    color: #2196F3;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Header Navigation */
.header-nav {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.nav-link {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-link.active {
    background: white;
    color: #2196F3;
    border-color: white;
}

/* Comparison Page Styles */
.compare-layout {
    padding: 30px;
}

.bike-config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .bike-config-row {
        grid-template-columns: 1fr;
    }
}

.bike-config {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.bike-title {
    color: #2196F3;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.bike-config .input-section {
    background: transparent;
    padding: 0;
}

.bike-config .input-group h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #2196F3;
}

/* Bike 2 Orange Styling */
.bike-title-2 {
    color: #FF9800 !important;
}

.bike-2-heading {
    color: #FF9800 !important;
}

.preset-btn-bike2 {
    border-color: #FF9800;
    color: #FF9800;
}

.preset-btn-bike2:hover {
    background: #FF9800;
    color: white;
}

.bike-config-2 input[type="text"]:focus {
    border-color: #FF9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
}

.compare-btn {
    margin: 30px auto;
    display: block;
    max-width: 400px;
}

.comparison-results {
    margin-top: 40px;
}

.comparison-results > h2 {
    color: #2196F3;
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.stats-comparison {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.stats-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .stats-compare-grid {
        grid-template-columns: 1fr;
    }
}

.stat-compare-column h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.tables-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 1024px) {
    .tables-row {
        grid-template-columns: 1fr;
    }
}

.table-column h3 {
    color: #2196F3;
    margin-bottom: 15px;
    text-align: center;
}

.table-title-bike1 {
    color: #2196F3;
}

.table-column-bike1 table th {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
}

.table-title-bike2 {
    color: #FF9800 !important;
}

.table-column-bike2 table th {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.table-column table {
    font-size: 0.85rem;
}

.table-column th,
.table-column td {
    padding: 8px 5px;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #e0e0e0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 1.1rem;
}

/* Highlight extremes */
.highest-ratio {
    background: #e8f5e9 !important;
}

.lowest-ratio {
    background: #fff3e0 !important;
}

