/* Wheel Interchange Calculator Styles */
.wheel-calculator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    position: relative;
}

.calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.calculator-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.calculator-header p {
    color: #666;
    font-size: 14px;
}

.car-selection-container {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.car-column {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
}

.car-column h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.form-group select:disabled {
    background: #f5f5f5;
    color: #999;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Global loading overlay (more visible spinner) */
.wic-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(1px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.wic-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.car-info {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.car-info h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.car-info p {
    margin: 5px 0;
    color: #666;
}

.wheel-specs-comparison {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.wheel-specs-comparison h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
}

.specs-table {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.specs-row {
    display: flex;
    border-bottom: 1px solid #dee2e6;
}

.specs-row:last-child {
    border-bottom: none;
}

.specs-row.specs-header {
    background: #f8f9fa;
    font-weight: bold;
}

.specs-cell {
    padding: 12px 15px;
    border-right: 1px solid #dee2e6;
    flex: 1;
}

.specs-cell:last-child {
    border-right: none;
}

.specs-cell.spec-label {
    background: #f8f9fa;
}

/* Column sizing (give more space to Result column) */
.specs-row .specs-cell:nth-child(1) {
    flex: 1.2; /* ~20% smaller than 1.5 */
}

.specs-row .specs-cell:nth-child(2),
.specs-row .specs-cell:nth-child(3) {
    flex: 0.7; /* ~30% smaller than 1 */
}

.specs-row .specs-cell:nth-child(4) {
    flex: 1.4; /* give Result more room */
}

.specs-cell.spec-car1,
.specs-cell.spec-car2 {
    text-align: center;
    font-weight: bold;
    color: #495057;
}

.specs-cell.spec-result {
    text-align: center;
    font-weight: bold;
    color: #495057;
}

.specs-cell.result-col {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-direction: column;
}

.result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.result-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    background: #adb5bd;
}

.result-text {
    font-size: 13px;
}

.result-explain {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #333;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.35;
    width: 100%;
    max-width: 420px;
}

.result-explain strong {
    font-weight: 800;
}

.result--green {
    background-color: #E8F5E9;
    color: #1B5E20;
}

.result--green .result-icon {
    background-color: #2E7D32;
}

.result--yellow {
    background-color: #FFF8E1;
    color: #E65100;
}

.result--yellow .result-icon {
    background-color: #F9A825;
}

.result--red {
    background-color: #FFEBEE;
    color: #B71C1C;
}

.result--red .result-icon {
    background-color: #C62828;
}

.tire-explanation {
    display: none;
}

.spec-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spec-image {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.trim-meta {
    margin-top: 6px;
}

.trim-meta p {
    margin: 5px 0;
    color: #666;
}

/* Donor wheel overrides */
.wic-overrides {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #dee2e6;
}

.wic-overrides__title {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.wic-overrides__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.wic-overrides__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wic-overrides__hint {
    margin-top: 8px;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .wic-overrides__grid {
        grid-template-columns: 1fr;
    }
    .wic-overrides__grid--2 {
        grid-template-columns: 1fr;
    }
}

.spec-text {
    flex: 1;
}

.spec-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.spec-description {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.3;
}

.spec-value {
    font-family: monospace;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.comparison-results {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.comparison-results h3 {
    margin-top: 0;
    color: #333;
    text-align: center;
}

.results-placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .car-selection-container {
        flex-direction: column;
        gap: 20px;
    }
}
