/* Professional Car Gear Calculator - Ultimate Edition */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Chart Section Styles */
.chart-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e6ea;
    max-width: 1200px;
    margin: 0 auto;
    height: 450px;
    position: relative;
    min-height: 400px;
}

#shiftAnalysisChart {
    width: 100% !important;
    height: 100% !important;
    max-height: 400px;
}

/* Enhanced Shift Points Layout */
.shift-points-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    height: calc(100vh - 200px);
    overflow: hidden;
}

.shift-controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 100%;
}

.shift-analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 100%;
}

.chart-info {
    color: #6c757d;
    font-style: italic;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

/* Chart Controls */
.chart-controls {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.chart-controls h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

/* Chart Legend Controls */
.chart-legend-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #495057;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-toggle {
    background: #6c757d;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.legend-toggle:hover {
    background: #495057;
}

/* Enhanced Shift Results */
.shift-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.shift-results .result-group {
    margin: 0;
    padding: 10px;
    background: white;
}

/* Enhanced Shift Table */
.shift-table.enhanced {
    font-size: 12px;
}

.shift-table.enhanced th {
    background: #2c3e50;
    color: white;
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
}

.shift-table.enhanced td {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.shift-table.enhanced tr:nth-child(even) {
    background-color: #f8f9fa;
}

.shift-table.enhanced tr:hover {
    background-color: #e3f2fd;
}

/* Drag Racing Final Gear Styles */
.final-gear-rpm-input {
    background-color: #e3f2fd !important;
    border: 2px solid #2196f3 !important;
    font-weight: bold !important;
    padding: 6px 8px;
    border-radius: 4px;
    text-align: center;
    min-width: 80px;
    transition: all 0.3s ease;
}

.final-gear-rpm-input:focus {
    background-color: #bbdefb !important;
    border-color: #1976d2 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
    outline: none;
}

.final-gear-mph {
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.final-gear-mph.speed-normal {
    color: #333;
    background-color: transparent;
}

.final-gear-mph.speed-moderate {
    color: #2196f3;
    background-color: rgba(33, 150, 243, 0.1);
    font-weight: bold;
}

.final-gear-mph.speed-high {
    color: #ff9800;
    background-color: rgba(255, 152, 0, 0.1);
    font-weight: bold;
}

.final-gear-mph.speed-extreme {
    color: #d32f2f;
    background-color: rgba(211, 47, 47, 0.1);
    font-weight: bold;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Speed Legend Animations */
.speed-legend-item {
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Active Speed Category Highlighting */
.speed-legend-item.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%) !important;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    border: 2px solid !important;
    animation: activeGlow 2s ease-in-out infinite alternate;
}

.speed-legend-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes activeGlow {
    0% { box-shadow: 0 8px 25px rgba(0,0,0,0.15), 0 0 20px rgba(0,0,0,0.1); }
    100% { box-shadow: 0 12px 35px rgba(0,0,0,0.2), 0 0 30px rgba(0,0,0,0.15); }
}

/* Active state colors */
.speed-legend-item.active.speed-legend-normal {
    border-color: #28a745 !important;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3) !important;
}

.speed-legend-item.active.speed-legend-moderate {
    border-color: #2196f3 !important;
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3) !important;
}

.speed-legend-item.active.speed-legend-high {
    border-color: #ff9800 !important;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.3) !important;
}

.speed-legend-item.active.speed-legend-extreme {
    border-color: #d32f2f !important;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.4) !important;
    animation: extremeActiveGlow 1.5s ease-in-out infinite alternate;
}

@keyframes extremeActiveGlow {
    0% { 
        box-shadow: 0 8px 25px rgba(211, 47, 47, 0.4), 0 0 20px rgba(211, 47, 47, 0.2);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 12px 35px rgba(211, 47, 47, 0.6), 0 0 30px rgba(211, 47, 47, 0.3);
        transform: scale(1.03);
    }
}

/* Enhanced speed indicators for active state */
.speed-legend-item.active .speed-indicator {
    transform: scale(1.15);
    animation: pulseIndicator 1.5s ease-in-out infinite alternate;
}

@keyframes pulseIndicator {
    0% { 
        transform: scale(1.15);
        box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
    }
    100% { 
        transform: scale(1.25);
        box-shadow: 0 0 0 6px rgba(0,0,0,0.05);
    }
}

.speed-legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.speed-legend-normal:hover {
    border-left-color: #20c997 !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2) !important;
}

.speed-legend-moderate:hover {
    border-left-color: #17a2b8 !important;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2) !important;
}

.speed-legend-high:hover {
    border-left-color: #fd7e14 !important;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2) !important;
}

.speed-legend-extreme:hover {
    border-left-color: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.25) !important;
}

/* Speed Indicator Animations */
.speed-indicator {
    transition: all 0.3s ease;
}

.speed-legend-item:hover .speed-indicator {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.1) !important;
}

.speed-indicator-extreme {
    animation: pulse-extreme 2s infinite;
}

@keyframes pulse-extreme {
    0%, 100% { 
        box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(211, 47, 47, 0.1);
        transform: scale(1.05);
    }
}

/* Legend Container Animation */
.speed-legend-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for legend items */
.speed-legend-normal { animation-delay: 0.1s; }
.speed-legend-moderate { animation-delay: 0.2s; }
.speed-legend-high { animation-delay: 0.3s; }
.speed-legend-extreme { animation-delay: 0.4s; }

.speed-legend-item {
    animation: slideInLeft 0.5s ease-out backwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Final gear row styling */
tr[style*="background-color: rgb(227, 242, 253)"] {
    border: 2px solid #2196f3;
    border-radius: 6px;
}

/* Transmission Display Styling */
.transmission-display {
    margin: 15px 0 20px 0;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.transmission-display p {
    margin: 0;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.transmission-display span {
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
}

/* CSV Differential Info Styling */
.csv-differential-info {
    margin-top: 20px;
    display: none;
}

.diff-info-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #28a745;
}

.diff-info-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.diff-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.spec-item.full-width {
    grid-column: 1 / -1;
}

.spec-item label {
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.spec-item span {
    font-weight: 600;
    color: #2c3e50;
}

@media (max-width: 768px) {
    .diff-specs-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure proper chart sizing on different screens */
@media (max-width: 1200px) {
    .chart-container {
        height: 400px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 350px;
        padding: 15px;
    }
    
    #shiftAnalysisChart {
        max-height: 320px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 300px;
        padding: 10px;
    }
    
    #shiftAnalysisChart {
        max-height: 280px;
    }
}

/* Differential Management Styles */
.diff-management-container {
    margin-top: 20px;
}

.diff-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.diff-form .input-group.full-width {
    grid-column: 1 / -1;
}

.diff-form textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: all 0.3s ease;
}

.diff-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: flex-end;
}

.custom-diff-list {
    min-height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.no-custom-diffs {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 50px 0;
}

.custom-diff-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.custom-diff-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.custom-diff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.custom-diff-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.custom-diff-actions {
    display: flex;
    gap: 8px;
}

.custom-diff-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.custom-diff-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 0.9em;
    color: #495057;
}

.custom-diff-detail {
    display: flex;
    flex-direction: column;
}

.custom-diff-detail strong {
    color: #2c3e50;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.management-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.quick-templates {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.quick-templates h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.template-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
}

.template-btn:hover {
    border-color: #3498db;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.template-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1em;
}

.template-desc {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Chart Responsiveness */
@media (max-width: 768px) {
    .chart-section {
        padding: 20px;
    }
    
    .template-buttons {
        grid-template-columns: 1fr;
    }
    
    .custom-diff-details {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .management-actions {
        flex-direction: column;
    }
}


body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: #161616;
    min-height: 100vh;
    color: #333;
}

.calculator-app {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.app-header h1 {
    font-size: 2.5em;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Main Input Panel */
.main-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.input-card, .results-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e6ea;
}

.input-card h3, .results-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.unit {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
    margin-left: 5px;
}

/* Results Card */
.result-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.result-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%);
    border-radius: 10px;
    border: 1px solid #28a745;
}

.result-label {
    display: block;
    font-size: 0.8em;
    color: #155724;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #28a745;
    font-family: 'Courier New', monospace;
}

.result-unit {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #343a40;
    overflow-x: auto;
    border-bottom: 3px solid #3498db;
    position: relative;
    z-index: 1;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: #adb5bd;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    position: relative;
    z-index: 10;
    user-select: none;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-btn.active {
    background: #3498db;
    color: white;
    border-bottom-color: #2980b9;
    transform: translateY(-2px);
}

/* Tab Content */
.tab-content {
    min-height: 600px;
}

.tab-panel {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.panel-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e6ea;
}

.panel-card.full-width {
    grid-column: 1 / -1;
}

.panel-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.gear-table, .shift-table, .tire-table, .diff-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

.gear-table th, .shift-table th, .tire-table th, .diff-table th {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.gear-table td, .shift-table td, .tire-table td, .diff-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.gear-table tbody tr:hover,
.shift-table tbody tr:hover,
.tire-table tbody tr:hover,
.diff-table tbody tr:hover {
    background-color: #f8f9fa;
}

.gear-table tbody tr:nth-child(even),
.shift-table tbody tr:nth-child(even),
.tire-table tbody tr:nth-child(even),
.diff-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* RPM Status Colors */
.rpm-low { color: #28a745; font-weight: 600; }
.rpm-medium { color: #ffc107; font-weight: 600; }
.rpm-high { color: #fd7e14; font-weight: 600; }
.rpm-redline { color: #dc3545; font-weight: 700; }

.status-current {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-optimal {
    background: #cce5ff;
    color: #004085;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-available {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-high {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.current-gear-row {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%) !important;
    border-left: 4px solid #28a745;
    font-weight: 600;
}

/* Configuration Inputs */
.config-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%);
    border-radius: 8px;
    border: 1px solid #28a745;
}

.result-group label {
    font-weight: 600;
    color: #155724;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calculated-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #28a745;
    font-family: 'Courier New', monospace;
}

/* RPM Analysis Color Variants */
.calculated-value.excellent {
    color: #28a745;
}

.calculated-value.good {
    color: #ffc107;
}

.calculated-value.poor {
    color: #dc3545;
}

/* Available ratios section */
.available-ratios {
    margin: 20px 0;
}

.available-ratios h4 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
}

.ratio-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.ratio-btn {
    padding: 8px 12px;
    background-color: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    color: black;
}

.ratio-btn:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,123,255,0.2);
}

.ratio-btn.closest {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(33,150,243,0.3);
}

.ratio-btn.selected {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,123,255,0.4);
    transform: translateY(-2px);
}

/* Shift Points Controls */
.shift-controls {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Shift Analysis Table Styling */
.shift-table.enhanced .shift-rpm-header {
    background-color: #2ecc71 !important;
    color: white;
    font-weight: bold;
}

.shift-table.enhanced .shift-rpm-input {
    background-color: #d5f4e6;
    border: 1px solid #27ae60;
    padding: 8px;
    width: 100px;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.shift-table.enhanced .shift-rpm-input:focus {
    background-color: #a9dfbf;
    border-color: #2ecc71;
    outline: none;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

.shift-analysis-note {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.shift-analysis-note p {
    margin: 0 0 10px 0;
}

.shift-analysis-note p:last-child {
    margin-bottom: 0;
}

.shift-table.enhanced td:nth-child(4) {
    background-color: #d5f4e6;
    text-align: center;
}

.shift-table.enhanced th:nth-child(4) {
    background-color: #2ecc71;
    color: white;
}

/* Custom Transmission Setup Styling */
.gear-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.gear-inputs-column {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.gear-inputs-column h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.custom-transmission-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.custom-transmission-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.custom-transmission-actions .btn-primary {
    background: #3498db;
    color: white;
}

.custom-transmission-actions .btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.custom-transmission-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.custom-transmission-actions .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.custom-transmission-actions .btn-info {
    background: #17a2b8;
    color: white;
}

.custom-transmission-actions .btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
}

.custom-transmission-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.custom-transmission-info p {
    margin: 0;
    font-size: 13px;
    color: #856404;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .gear-inputs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .custom-transmission-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .custom-transmission-actions .btn {
        min-width: 200px;
    }
}

/* Current Vehicle Configuration Section Styling */
.config-section {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-bottom: 3px solid #3498db;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.config-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
}

.config-section .panel-card {
    margin: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.config-section h3 {
    margin-bottom: 20px;
    font-size: 1.4em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.input-help {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    margin-top: 5px;
    line-height: 1.3;
}

/* Available Gear Ratios Top Section */
.available-ratios-top {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.available-ratios-top h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
}

.available-ratios-top .ratio-selection {
    margin-bottom: 15px;
}

/* Ratio Button Styling */
.ratio-btn {
    padding: 8px 16px;
    background-color: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    color: #495057;
    margin: 2px;
}

.ratio-btn:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
    color: #007bff;
}

.ratio-btn.selected {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,123,255,0.4);
    transform: translateY(-2px);
}

.ratio-btn.closest {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(33,150,243,0.3);
}

/* Differential Identification Tip */
.diff-identification-tip {
    margin-top: 15px;
}

.diff-identification-tip p {
    margin: 0;
    padding: 10px 15px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.diff-identification-tip a {
    color: #007bff;
    text-decoration: underline;
    font-weight: 500;
}

.diff-identification-tip a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Responsive adjustments for config section */
@media (max-width: 768px) {
    .config-container {
        padding: 15px 20px;
    }
    
    .config-section .input-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ratio-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .available-ratios-top .ratio-selection {
        gap: 5px;
    }
}

/* Table row styling */
.shift-table.enhanced tr:nth-child(even) {
    background-color: #f8f9fa;
}

.shift-table.enhanced tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Preserve green column for editable RPM */
.shift-table.enhanced tr:nth-child(even) td:nth-child(4),
.shift-table.enhanced tr:nth-child(odd) td:nth-child(4) {
    background-color: #d5f4e6 !important;
}

/* N/A cells styling */
.shift-table.enhanced td {
    color: #6c757d;
}

.shift-table.enhanced td:contains('N/A') {
    color: #6c757d;
    font-style: italic;
    background-color: #f8f9fa !important;
}

/* Tire Calculator */
.tire-input {
    text-align: center;
}

.tire-format {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tire-format input {
    width: 80px;
    text-align: center;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
}

.tire-format span {
    font-size: 1.5em;
    font-weight: bold;
    color: #6c757d;
}

.tire-result {
    margin-top: 15px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
}

/* Differential Options */
.diff-selector {
    margin-bottom: 20px;
}

.diff-selector select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

/* Manual Entry */
.manual-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gear-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-box {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.info-box h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.ratio-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
}

.ratio-buttons button {
    padding: 8px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ratio-buttons button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #218838 0%, #1fa385 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4449 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Buttons in tables */
table button {
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

table button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* General Buttons */
button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Differential Management Styles */
.custom-differential-list {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.custom-diff-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.custom-diff-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.custom-diff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.custom-diff-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #495057;
}

.custom-diff-actions {
    display: flex;
    gap: 0.5rem;
}

.custom-diff-actions button {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
}

.custom-diff-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.custom-diff-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.custom-diff-detail strong {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

.custom-diff-detail span {
    font-size: 0.9rem;
    color: #212529;
}

.no-custom-diffs {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.template-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #007bff;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
    
    .shift-table {
        font-size: 0.9rem;
    }
    
    .shift-points-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .shift-controls-panel,
    .shift-analysis-panel {
        max-height: none;
        overflow-y: visible;
    }
    
    .chart-container-enhanced {
        height: 300px;
    }
}
    .input-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .calculator-app {
        margin: 10px;
        border-radius: 15px;
    }
    
    .app-header {
        padding: 20px;
    }
    
    .app-header h1 {
        font-size: 2em;
    }
    
    .main-inputs {
        padding: 20px;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .result-row {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .tab-panel {
        padding: 20px;
    }
    
    .shift-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .gear-inputs {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .btn-primary, .btn-secondary {
        flex: 1;
        min-width: 120px;
    }
    
    .shift-results {
        grid-template-columns: 1fr;
    }
    
    .chart-legend-controls {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .tire-format {
        flex-direction: column;
        gap: 5px;
    }
    
    .tire-format input {
        width: 100px;
    }
    
    .ratio-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print Styles */
@media print {
    .calculator-app {
        box-shadow: none;
        border-radius: 0;
    }
    
    .action-bar {
        display: none;
    }
    
    .tab-navigation {
        display: none;
    }
    
    .tab-panel {
        display: block !important;
        page-break-before: always;
    }
    
    .tab-panel:first-child {
        page-break-before: auto;
    }
}

/* Differential Identification Guide Styles */
.diff-guide-intro {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    border-radius: 5px;
}

.diff-identification-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.diff-category {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border: 1px solid #e3e6ea;
}

.diff-category h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.diff-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.diff-card {
    background: #fdfdfd;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.diff-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.diff-image {
    text-align: center;
    margin-bottom: 15px;
}

.diff-placeholder {
    width: 100%;
    height: 120px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.diff-placeholder:hover {
    transform: scale(1.02);
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Specific differential cover styling */
.diff-placeholder.gm-7-5 {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border-color: #2196f3;
}

.diff-placeholder.gm-8-5 {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #388e3c;
    border-color: #4caf50;
}

.diff-placeholder.gm-12bolt {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    color: #f57c00;
    border-color: #ff9800;
}

.diff-placeholder.ford-8-8 {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    color: #c2185b;
    border-color: #e91e63;
}

.diff-placeholder.ford-9 {
    background: linear-gradient(135deg, #f3e5f5 0%, #ce93d8 100%);
    color: #7b1fa2;
    border-color: #9c27b0;
}

.diff-placeholder.chrysler-8-75 {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    color: #f57f17;
    border-color: #ffc107;
}

.diff-placeholder.dana-44 {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    color: #00695c;
    border-color: #009688;
}

.diff-placeholder.dana-60 {
    background: linear-gradient(135deg, #efebe9 0%, #d7ccc8 100%);
    color: #5d4037;
    border-color: #795548;
}

/* Additional differential placeholders */
.diff-placeholder.chrysler-7-25 {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #e17055;
    border-color: #fd79a8;
}

.diff-placeholder.chrysler-8-25 {
    background: linear-gradient(135deg, #fab1a0 0%, #e17055 100%);
    color: #2d3436;
    border-color: #e84393;
}

.diff-placeholder.dana-35 {
    background: linear-gradient(135deg, #81ecec 0%, #74b9ff 100%);
    color: #0984e3;
    border-color: #00b894;
}

.diff-placeholder.gm-8-2 {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #2d3436;
    border-color: #fd79a8;
}

.diff-placeholder.gm-12bolt-truck {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: #2d3436;
    border-color: #00b894;
}

.diff-placeholder.gm-9-5 {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
    color: #ddd;
    border-color: #74b9ff;
}

.diff-placeholder.ford-7-5 {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: #2d3436;
    border-color: #6c5ce7;
}

.diff-placeholder.ford-9-75 {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    color: #2d3436;
    border-color: #a29bfe;
}

.diff-placeholder.ford-10-25 {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: #ddd;
    border-color: #00cec9;
}

.diff-info h5 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.diff-info p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #495057;
}

.diff-info button {
    margin-top: 15px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.diff-info button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,123,255,0.3);
}

.diff-guide-footer {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #28a745;
}

.diff-guide-footer h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.diff-guide-footer ul {
    list-style: none;
    padding: 0;
}

.diff-guide-footer li {
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95em;
    color: #495057;
}

.diff-guide-footer li:last-child {
    border-bottom: none;
}

/* Differential cover image styling */
.diff-cover-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    display: block;
}

.diff-cover-image:hover {
    transform: scale(1.05);
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Ensure proper fallback display */
.diff-image {
    position: relative;
    min-height: 130px;
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

#lightbox-image {
    max-width: 600px;
    max-height: 400px;
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.lightbox-caption {
    padding: 20px;
    background: white;
}

.lightbox-caption h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.3em;
}

.lightbox-caption p {
    color: #495057;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
}

/* Make images clickable when they exist */
.diff-cover-image {
    cursor: pointer;
}

.diff-cover-image:hover {
    transform: scale(1.02);
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Differential Cover Display in RPM Analysis */
.diff-cover-display {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #28a745;
}

.diff-cover-display label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diff-cover-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.selected-diff-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #28a745;
    flex-shrink: 0;
}

.selected-diff-placeholder {
    width: 80px;
    height: 80px;
    border: 2px dashed #28a745;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.8em;
    text-align: center;
    flex-shrink: 0;
}

/* Apply the same color styling as ID guide placeholders to selected placeholder */
.selected-diff-placeholder.gm-7-5 {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border-color: #2196f3;
}

.selected-diff-placeholder.gm-8-5 {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #388e3c;
    border-color: #4caf50;
}

.selected-diff-placeholder.gm-12bolt {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    color: #f57c00;
    border-color: #ff9800;
}

.selected-diff-placeholder.ford-8-8 {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    color: #c2185b;
    border-color: #e91e63;
}

.selected-diff-placeholder.ford-9 {
    background: linear-gradient(135deg, #f3e5f5 0%, #ce93d8 100%);
    color: #7b1fa2;
    border-color: #9c27b0;
}

.selected-diff-placeholder.chrysler-8-75 {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    color: #f57f17;
    border-color: #ffc107;
}

.selected-diff-placeholder.dana-44 {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    color: #00695c;
    border-color: #009688;
}

/* Modular Differential Selector Styles */
.diff-selector-container {
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.diff-selector-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.diff-selector-controls .input-group {
    display: flex;
    flex-direction: column;
}

.diff-selector-controls label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.diff-selector-controls select {
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s;
}

.diff-selector-controls select:focus {
    border-color: #4CAF50;
    outline: none;
}

.diff-selector-controls select:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Differential Display Area */
.diff-display-area {
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.diff-selected-info {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}

.diff-selected-image {
    text-align: center;
}

.diff-image-container {
    position: relative;
    width: 280px;
    height: 200px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: border-color 0.3s;
    overflow: hidden;
}

.diff-image-container:hover {
    border-color: #4CAF50;
}

.diff-selected-details h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.diff-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.diff-detail {
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 14px;
}

.diff-detail strong {
    color: #4CAF50;
}

.diff-applications {
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 6px;
}

.diff-applications strong {
    color: #2e7d32;
    display: block;
    margin-bottom: 8px;
}

.diff-ratios {
    margin-bottom: 20px;
}

.diff-ratios strong {
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.ratio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ratio-btn {
    padding: 6px 12px;
    border: 2px solid #4CAF50;
    background: white;
    color: #4CAF50;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.ratio-btn:hover {
    background: #4CAF50;
    color: white;
}

.diff-actions {
    display: flex;
    gap: 10px;
}

/* Quick Access Section */
.quick-access-section {
    margin: 30px 0;
}

.quick-access-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.quick-diff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.quick-diff-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.quick-diff-btn:hover {
    border-color: #4CAF50;
    background: #f9fff9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.quick-diff-btn .diff-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.quick-diff-btn .diff-desc {
    color: #666;
    font-size: 14px;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tip-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.tip-card:hover {
    border-color: #4CAF50;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tip-card h5 {
    color: #4CAF50;
    margin-bottom: 10px;
    font-size: 18px;
}

.tip-card p {
    color: #666;
    line-height: 1.5;
}

/* Manufacturer Information */
.manufacturer-info {
    background: #f0f8f0;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    padding: 20px;
}

.manufacturer-info h5 {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 20px;
}

.manufacturer-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.mfg-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    font-size: 14px;
}

.mfg-item strong {
    color: #2e7d32;
}

/* Lightbox differential details */
.lightbox-diff-details {
    text-align: left;
}

.lightbox-diff-details .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.lightbox-diff-details .detail-section {
    margin-bottom: 15px;
}

.lightbox-diff-details .detail-section strong {
    color: #4CAF50;
    display: block;
    margin-bottom: 5px;
}

/* Modular Selector Image Fixes */
.diff-display-area .selected-diff-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    background: #f9f9f9;
    border: none;
}

.diff-display-area .diff-image-container {
    position: relative;
    width: 280px;
    height: 200px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    transition: border-color 0.3s;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.diff-display-area .diff-image-container:hover {
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.diff-identification {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff3e0;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
}

.diff-identification strong {
    color: #e65100;
    display: block;
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .diff-selector-controls {
        grid-template-columns: 1fr;
    }
    
    .diff-selected-info {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .diff-image-container {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .diff-details-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-diff-grid {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .lightbox-diff-details .detail-grid {
        grid-template-columns: 1fr;
    }
}

.selected-diff-placeholder.dana-60 {
    background: linear-gradient(135deg, #efebe9 0%, #d7ccc8 100%);
    color: #5d4037;
    border-color: #795548;
}

.diff-cover-info {
    flex: 1;
}

.diff-cover-info h6 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.diff-cover-info p {
    margin: 0;
    color: #495057;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Responsive adjustments for diff cover display */
@media (max-width: 768px) {
    .diff-cover-container {
        flex-direction: column;
        text-align: center;
    }
    
    .selected-diff-image,
    .selected-diff-placeholder {
        width: 100px;
        height: 100px;
    }
}

/* Chart Section Styles */
.chart-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e6ea;
    max-width: 1200px;
    margin: 0 auto;
    height: 400px;
    position: relative;
}

#shiftAnalysisChart {
    width: 100% !important;
    height: 100% !important;
}

/* Differential Management Styles */
.diff-management-container {
    margin-top: 20px;
}

.diff-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.diff-form .input-group.full-width {
    grid-column: 1 / -1;
}

.diff-form textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: all 0.3s ease;
}

.diff-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: flex-end;
}

.custom-diff-list {
    min-height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.no-custom-diffs {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 50px 0;
}

.custom-diff-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.custom-diff-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.custom-diff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.custom-diff-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.custom-diff-actions {
    display: flex;
    gap: 8px;
}

.custom-diff-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.custom-diff-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 0.9em;
    color: #495057;
}

.custom-diff-detail {
    display: flex;
    flex-direction: column;
}

.custom-diff-detail strong {
    color: #2c3e50;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.management-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.quick-templates {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.quick-templates h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.template-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
}

.template-btn:hover {
    border-color: #3498db;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.template-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1em;
}

.template-desc {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Chart Responsiveness */
@media (max-width: 768px) {
    .chart-section {
        padding: 20px;
    }
    
    .chart-container {
        padding: 15px;
        height: 300px;
    }
    
    .template-buttons {
        grid-template-columns: 1fr;
    }
    
    .custom-diff-details {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .management-actions {
        flex-direction: column;
    }
}

/* Instructions Box Styling */
.instructions-section {
    margin: 0 0 20px 0;
    padding: 0 20px;
}

.instructions-container {
    max-width: 1400px;
    margin: 0 auto;
}

.instructions-box {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border: 3px solid #2c5aa0;
    border-radius: 8px;
    padding: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    margin-bottom: 0;
    text-align: center;
}

.instructions-box p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    font-size: 15px;
    font-weight: 500;
}

.instructions-box p:last-child {
    margin-bottom: 0;
}

.instructions-box a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
}

.instructions-box a:hover {
    color: #e6f3ff;
    text-decoration: none;
}

/* Responsive adjustments for instructions */
@media (max-width: 768px) {
    .instructions-section {
        padding: 0 15px;
    }
    
    .instructions-box {
        padding: 15px;
        font-size: 14px;
    }
    
    .instructions-box p {
        margin-bottom: 12px;
        font-size: 14px;
    }
}

