/* Comparison Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: rgba(18, 18, 30, 0.95);
    border-radius: 16px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 30px rgba(108, 99, 255, 0.3);
    /* Removed transform and transition for performance */
    border: 1px solid rgba(108, 99, 255, 0.3);
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(108, 99, 255, 0.2);
    background: linear-gradient(to right, rgba(18, 18, 30, 0.9), rgba(30, 30, 45, 0.9));
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

.comparison-modal-title {
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

.close-modal {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;

    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-modal:hover {
    background-color: rgba(255, 42, 109, 0.2);
    /* Removed transform for performance */
    color: #fff;
    border-color: rgba(255, 42, 109, 0.4);
}

.close-modal i {
    font-size: 1.2rem;
}

.modal-body {
    padding: 25px;
}

.comparison-content {
    width: 90%;
    max-width: 1200px;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.comparison-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    width: 100%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    text-align: center;
    border: 2px dashed rgba(108, 99, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
}

.comparison-item {
    background-color: rgba(30, 30, 45, 0.8);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(108, 99, 255, 0.2);

    display: flex;
    flex-direction: column;
    height: 100%;
}

.comparison-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(108, 99, 255, 0.3);
    border: 1px solid rgba(108, 99, 255, 0.4);
}

.comparison-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: rgba(18, 18, 30, 0.9);
    border-bottom: 1px solid rgba(108, 99, 255, 0.2);
}

.comparison-item-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
}

.remove-from-compare {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

}

.remove-from-compare:hover {
    color: #ff2a6d;
    background-color: rgba(255, 42, 109, 0.1);
    transform: scale(1.1);
}

.comparison-item-image {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.comparison-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;

}

.comparison-item:hover .comparison-item-image img {
    transform: scale(1.05);
}

.comparison-item-type {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Type-specific styling */
.comparison-item-type.electric {
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.8), rgba(0, 255, 170, 0.4));
    color: #000;
    border-color: rgba(0, 255, 170, 0.6);
}

.comparison-item-type.hybrid {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.8), rgba(0, 200, 255, 0.4));
    color: #000;
    border-color: rgba(0, 200, 255, 0.6);
}

.comparison-item-type.suv {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.8), rgba(255, 153, 0, 0.4));
    color: #000;
    border-color: rgba(255, 153, 0, 0.6);
}

.comparison-item-type.truck {
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.8), rgba(255, 51, 51, 0.4));
    color: #000;
    border-color: rgba(255, 51, 51, 0.6);
}

.comparison-item-type.sports {
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.8), rgba(255, 0, 128, 0.4));
    color: #000;
    border-color: rgba(255, 0, 128, 0.6);
}

.comparison-item-type.sedan {
    background: linear-gradient(135deg, rgba(153, 102, 255, 0.8), rgba(153, 102, 255, 0.4));
    color: #000;
    border-color: rgba(153, 102, 255, 0.6);
}

.comparison-item-details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.comparison-item-price {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #00f3ff;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
}

.comparison-item-price span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 2px;
}

.comparison-item-location {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 5px;
}

.comparison-item-location i {
    color: #ff2a6d;
}

.comparison-item-features {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.comparison-item-features .feature {
    font-size: 0.7rem;
    padding: 2px 6px;
    background-color: rgba(108, 99, 255, 0.2);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.feature-more {
    font-size: 0.7rem;
    padding: 2px 6px;
    background-color: rgba(255, 42, 109, 0.2);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 42, 109, 0.3);
}

.comparison-actions {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    border-top: 1px solid rgba(108, 99, 255, 0.2);
    background-color: rgba(18, 18, 30, 0.5);
}

#view-full-comparison {
    background: linear-gradient(135deg, #6c63ff, #ff6b6b);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;

    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

#view-full-comparison:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

#view-full-comparison:disabled {
    background: linear-gradient(135deg, #3a3a4c, #4a4a5c);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

#clear-comparison {
    background: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(255, 42, 109, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;

    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

#clear-comparison:hover {
    background: rgba(255, 42, 109, 0.2);
    color: #fff;
    border-color: rgba(255, 42, 109, 0.6);
}

/* Comparison Modal Action Buttons */
.comparison-table td .cyberpunk-button {
    margin: 5px;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 4px;

    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.comparison-table td .cyberpunk-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);

}

.comparison-table td .cyberpunk-button:hover::before {
    left: 100%;
}

.comparison-table td .btn-book-now {
    background: linear-gradient(135deg, #00f3ff, #0080ff);
    color: #000;
    border: none;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.comparison-table td .btn-book-now:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
    background: linear-gradient(135deg, #00f3ff, #0060ff);
}

.comparison-table td .btn-book-now:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.comparison-table td .btn-remove-compare {
    background: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(255, 42, 109, 0.3);
    color: #fff;
}

.comparison-table td .btn-remove-compare:hover {
    background: rgba(255, 42, 109, 0.2);
    border-color: rgba(255, 42, 109, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(255, 42, 109, 0.4);
    color: #ff2a6d;
}

.comparison-table td .btn-remove-compare:active {
    transform: translateY(1px);
    box-shadow: 0 0 5px rgba(255, 42, 109, 0.3);
}

.comparison-table td .btn-remove-compare i {
    color: #ff2a6d;

}

.comparison-table td .btn-remove-compare:hover i {
    transform: rotate(90deg);
}

/* Loading State */
.comparison-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    width: 100%;
    text-align: center;
}

.comparison-loading p {
    margin-top: 20px;
    color: #00f3ff;
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.5);

}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 243, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #00f3ff;

    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

/* Floating Compare Button */
.floating-compare-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.9), rgba(0, 255, 204, 0.9));
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.7), 0 0 5px rgba(108, 99, 255, 0.5);
    cursor: pointer;
    z-index: 1000;
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.floating-compare-btn.active {
    display: flex;
}

.floating-compare-btn:hover {
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.8), 0 0 10px rgba(108, 99, 255, 0.6);
}

.floating-compare-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff2a6d;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 42, 109, 0.7);
    border: 1px solid rgba(255, 42, 109, 0.3);
}

.floating-compare-btn i {
    font-size: 24px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    #view-full-comparison, #clear-comparison {
        width: 100%;
    }
}
